Commit graph

9206 commits

Author SHA1 Message Date
Aleksey Kladov
501c5b45ac Better config scheme & defaults 2020-04-07 08:51:52 +02:00
bors[bot]
25596e1e1a
Merge #3872
3872: fix cargo check config with custom command r=matklad a=JoshMcguigan

fixes #3871

Previously if `get::<Vec<String>>(value, "/checkOnSave/overrideCommand")` returned `Some` we'd never execute `set(value, "/checkOnSave/command", command)`, even if the `overrideCommand` was empty. 

I am not sure of the best way to prove this, but I believe the LSP clients send this config with a default value if it is not set by the user, which means `get::<Vec<String>>(value, "/checkOnSave/overrideCommand")` would return `Some(vec![])` and thus we'd never set the command to the user specified value (in the case of #3871, "clippy").

I have tested this fix manually by installing this modified version of rust-analyzer and verifying I can see clippy lints in my editor (`coc.nvim`) with `rust-analyzer.checkOnSave.command": "clippy"`.

As best I can tell this would have affected rustfmt extra args too, so this PR also applies the same fix there.

Co-authored-by: Josh Mcguigan <joshmcg88@gmail.com>
2020-04-07 06:48:04 +00:00
Josh Mcguigan
8f7fceeb9c fix cargo check config with custom command 2020-04-06 21:41:31 -07:00
Leander Tentrup
bf96d46fee Simplify HTML highlighter and add test case for highlight_injection logic 2020-04-06 23:00:09 +02:00
bors[bot]
c859a6480a
Merge #3868
3868: Fix Chalk panic r=flodiebold a=flodiebold

Fixes #3865. Basically I forgot to shift 'back' when we got `dyn Trait`s back from Chalk, so after going through Chalk a few times, the panic happened.

And yes, I did run `analysis-stats` now ;)

cc @edwin0cheng 

Co-authored-by: Florian Diebold <florian.diebold@freiheit.com>
2020-04-06 15:28:42 +00:00
Florian Diebold
236ac630f6 Fix Chalk panic
Fixes #3865. Basically I forgot to shift 'back' when we got `dyn Trait`s back
from Chalk, so after going through Chalk a few times, the panic happened.
2020-04-06 17:26:26 +02:00
Aleksey Kladov
109bb1a793
Merge pull request #3867 from matklad/deny-eprintln
Check for eprintlns on CI
2020-04-06 17:21:47 +02:00
bors[bot]
f6d688d130
Merge #3842
3842: Add lib-proc-macro mod in ra_proc_macro_srv r=matklad a=edwin0cheng

This PR add a module in ra_proc_macro_srv, which is just copy & paste from rustc lib_proc_macro and remove all unstable features in it. 

The main idea here is by doing that, we could build the `ra_proc_macro_srv` without nightly compiler and remain ABI compatibility. 

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2020-04-06 15:08:26 +00:00
Edwin Cheng
4f70162f54 Add bridge::TokenStream to crate scope 2020-04-06 23:07:48 +08:00
Edwin Cheng
b2844917ad Add proc_macro mod (copy from lib_proc_macro) 2020-04-06 23:07:48 +08:00
Edwin Cheng
40616fdb49 Refactor deps 2020-04-06 23:07:48 +08:00
Aleksey Kladov
1b2d255be1 More general CI env var 2020-04-06 17:02:06 +02:00
Aleksey Kladov
bf569f8b29 Check for eprintln on CI 2020-04-06 17:00:18 +02:00
Laurențiu Nicola
52fd2c8e48 Fix unnecessary braces warnings 2020-04-06 17:21:33 +03:00
bors[bot]
2603a9e628
Merge #3864
3864: Use log::info in trait_solve_query instead of eprintln r=edwin0cheng a=edwin0cheng

cc @flodiebold 

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2020-04-06 13:03:24 +00:00
Edwin Cheng
a569a19ef4 Use log info in trait_solve_query 2020-04-06 21:01:58 +08:00
veetaha
da091b1303 Migrate tests .txt -> .rast
The sytax tree output files now use .rast extension
(rust-analyzer syntax tree or rust abstract syntax tree
(whatever)).
This format has a editors/code/ra_syntax_tree.tmGrammar.json declaration
that supplies nice syntax highlighting for .rast files.
2020-04-06 14:04:26 +03:00
Aleksey Kladov
ec3fb1cdb4
Merge pull request #3853 from matklad/cf
Make control token modifier less ambiguous
2020-04-06 11:53:56 +02:00
bors[bot]
972816b6d4
Merge #3843
3843: Remove rustc_lexer dependency in favour of rustc-ap-rustc_lexer r=est31 a=est31

The latter is auto-published on a regular schedule (Right now weekly).

See also https://github.com/alexcrichton/rustc-auto-publish

Co-authored-by: est31 <MTest31@outlook.com>
2020-04-06 08:42:52 +00:00
bors[bot]
4f904b2970
Merge #3829
3829: Adds to SSR match for semantically equivalent call and method call r=matklad a=mikhail-m1

#3186 
maybe I've missed some corner cases, but it works in general

Co-authored-by: Mikhail Modin <mikhailm1@gmail.com>
2020-04-06 08:15:48 +00:00
est31
2f6914824a Remove rustc_lexer dependency in favour of rustc-ap-rustc_lexer
The latter is auto-published on a regular schedule (Right now weekly).
2020-04-06 10:08:51 +02:00
Aleksey Kladov
48bc0ca745 Make control token modifier less ambiguous
In textmate, keyword.control is used for all kinds of things; in fact,
the default scope mapping for keyword is keyword.control!

