Commit graph

836 commits

Author SHA1 Message Date
Aleksey Kladov
113688cef0 Clarify the meaning of no-op highlight tag 2020-12-19 17:16:05 +03:00
Aleksey Kladov
a13947abe6 Use more Rustic highlighting specifiers
*Method* works for OO languages, but in rust we can also have
associated constants & types, so let's move this to a modifier.
2020-12-19 17:10:47 +03:00
Aleksey Kladov
c45221907a Deduplicate highlight tags and symbol kinds
Curiously, LSP uses different enums for those, and unsurprising and
annoyingly, there are things which exist in one but not in the other.

Let's not repeat the mistake and unify the two things
2020-12-18 23:04:26 +03:00
Aleksey Kladov
0e3581e823 NavTarget doesn't assume that it points to a symbol 2020-12-18 21:15:48 +03:00
Aleksey Kladov
55ba353b39 Don't expose SyntaxKind from IDE API
SyntaxKind is somewhat of an internal type, but IDE is using it to
basically specify an icon. Let's have a dedicated entity for this
instead.
2020-12-18 19:28:48 +03:00
Aleksey Kladov
2465fa02b7 Cleaup imports
ide should re-export everything it needs.
2020-12-18 18:02:11 +03:00
kjeremy
d828bd794b LSP 3.16 - Released 2020-12-17 11:33:35 -05:00
Lukas Wirth
55faa2daa3 Lifetime reference search 2020-12-16 22:21:01 +01:00
Jeremy Kolb
26a1675764 Remove some redundant allocations 2020-12-12 12:27:09 -05:00
Jonas Schievink
2fdde98b5c Move print_memory_usage to cli.rs 2020-12-11 18:24:27 +01:00
Jonas Schievink
c007ac3830 Avoid panic when collecting memory metrics 2020-12-11 18:18:27 +01:00
Aleksey Kladov
17f236c2b0 Normalize spelling to American English 2020-12-10 17:51:56 +03:00
kjeremy
78dd2ba196 Send a CodeLensRefresh when we reload 2020-12-09 14:36:47 -05:00
bors[bot]
243ba330dd
Merge #6785
6785: Fix "no value set for FileTextQuery(FileId(..))" r=jonas-schievink a=jonas-schievink

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/6622

Let's hope I got it right this time, but I feel like I slowly begin to understand the main loop logic.

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2020-12-09 16:32:03 +00:00
Jonas Schievink
6857989f6f Fix "no value set for FileTextQuery(FileId(..))" 2020-12-09 17:30:46 +01:00
Aleksey Kladov
6e24321e45 Introduce anchored_path
They allow to represent paths like `#[path = "C:\path.rs"] mod foo;`
in a lossless cross-platform & network-transparent way.
2020-12-09 19:07:05 +03:00
Aleksey Kladov
0890512e1c Include config into the manual 2020-12-09 15:31:10 +03:00
bors[bot]
b3ceee2a27
Merge #6761
6761: Make config.rs a single source of truth for configuration. r=matklad a=matklad

Configuration is editor-independent. For this reason, we pick
JSON-schema as the repr of the source of truth. We do specify it using
rust-macros and some quick&dirty hackery though.

The idea for syncing truth with package.json is to just do that
manually, but there's a test to check that they are actually synced.

I'll add something like `rust-analyzer --config-schema` in a follow-up
commit.


Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-12-08 18:21:28 +00:00
Jonas Schievink
4943ef085d Make original_range a method on InFile<&SyntaxNode> 2020-12-08 19:01:27 +01:00
Aleksey Kladov
2544abbf86 Make config.rs a single source of truth for configuration.
Configuration is editor-independent. For this reason, we pick
JSON-schema as the repr of the source of truth. We do specify it using
rust-macros and some quick&dirty hackery though.

The idea for syncing truth with package.json is to just do that
manually, but there's a test to check that they are actually synced.

There's CLI to print config's json schema:

    $ rust-analyzer --print-config-schema

