Aleksey Kladov
c8b9ec8e62
Implement utf8 offsets
2021-02-16 19:17:32 +03:00
Aleksey Kladov
0025836f26
Make it easy to add additional context for offset conversion
2021-02-16 19:17:32 +03:00
Aleksey Kladov
95209aa3f8
Make utf8 default, implement utf16 in terms of it
2021-02-16 19:17:32 +03:00
Aleksey Kladov
2cb4ac9eb4
Prepare for utf-8 offsets
2021-02-16 19:17:32 +03:00
kjeremy
f9bb398cc5
Fix a few clippy::perf warnings
2021-02-16 10:55:34 -05:00
Aleksey Kladov
9852537809
Make it clear which client-side commands we use
2021-02-14 19:36:44 +03:00
ivan770
185da286d2
Moved CodeLens to ide crate
2021-02-13 13:07:47 +02:00
Jonas Schievink
70f388cedb
Pin Rust to 1.49.0 on CI
2021-02-12 13:05:56 +01:00
petr-tik
f4e3eceb6f
Add a semantic token type for char literals
...
The LSP spec doesn't recognise character literals, so
had to extend the suported types to our own custom type
2021-02-05 23:46:39 +00:00
Lukas Wirth
f2cb7dbcb7
Partially unify SymbolKind and CompletionItemKind
2021-01-20 18:39:46 +01:00
Lukas Wirth
563a175fdb
Move SymbolKind to ide_db
2021-01-20 15:25:34 +01:00
Lukas Wirth
83e49200d8
Add LifetimeParam and ConstParam to CompletionItemKind
2021-01-19 20:25:29 +01:00
Luciano Bestia
9f1d341ee9
added region folding
2021-01-18 19:45:42 +01:00
Kirill Bulatov
db335a1bbf
Add flyimport completion for trait assoc items
2021-01-16 20:44:12 +02:00
Kirill Bulatov
6742f38e49
Share import_assets and related entities
2021-01-16 19:33:36 +02:00
Lukas Wirth
d5095329a1
Phase out SourceFileEdits in favour of a plain HashMap
2021-01-14 22:43:36 +01:00
Lukas Wirth
f51457a643
Group file source edits by FileId
2021-01-14 18:35:22 +01:00
Aleksey Kladov
f0e802f490
Don't show internal server error on rename
...
Doesn't quite work due to https://github.com/microsoft/vscode-languageserver-node/issues/730
Note that this intentionally removes `impl std::Error for RenameError`
-- we nether want to blindly bubble the rename error.
2021-01-13 15:07:30 +03:00
Lukas Wirth
78fe6133c4
Split punctuation semantic highlighting up into more tags
2021-01-10 13:33:03 +01:00
Aleksey Kladov
3dfa2768ac
Shorten names
2021-01-09 14:48:15 +03:00
Aleksey Kladov
64a6ee4535
Shorten frequent names
2021-01-09 14:44:01 +03:00
Aleksey Kladov
6fb52af521
Rename dummy -> none
2021-01-09 14:41:31 +03:00
Aleksey Kladov
e30c1c3fbf
Simplify highlighting infra
...
This also fixes the killer whale bug
2021-01-08 23:47:35 +03:00
Kevaundray Wedderburn
72b9a4fbd3
Change <|> to $0 - Rebase
2021-01-07 12:09:23 +00:00
Aleksey Kladov
f8a0561178
Align config's API with usage
...
The config now is mostly immutable, optimize for that.
2021-01-06 21:22:24 +03:00
Aleksey Kladov
f7a15b5cd1
More maintainable config
...
Rather than eagerly converting JSON, we losslessly keep it as is, and
change the shape of user-submitted data at the last moment.
This also allows us to remove a bunch of wrong Defaults
2021-01-06 15:39:28 +03:00
Aleksey Kladov
624eb1ee54
More maintainable caps config
...
The idea here is that we preserve client's config as is, without
changes. This gets rid of state!
2021-01-05 17:46:57 +03:00
Lukas Wirth
18bf2e5af5
Add ConstParams to the ide layer
2021-01-01 14:43:16 +01:00
Aleksey Kladov
2f22675537
Simplify assists resolution API
...
Assist vs UnresolvedAssist split doesn't really pull its weight. This
is especially bad if we want to include `Assist` as a field of
diagnostics, where we'd have to make the thing generic.
2020-12-26 14:11:42 +03:00
Lukas Wirth
42e3f97c30
Support labels in reference search
2020-12-24 15:40:18 +01:00
Daiki Ihara
7a2eebde22
Add initial_contents field for CreateFile
2020-12-21 15:55:40 +09:00
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
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
Laurențiu Nicola
72f013b3b9
Use METHOD semantic token type
2020-12-04 18:27:10 +02:00
kjeremy
e981485b76
New lsp-types to fix versioning
...
Fixes #6603
2020-11-24 08:52:24 -05:00
kjeremy
233fdb12ce
Latest LSP 3.16 protocol
...
Pulls in https://github.com/gluon-lang/lsp-types/pull/186
2020-11-16 15:10:13 -05:00
Aleksey Kladov
7d2eb000b0
Switch to upstream protocol for resolving code action
...
Note that we have to maintain custom implementation on the client
side: I don't see how to marry bulitin resolve support with groups and
snippets.
2020-11-10 18:48:46 +01:00
Anatol Liu
3baa526fb0
Add static semantic token modifier for associated functions with no &self
2020-11-04 20:08:46 -08:00
kjeremy
5cb6fafd36
Latest proposed LSP 3.16.0
...
Needs: https://github.com/gluon-lang/lsp-types/pull/183
2020-10-26 09:23:34 -04:00
Igor Aleksanov
19cce08662
Re-export base_db from ide_db
2020-10-24 11:39:57 +03:00
bors[bot]
2fa942ad30
Merge #6251 #6310
...
6251: Semantic Highlight: Add Callable modifier for variables r=matklad a=GrayJack
This PR added the `HighlightModifier::Callable` variant and assigned it to variables and parameters that are fn pointers, closures and implements FnOnce trait.
This allows to colorize these variables/parameters when used in call expression.
6310: Rewrite algo::diff to support insertion and deletion r=matklad a=Veykril
This in turn also makes `algo::diff` generate finer diffs(maybe even minimal diffs?) as insertions and deletions aren't always represented as as replacements of parent nodes now.
Required for #6287 to go on.
Co-authored-by: GrayJack <gr41.j4ck@gmail.com>
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2020-10-23 22:12:15 +00:00
bors[bot]
81609960fa
Merge #6324
...
6324: Improve #[cfg] diagnostics r=jonas-schievink a=jonas-schievink
Unfortunately I ran into https://github.com/rust-analyzer/rust-analyzer/issues/4058 while testing this on https://github.com/nrf-rs/nrf-hal/ , so I didn't see much of it in action yet, but it does seem to work.
Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2020-10-23 10:38:30 +00:00
adamrk
3dbbcfca67
Insert ref for completions
2020-10-22 22:45:14 +02:00
Jonas Schievink
3421b645e6
Emit better #[cfg] diagnostics
2020-10-22 19:19:18 +02:00