Aleksey Kladov
041aea2263
Better filtering of qualified enum variants in completion
2020-04-29 11:26:21 +02:00
Aleksey Kladov
05cdc87158
Precompute expected type during completion
2020-04-26 10:54:08 +02:00
Jonas Schievink
5a355ff52b
Fix broken test
2020-04-25 22:23:56 +02:00
Jonas Schievink
76d6f54471
Don't add call parens when an fn type is expected
2020-04-25 22:18:57 +02:00
Aleksey Kladov
970dbf8717
Rename StructField -> Field
2020-04-25 14:23:34 +02:00
Aleksey Kladov
8843588fca
Convert tests to text-size
2020-04-25 11:59:18 +02:00
Aleksey Kladov
62e08fa53d
Better label for macros completion
2020-04-24 13:25:37 +02:00
Aleksey Kladov
5fd5de4061
Make sure that adding a snippet requires corresponding capability
2020-04-24 02:26:38 +02:00
Aleksey Kladov
647683b9bb
Add test marks
2020-04-24 01:48:32 +02:00
Aleksey Kladov
09a4b78775
Introduce ActiveParameter
2020-04-24 01:46:00 +02:00
Aleksey Kladov
4b8e9d5483
Move tests to where they belong
2020-04-24 01:26:27 +02:00
Aleksey Kladov
174952e89b
Refactor
2020-04-24 01:24:08 +02:00
Aleksey Kladov
953b5f23cc
Restore CompletionItem immutability
2020-04-24 01:17:33 +02:00
Aleksey Kladov
6654b9aff3
More functional
2020-04-24 01:08:27 +02:00
Benjamin Coenen
7f143b154e
Merge branch 'master' of github.com:rust-analyzer/rust-analyzer
2020-04-21 14:32:02 +02:00
Benjamin Coenen
1c3a1385a5
Improve autocompletion by looking on the type and name
...
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
2020-04-21 14:31:57 +02:00
Edwin Cheng
f78de3bb95
Ignore proc-macro in completion
2020-04-18 19:26:54 +08:00
Benjamin Coenen
071ef268b5
feat: improve dot completions with scoring
...
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
2020-04-17 10:29:32 +02:00
Benjamin Coenen
6ebc8bbeb0
feat: improve dot completions with scoring
...
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
2020-04-16 18:30:08 +02:00
Benjamin Coenen
d42346fed6
Improve autocompletion by looking on the type and name
...
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
2020-04-11 22:54:18 +02:00
Aleksey Kladov
5540193fc8
Don't insert !() if there's already some
2020-04-07 16:37:33 +02: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
569f47e427
Better names for config structs
2020-03-31 16:05:25 +02:00
Aleksey Kladov
b764c38436
Start stdx
...
This crate will hold everything to small to be worth publishing
2020-03-28 11:01:25 +01:00
Aleksey Kladov
687bec117c
Don't use generic DB where a concrete one will do
2020-03-13 17:58:49 +01:00
Florian Diebold
d6195fa21f
Fix completion of HashMap::new
...
The `ty` function in code_model returned the type with placeholders for type
parameters. That's nice for printing, but not good for completion, because
placeholders won't unify with anything else: So the type we got for `HashMap`
was `HashMap<K, V, T>`, which doesn't unify with `HashMap<?, ?, RandomState>`,
so the `new` method wasn't shown.
Now we instead return `HashMap<{unknown}, {unknown}, {unknown}>`, which does
unify with the impl type. Maybe we should just expose this properly as variables
though, i.e. we'd return something like `exists<type, type, type> HashMap<?0,
?1, ?2>` (in Chalk notation). It'll make the API more complicated, but harder to
misuse. (And it would handle cases like `type TypeAlias<T> = HashMap<T, T>` more
correctly.)
2020-03-13 13:04:32 +01:00
Aleksey Kladov
a6bb4cd0ec
Fix completion tests
2020-03-12 22:03:30 +01:00
Aleksey Kladov
dad8f1e064
Introduce completion test utils
2020-03-11 11:09:57 +01:00
Aleksey Kladov
9b0b59c5d2
Add a test for disabled argument snippets
2020-03-11 10:39:39 +01:00
Aleksey Kladov
bf582e77d6
Pull completion options up to the rust-analyzer
2020-03-10 18:47:09 +01:00
Aleksey Kladov
2347c03dcd
Introduce CompletionOptions
2020-03-10 18:40:22 +01:00
Aleksey Kladov
80909f7698
Don't creat public APIs with typos
2020-03-06 18:38:56 +01:00
Aleksey Kladov
3ff170d658
Trigger parameter info automatically
...
See https://github.com/Microsoft/vscode/issues/64023
2020-03-06 18:00:06 +01:00
Aleksey Kladov
4e7f6c2354
Feature flag for arg snippets
2020-03-06 17:51:10 +01:00
Aleksey Kladov
21f40f2b8f
Fix comment order
2020-03-06 17:44:30 +01:00
Aleksey Kladov
7d2ddfd3c8
Skip self param when completing methods
2020-03-04 13:01:16 +01:00
Avishay Matayev
fb34a5ba06
Support function's completion snippet
...
Note that `detail` was replced with `function_signature` to avoid
calling `from` on FunctionSignature twice.
I didn't add new tests because the current ones seem enough.
2020-03-04 11:03:32 +02:00
Florian Diebold
e55fc286fc
Fix completion snippet for reexported functions
...
Fixes #3356 .
2020-03-03 20:49:50 +01:00
Shotaro Yamada
d06733efeb
Cleanup
2020-02-19 13:36:59 +09:00
adamrk
e88eb89132
add space before/after wrapping braces
2020-02-16 16:33:15 +01:00
adamrk
04aff742b1
show names for record fields in enum completion
2020-02-16 16:10:23 +01:00
Aleksey Kladov
1d14fd1737
Use Name::missing consistently
2019-11-27 23:22:20 +03:00
Aleksey Kladov
757e593b25
rename ra_ide_api -> ra_ide
2019-11-27 21:35:06 +03:00