bors[bot]
09c5cfedff
Merge #4914
...
4914: Fix panic in match checking r=flodiebold a=jonas-schievink
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/4416
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com >
2020-06-17 10:53:22 +00:00
David Lattimore
ac9166a7af
Remove :expr from placeholders
...
Reasoning discussed at #3186
2020-06-17 18:28:24 +10:00
Gabriel Valfridsson
656e95211e
Warnings as hint or info
2020-06-17 00:00:43 +02:00
Leander Tentrup
8ff91cf6b6
Inspect markdown code fences to determine whether to apply syntax highlighting
2020-06-16 23:03:59 +02:00
Jonas Schievink
d8af7983b1
Use ra_fixture and reformat tests
2020-06-16 22:54:41 +02:00
Jonas Schievink
9ecbadcedb
Fix index-out-of-bounds panic in match checking
2020-06-16 22:45:34 +02:00
Laurențiu Nicola
2fa0b20ce0
Remove debugging code for incremental sync
2020-06-16 22:06:24 +03:00
Aleksey Kladov
3c72fc0573
Anchor file-system operations to the file, and not to the source root.
...
Anchoring to the SourceRoot wont' work if the path is absolute:
#[path = "/tmp/foo.rs"]
mod foo;
Anchoring to a file will.
However, we *should* anchor, instead of just producing an abs path.
I can imagine a situation where, for example, rust-analyzer processes
crates from different machines (or, for example, from in-memory git
branch), where the same absolute path in different crates might refer
to different files in the end!
2020-06-16 18:45:58 +02:00
bors[bot]
6b2175878d
Merge #4891
...
4891: New VFS API r=matklad a=matklad
cc @flodiebold , @jonas-schievink
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com >
2020-06-16 11:48:36 +00:00
Aleksey Kladov
c002322bde
New VFS API
2020-06-16 13:42:29 +02:00
bors[bot]
4342b71715
Merge #4876
...
4876: Syntactic highlighting of NAME_REF for injections r=matklad a=ltentrup
This commit adds a function that tries to determine the syntax highlighting class of NAME_REFs based on the usage.
It is used for highlighting injections (such as highlighting of doctests) as the semantic logic will most of the time result in unresolved references.
It also adds a color to unresolved references in HTML encoding.
Follow up of #4683 .
Fixes #4809 .
Co-authored-by: Leander Tentrup <leander.tentrup@gmail.com >
2020-06-16 11:40:51 +00:00
bors[bot]
83a16e825d
Merge #4878
...
4878: Make "Replace qualified name with use" replace *all* mentions of the path r=matklad a=jonas-schievink
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/4836
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com >
2020-06-16 05:29:05 +00:00
Jonas Schievink
4295a004ed
Operate only on AST paths instead of HIR
2020-06-16 00:49:59 +02:00
Benjamin Coenen
9aad07dbea
don't complete top level attrs inside nested attrs and add better labels #4890
...
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com >
2020-06-15 23:11:08 +02:00
Jonas Schievink
aaaa68b56c
Simplify
2020-06-15 22:59:49 +02:00
Jonas Schievink
71c002e589
It's fookin' raw
2020-06-15 22:39:26 +02:00
Leander Tentrup
c4b3db0c2f
Syntactic highlighting of NAME_REF for injections
...
This commit adds a function that tries to determine the syntax highlighting class of NAME_REFs based on the usage.
It is used for highlighting injections (such as highlighting of doctests) as the semantic logic will most of the time result in unresolved references.
It also adds a color to unresolved references in HTML encoding.
2020-06-15 22:13:53 +02:00
bors[bot]
f4f51171ca
Merge #4860
...
4860: Accept relative paths in rust-project.json r=matklad a=tweksteen
If a relative path is found as part of Crate.root_module or Root.path, interpret it as relative to the location of the rust-project.json file.
Fixes : #4816
Co-authored-by: Thiébaud Weksteen <tweek@google.com >
2020-06-15 15:03:31 +00:00
bors[bot]
5b013e5665
Merge #4877
...
4877: Fix syntax highlighting of recursive macros r=matklad a=ltentrup
Add syntax highlighting for the BANG (`!`) token if the parent is `MACRO_CALL`.
Before:
<img width="514" alt="before" src="https://user-images.githubusercontent.com/201808/84595030-11f65c00-ae56-11ea-9bb2-b1abe2236990.png ">
After:
<img width="516" alt="recursive-macro" src="https://user-images.githubusercontent.com/201808/84594981-d196de00-ae55-11ea-8636-f877d5d795ff.png ">
Fixes #4694 .
Co-authored-by: Leander Tentrup <leander.tentrup@gmail.com >
2020-06-15 13:44:46 +00:00
Leander Tentrup
06f89e5f3a
Fix syntax highlighting of recursive macros
...
Add syntax highlighting for the BANG (`!`) token if the parent is `MACRO_CALL`.
2020-06-15 15:03:13 +02:00
David Lattimore
fe7d35d477
Make ra_syntax::{SyntaxNodeChildren, SyntaxElementChildren} public.
...
SyntaxNode::children and SyntaxNode::children_with_tokens return these types, but there's currently no way AFAIK to name them.
2020-06-15 21:36:30 +10:00
Thiébaud Weksteen
44f28f65af
Accept relative paths in rust-project.json
...
If a relative path is found as part of Crate.root_module or Root.path,
interpret it as relative to the location of the rust-project.json file.
2020-06-15 13:11:53 +02:00
bors[bot]
db6100dbaa
Merge #4889
...
4889: Deprecate hir::Path::from_ast r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com >
2020-06-15 09:02:53 +00:00
Aleksey Kladov
b5c4f2faa2
Update parser tests with env var
2020-06-15 11:02:17 +02:00
Aleksey Kladov
d739731830
Allow attributes on expressions
...
https://github.com/rust-lang/rust/pull/69201/
2020-06-15 10:59:05 +02:00
Aleksey Kladov
52a220cece
Deprecate hir::Path::from_ast
2020-06-15 10:55:48 +02:00
bors[bot]
6609e71b16
Merge #4882
...
4882: _match.rs: improve comment formatting r=matklad a=jonas-schievink
This results in much nicer rustdoc output
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com >
2020-06-15 08:25:05 +00:00
Toby Dimmick
41f5471f3e
fill_match_arms bind pattern implementation
2020-06-14 22:44:51 +01:00
Toby Dimmick
34db4edb80
fill_match_arms bind pattern test
2020-06-14 22:43:16 +01:00
Benjamin Coenen
36d9105d0e
display Doctest code lens before comment #4785
...
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com >
2020-06-14 21:50:24 +02:00
Jonas Schievink
4ebafb9005
_match.rs: improve comment formatting
2020-06-14 15:56:02 +02:00
Aleksey Kladov
a32cff333d
Introduce paths crate
...
It's a good idea to distinguish between absolute and relative paths at
the type level, to avoid accidental dependency on the cwd, which
really shouldn't matter for rust-analyzer service
2020-06-14 14:15:36 +02:00
Veetaha
667d224fcc
Reduce the usage of bare subscript operator
2020-06-14 13:12:52 +03:00
Jonas Schievink
5d66bfe163
Shorten *all* qualified paths when adding use
2020-06-13 19:12:05 +02:00
Jonas Schievink
b65c0a5893
Expose find_insert_use_container
2020-06-13 19:05:46 +02:00
Jonas Schievink
e9eb54c617
Fix rewrite_root when there's only 1 replacement
2020-06-13 19:05:46 +02:00
bors[bot]
246c66a7f7
Merge #4867
...
4867: Cleanup URL handling r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com >
2020-06-13 12:35:44 +00:00
Aleksey Kladov
50bbf7233d
Cleanup URL handling
2020-06-13 14:15:38 +02:00
bors[bot]
d00ca86da4
Merge #4868
...
4868: Fix if and while postfix completions r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com >
2020-06-13 12:12:08 +00:00
Aleksey Kladov
7dafe951d4
Fix if and while postfix completions
2020-06-13 14:06:13 +02:00
bors[bot]
c87c4a0a40
Merge #4700
...
4700: Add top level keywords completion r=matklad a=mcrakhman
This fixes the following issue: https://github.com/rust-analyzer/rust-analyzer/issues/4566 .
Also added simple logic which filters the keywords which can be used with unsafe on the top level.
Co-authored-by: Mikhail Rakhmanov <rakhmanov.m@gmail.com >
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com >
2020-06-13 12:02:59 +00:00
Aleksey Kladov
b99b4953c9
More concise completion tests
2020-06-13 13:57:18 +02:00
Aleksey Kladov
ef70076f1d
Cleanup
2020-06-13 13:47:30 +02:00
Mikhail Rakhmanov
912f38200f
Add keywords completions on source file position
2020-06-13 10:43:39 +02:00
Mikhail Rakhmanov
16bbf4ab7f
Merge branch 'master' into keyword_completion
...
# Conflicts:
# docs/user/generated_features.adoc
2020-06-13 08:42:15 +02:00
Mikhail Rakhmanov
eeb8b9e236
Fix tests and remove unused methods
2020-06-13 01:21:48 +02:00
Mikhail Rakhmanov
6feb52c12a
Add more patterns, tests and fix keywords
2020-06-13 00:55:21 +02:00
Mikhail Rakhmanov
3576671043
Rewrite snapshot checks
2020-06-12 20:30:57 +02:00
Timo Freiberg
f5ac313000
Add quickfix to add a struct field
2020-06-12 18:52:44 +02:00
Gabriel Valfridsson
66291d19f9
Revert "Hide squiggly for unused and unnecessary"
...
This reverts commit 599c105e6f .
2020-06-12 18:39:50 +02:00