So let's add a less ambiguous controlFlow modifier

See Microsoft/vscode#94367
2020-04-06 09:57:50 +02:00
bors[bot]
a93a04fc9e
Merge #3744
3744: Upgrade Chalk r=matklad a=flodiebold



Co-authored-by: Florian Diebold <florian.diebold@freiheit.com>
Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2020-04-06 07:49:09 +00:00
Aleksey Kladov
0625c76009
Merge pull request #3855 from edwin0cheng/add-back-deny-cc
Add back deny_c
2020-04-06 09:42:23 +02:00
bors[bot]
cc5e67d6b4
Merge #3859
3859: Update serde_json r=kjeremy a=kjeremy

Grabs fix for https://github.com/serde-rs/json/issues/647

Co-authored-by: kjeremy <kjeremy@gmail.com>
2020-04-05 20:06:03 +00:00
kjeremy
66c20495e7 Update serde_json 2020-04-05 16:03:21 -04:00
bors[bot]
bf2d91b26a
Merge #3858
3858: Hide unit function return types r=flodiebold a=lnicola

r? @flodiebold 

This might be a bit heavy-handed (e.g. `|| -> ()` to `||`), what do you think?

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2020-04-05 18:27:44 +00:00
Laurențiu Nicola
7d62280a71 Hide unit fn return types 2020-04-05 21:06:47 +03:00
Florian Diebold
952714685a Upgrade Chalk again
The big change here is counting binders, not
variables (https://github.com/rust-lang/chalk/pull/360). We have to adapt to the
same scheme for our `Ty::Bound`. It's mostly fine though, even makes some things
more clear.
2020-04-05 19:23:18 +02:00
Florian Diebold
3659502816 Upgrade Chalk 2020-04-05 19:23:18 +02:00
bors[bot]
3431312418
Merge #3857
3857: Fix inference of function pointer return types r=flodiebold a=lnicola

Fixes #3852.

r? @flodiebold

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2020-04-05 15:23:10 +00:00
Laurențiu Nicola
b58a7f41f1 Fix inference of function pointer return types 2020-04-05 18:18:40 +03:00
Edwin Cheng
53058dd73a Add back deny_c 2020-04-05 21:45:57 +08:00
bors[bot]
e300e1e8d8
Merge #3849
3849: Cargo update r=kjeremy a=kjeremy



Co-authored-by: kjeremy <kjeremy@gmail.com>
2020-04-04 22:10:00 +00:00
kjeremy
e37e8d52f1 Cargo update 2020-04-04 17:47:19 -04:00
bors[bot]
7c2f141591
Merge #3848
3848: Remove unused dependencies r=kjeremy a=est31

Found by cargo-udeps

Co-authored-by: est31 <MTest31@outlook.com>
2020-04-04 18:00:45 +00:00
est31
dc142152e6 Remove unused dependencies 2020-04-04 19:22:14 +02:00
bors[bot]
45b9d6d553
Merge #3844
3844: vscode: restore removed default values r=matklad a=Veetaha

After refactoring the config we forgot to set defaults for
some properties like workspaceLoaded, callInfo.full, etc.
This commit restored them to being turned on by defult,
as well added defaults for other props to be more explicit
on their defualt value.
cc @matklad 

Co-authored-by: veetaha <veetaha2@gmail.com>
2020-04-04 13:32:18 +00:00
bors[bot]
2071d0b827
Merge #3845
3845: Simplify config r=matklad a=Veetaha



Co-authored-by: veetaha <veetaha2@gmail.com>
2020-04-04 13:25:20 +00:00
bors[bot]
cdb80ef039
Merge #3846
3846: vscode: log server binary path r=matklad a=Veetaha



Co-authored-by: veetaha <veetaha2@gmail.com>
2020-04-04 13:18:51 +00:00
veetaha
a1773f8a67 Remove explicit generic type parameter 2020-04-04 16:12:09 +03:00
veetaha
90959b29e0 vscode: log server binary path 2020-04-04 16:10:06 +03:00
veetaha
b5a7cb331f Simplify config 2020-04-04 16:04:49 +03:00
veetaha
486cb5b79a vscode: restore removed default values
After refactoring the config we forgot to set defaults for
some properties like workspaceLoaded, callInfo.full, etc.
This commit restored them to being turned on by defult,
as well added defaults for other props to be more explicit
on their defualt value.
2020-04-04 15:57:23 +03:00
bors[bot]
6207ac90da
Merge #3840
3840: Add parens for enums r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-04-03 19:11:40 +00:00
Aleksey Kladov
a5e8dfd024 Add parens for enums 2020-04-03 21:11:05 +02:00
Aleksey Kladov
b1cf95f691 Generalize call parenthesis insertion 2020-04-03 21:01:18 +02:00
Aleksey Kladov
adbcedde18 Remove the second code-path for completing names in patterns 2020-04-03 21:00:15 +02:00
bors[bot]
cde92d0fe1
Merge #3837
3837: Include grammar for syntax trees into vsix r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-04-03 18:05:43 +00:00
Aleksey Kladov
ab29806f32 Include grammar for syntax trees into vsix 2020-04-03 20:00:06 +02:00