We go with a CLI rather than LSP request/response to make it easier to
incorporate the thing into extension's static config. This is roughtly
how we put the thing in package.json.
2020-12-08 19:25:41 +03:00
bors[bot]
e2e6b709e6
Merge #6760
6760: Open Cargo.toml opens more specific manifest r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-12-08 13:30:16 +00:00
Aleksey Kladov
944f30bd69 Open Cargo.toml opens more specific manifest 2020-12-08 16:28:21 +03:00
Aleksey Kladov
ecd1c11f9e cleanup: match over unwrap 2020-12-08 16:17:46 +03:00
Kirill Bulatov
cbd3717f2c Better config name 2020-12-08 14:27:18 +02:00
Kirill Bulatov
3183ff3a7b Disable the completion for no corresponding client resolve capabilities 2020-12-08 01:07:20 +02:00
Kirill Bulatov
19cfa5802e Simplify 2020-12-07 23:41:08 +02:00
Kirill Bulatov
6badf705b3 Check lsp completions' edits for disjointness 2020-12-07 23:41:08 +02:00
Kirill Bulatov
077c1c3c1f Less panic, more tests 2020-12-07 23:41:08 +02:00
Kirill Bulatov
deda74edd8 Use stateless completion resolve 2020-12-07 23:41:08 +02:00
Kirill Bulatov
93bc009a59 Remove the state 2020-12-07 23:41:08 +02:00
Kirill Bulatov
74c3bbacc9 Make completion resolve async 2020-12-07 23:41:08 +02:00
Kirill Bulatov
f6d2540df0 Simplify import edit calculation 2020-12-07 23:41:08 +02:00
Kirill Bulatov
68a747efe0 Remove redundant code 2020-12-07 23:41:08 +02:00
Kirill Bulatov
50e06ee95a Refactor the code 2020-12-07 23:41:08 +02:00
Kirill Bulatov
d9bd1f171d Add eager resolve capability 2020-12-07 23:41:08 +02:00
Kirill Bulatov
2a7be4afb0 Better support client completion resolve caps 2020-12-07 23:41:08 +02:00
Kirill Bulatov
47464e556c Properly fill client completion resolve capabilities data 2020-12-07 23:41:08 +02:00
Kirill Bulatov
9a4daffe16 Resolve import inserts better 2020-12-07 23:41:08 +02:00
Kirill Bulatov
a539267c3b Remove unnecessary leftovers 2020-12-07 23:41:08 +02:00
Kirill Bulatov
6d2d279389 Working resolve completion imports prototype 2020-12-07 23:41:08 +02:00
Kirill Bulatov
48acd7d455 Draft the new lsp handler 2020-12-07 23:41:08 +02:00
Jonas Schievink
2b2318e695 Remove dummy ProcMacroClient in favor of Option 2020-12-07 17:16:50 +01:00
Jonas Schievink
45b8b3d57f
Apply suggestions from code review
Co-authored-by: Laurențiu Nicola <lnicola@users.noreply.github.com>
2020-12-06 14:23:55 +01:00
Jonas Schievink
2a6c246184 Update expect tests 2020-12-06 01:39:52 +01:00
Jonas Schievink
9d96a6d7af Emit additional diagnostics for hints/help/etc 2020-12-06 01:24:37 +01:00
bors[bot]
2756abb167
Merge #6721
6721: Use METHOD semantic token type r=kjeremy a=lnicola

Closes #6685

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2020-12-04 18:46:44 +00:00
Jonas Schievink
e45ab7e0ec Fix diagnostics subcommand, look at all modules 2020-12-04 19:37:37 +01:00
Laurențiu Nicola
72f013b3b9 Use METHOD semantic token type 2020-12-04 18:27:10 +02:00
Jonas Schievink
6da651f5da Don't prime caches when just opening a file 2020-12-02 20:18:28 +01:00
kjeremy
e4ffd70c91 Fix OptionalVersionedTextDocumentIdentifier type
Fixes #6654
2020-12-01 08:33:21 -05:00