Lukas Wirth
d3e538638a
fix: Don't duplicate attribute completions
2021-12-17 15:22:53 +01:00
bors[bot]
48cd733c9e
Merge #10956 #10986
...
10956: minor: Bump deps r=Veykril a=lnicola
bors r+
10986: fix: Fix lint completions not working for unclosed attributes r=Veykril a=Veykril
Fixes #10682
Uses keywords and nested `TokenTree`s as a heuristic to figure out when to stop parsing in case the attribute is unclosed which should work pretty well as attributes are usually followed by either of those.
bors r+
Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-12-11 14:58:07 +00:00
Lukas Wirth
0001a42570
fix: Fix lint completions not working for unclosed attributes
2021-12-11 15:55:25 +01:00
bors[bot]
d97f2f6b9b
Merge #10976
...
10976: fix: Show case-insensitive exact matches instead of fuzzy flyimport for short paths r=Veykril a=Veykril
And raise the fuzzy trigger from 2 to 3 chars. This way we keep the ability of flyimporting short names like `Rc`.
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/6917
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-12-11 13:50:55 +00:00
Lukas Wirth
143a30aa51
Show case-insensitive exact matches instead of fuzzy flyimport for short paths
2021-12-11 14:47:11 +01:00
Lukas Wirth
c81aa68afe
Don't show trait flyimports for impl trait and placeholders
2021-12-10 19:18:21 +01:00
Lukas Wirth
a7fc2061ea
Show enum completions for single variant enums in irrefutable patterns
2021-12-10 18:25:54 +01:00
Lukas Wirth
ae0c7268f7
internal: completion: split out more PathKinds from ImmediateLocation
2021-12-07 22:49:42 +01:00
Lukas Wirth
1f254dd855
feat: Enable flyimport completions for attributes
2021-12-05 15:57:28 +01:00
Lukas Wirth
e4f2d0e3a8
Introduce SymbolKind::Derive
2021-12-04 18:18:09 +01:00
Lukas Wirth
0c98a01b3e
Remove possible multiline details in completions
2021-11-24 16:08:11 +01:00
zhoufan
5666046ec9
fix: flyimport triggers on enum variant declarations
2021-11-14 12:16:21 +08:00
Lukas Wirth
7369360c15
Don't ascribe types in pattern completion for patterns twice
2021-11-05 18:39:36 +01:00
Lukas Wirth
ebd63ec1cf
feat: Make unqualified derive attributes flyimportable
2021-10-29 14:51:26 +02:00
Lukas Wirth
722489e3ff
Remove filtered completion list usage in completion tests
2021-10-27 16:53:39 +02:00
Lukas Wirth
bed6eae304
Fix qualified lint completions ignoring the qualifier value
2021-10-20 14:03:41 +02:00
Lukas Wirth
3dfe5045c5
Derive completions work on hir, not names
2021-10-19 13:50:08 +02:00
Lukas Wirth
99906baa17
Fix clippy attribute completions always prefixing with clippy::
2021-10-17 13:07:49 +02:00
Lukas Wirth
2fbd52c78f
fix: Fix qualified path completion not completing macros
2021-10-16 23:33:09 +02:00
Lukas Wirth
d71a4f40d9
Regenerate lints
2021-10-12 09:35:02 +02:00
Ariel Davis
00a615b819
Add pub(super) along with pub(crate) and pub as a completion keyword
2021-09-29 21:55:15 -07:00
bors[bot]
249ebdd076
Merge #10229
...
10229: fix: do not complete builtin attributes for qualified paths r=Veykril a=Veykril
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-09-13 22:31:39 +00:00
Lukas Wirth
845904f0bb
fix: do not complete builtin attributes for qualified paths
2021-09-14 00:31:14 +02:00
Lukas Wirth
aa1b36dc6d
Downmap the token in attribute inputs when expanding speculatively
2021-09-14 00:04:04 +02:00
Lukas Wirth
2b907652ee
Speculatively expand attributes in completions
2021-09-13 19:30:23 +02:00
Hirochika Matsumoto
1f238b3bb5
Complete #![recursion_limit = "N"]
over #![recursion_limit = N]
2021-09-05 18:05:06 +09:00
Lukas Wirth
5012fa2dd4
Add completion tests for cursor after items
2021-08-27 14:21:17 +02:00
Lukas Wirth
833de22d0b
fix: Do not show functional update completion when already qualified
2021-08-21 20:45:15 +02:00
Lukas Wirth
bf918046fa
Only complete type annotations for patterns in function params
2021-08-14 18:18:32 +02:00
Lukas Wirth
73b7b34f89
Fill out expected type for functional update syntax completion
2021-08-11 18:12:44 +02:00
Lukas Wirth
f6d6fda85b
Refine functional update completion some more
2021-08-10 17:03:38 +02:00
Lukas Wirth
e729529410
Do not drop ..Default::default()
completion when typing ..
2021-08-10 15:08:35 +02:00
Aleksey Kladov
3e5b155716
fix: avoid pathological macro expansions
...
Today, rust-analyzer (and rustc, and bat, and IntelliJ) fail badly on
some kinds of maliciously constructed code, like a deep sequence of
nested parenthesis.
"Who writes 100k nested parenthesis" you'd ask?
Well, in a language with macros, a run-away macro expansion might do
that (see the added tests)! Such expansion can be broad, rather than
deep, so it bypasses recursion check at the macro-expansion layer, but
triggers deep recursion in parser.
In the ideal world, the parser would just handle deeply nested structs
gracefully. We'll get there some day, but at the moment, let's try to be
simple, and just avoid expanding macros with unbalanced parenthesis in
the first place.
closes #9358
2021-08-09 16:15:02 +03:00
Alexandre Fourcat
9beefef8f9
Add completion for struct literal in which all fields are visible.
...
Fix ide_completion tests.
Move 'complete_record_literal' call to the main completion function.
Fix a rendering bug when snippet not available.
Checks if an expression is expected before adding completion for struct literal.
Move 'completion struct literal with private field' test to 'expressions.rs' test file.
Update 'expect' tests with new check in 'complete record literal'.
2021-08-04 18:52:58 +02:00
Aleksey Kladov
2f9273633b
feat: filter out duplicate macro completions
...
closes #9303
2021-08-03 17:36:06 +03:00
Lukas Wirth
189440c7b5
Add a Union to the base item completion test fixture
2021-07-23 17:02:39 +02:00
Lukas Wirth
8de3f7ee53
Move out unqualified_path completion tests
2021-07-23 16:37:19 +02:00
Lukas Wirth
ea72a5136c
Add functions to base items completion test fixture
2021-07-23 16:12:09 +02:00
Lukas Wirth
1f558faa8d
Describe the current lifetime/label completion specifics
2021-07-22 20:18:46 +02:00
Lukas Wirth
d5947d9d48
Clarify what the outline test module is for
2021-07-22 20:03:29 +02:00
Lukas Wirth
2d696b9c9e
Move out record completion tests
2021-07-22 19:38:49 +02:00
Lukas Wirth
03efb50ae8
Move out fn_param tests
2021-07-21 21:39:40 +02:00
Lukas Wirth
ccde0bcd1f
Only complete ancestors and self in visibility path completions
2021-07-21 18:54:12 +02:00
Lukas Wirth
3956a5b757
Simplify
2021-07-21 18:34:43 +02:00
Tom Dohrmann
7b20904e8b
hide keyword suggestions in non trivial paths
2021-07-21 12:53:50 +02:00
Lukas Wirth
c83e37c001
cov-mark
2021-07-20 19:00:52 +02:00
Lukas Wirth
f6cb42fdb8
Restrict completions inside visibility modifiers
2021-07-20 18:37:52 +02:00
Lukas Wirth
efc96b2c60
Add regression test fo #7222
2021-07-15 22:23:34 +02:00
Lukas Wirth
317b0c2e6d
Move attribute completion tests
2021-07-15 16:27:01 +02:00
Lukas Wirth
9f9cc72ee5
Complete crate
, super
and self
in non-usetree paths
2021-07-07 19:08:37 +02:00
mahdi-frms
6ac54319ea
show 'as' or 'use' before label traits
2021-07-05 16:44:44 +04:30
mahdi-frms
486bffc23e
show imported trait on autocompletion of associated items
2021-07-05 02:13:49 +04:30
Aleksey Kladov
e9d52c23b3
minor: fix lint completion sourcegen
2021-07-04 11:30:56 +03:00
Aleksey Kladov
660930623e
feat: regenrate lint completions
2021-07-03 22:24:36 +03:00
Aleksey Kladov
58d2ece88a
internal: overhaul code generation
...
* Keep codegen adjacent to the relevant crates.
* Remove codgen deps from xtask, speeding-up from-source installation.
This regresses the release process a bit, as it now needs to run the
tests (and, by extension, compile the code).
2021-07-03 22:11:03 +03:00
Lukas Wirth
85736f2dc9
Fix incorrect base fixture in ide_completion tests
2021-06-23 19:13:27 +02:00
Lukas Wirth
9abd28ac37
Restrict type bound completions to traits, modules and macros
2021-06-23 19:10:03 +02:00
Lukas Wirth
d4877ae992
Add predicate tests for ide_completions
2021-06-23 18:58:19 +02:00
Lukas Wirth
dc4876d33d
Lift out base item fixture for ide_completion tests
2021-06-23 18:37:47 +02:00
Lukas Wirth
0729913525
Various keyword completion fixes
2021-06-21 15:14:28 +02:00
Lukas Wirth
b9d85f55b7
Move out completion type position tests
2021-06-21 15:00:53 +02:00
Lukas Wirth
f835279b3a
Move out completion pattern tests
2021-06-21 13:48:25 +02:00
Lukas Wirth
2a48b53220
Correct completions in items tests
2021-06-17 15:43:21 +02:00
Lukas Wirth
a9a77671f2
Move item specific completion tests
2021-06-17 15:32:34 +02:00
Lukas Wirth
9353f36516
Fix incorrect completions in empty braced use statement
2021-06-17 13:59:31 +02:00
Lukas Wirth
2225db2eb4
Refine self
, super
and crate
completion in use paths
2021-06-17 13:56:55 +02:00
Lukas Wirth
e14f5cfff0
Move out and rewrite UseTree completion tests
2021-06-17 13:13:12 +02:00
Lukas Wirth
aa644b5585
Move test_utils into tests module
2021-06-16 21:51:52 +02:00
Lukas Wirth
11115ebad8
Don't complete paths after attributes
2021-06-16 21:51:21 +02:00
Lukas Wirth
9ea6ee6b27
Don't show incorrect completions after unsafe or visiblity node
2021-06-16 21:51:20 +02:00
Lukas Wirth
1a8f76a224
Don't complete visibility accessors after existing ones
2021-06-16 21:51:20 +02:00
Lukas Wirth
d338a80394
Start refactoring ide_completion tests
2021-06-16 21:51:20 +02:00