bors[bot]
c9989a524c
Merge #3153
...
3153: When a single test is run, do not run others with overlapping names r=matklad a=SomeoneToIgnore
Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
2020-02-17 08:52:45 +00:00
Kirill Bulatov
dabdb57067
Simplify module retrieval
2020-02-16 18:44:46 +02:00
Aleksey Kladov
28fa5edbce
Add module colors to css
2020-02-16 17:06:01 +01: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
Kevin DeLorey
057d0bee55
Added module doc comment to explain the purpose of the completion.
2020-02-15 10:27:04 -06:00
Kevin DeLorey
ae8ae650fc
Fixed bug that allowed for completion in a nested method.
2020-02-15 09:50:07 -06:00
Kevin DeLorey
fc13b7fc9a
Reordered the use
items.
2020-02-14 18:54:00 -06:00
Kirill Bulatov
426c0f26fe
If possible, use --exact flag when running tests
2020-02-15 01:06:14 +02:00
Mikhail Modin
f8f454ab5c
Init implementation of structural search replace
2020-02-14 21:45:42 +00:00
Kevin DeLorey
be97cbfdb4
Adjusted the completion lookups to filter by just the name.
2020-02-13 19:10:08 -06:00
Kevin DeLorey
0bc9e62374
Completion now replaces whole fn/const/type def with snippet.
2020-02-12 21:00:47 -06:00
Kevin DeLorey
43e62a87ab
Cheese const tests as they requre an ident before becoming a CONST_DEF.
2020-02-12 20:46:55 -06:00
Kevin DeLorey
877cfbacf9
Started to refactor the trigger of the trait_impl completion.
2020-02-12 20:21:43 -06:00
Aleksey Kladov
6ec982d54d
Simplify
2020-02-12 18:02:00 +01:00
Aleksey Kladov
f3dd0a05bb
Return early, return often
2020-02-11 18:36:12 +01:00
Aleksey Kladov
adfed5c689
Fix join lines when two rules match
2020-02-11 18:33:25 +01:00
Kevin DeLorey
6f130e7ef8
Formatting.
2020-02-11 10:07:23 -06:00
Kevin DeLorey
47d314e856
Fixing minor suggestions and added module level documentation.
2020-02-11 10:04:30 -06:00
Kevin DeLorey
e664cd73e3
Removed doc comments entirely from the changes.
2020-02-11 09:48:26 -06:00
bors[bot]
305d921982
Merge #3064
...
3064: Handle macro token cases for rename r=matklad a=edwin0cheng
Fixes #2957
Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2020-02-11 15:46:05 +00:00
Kevin DeLorey
3aaf46afa1
Formatted changes.
2020-02-11 09:40:08 -06:00
Kevin DeLorey
d7e36c3dd2
Removed docs from private method.
2020-02-11 07:31:39 -06:00
Kevin DeLorey
785723e0d9
Added tests to test associated types and consts.
2020-02-10 21:02:51 -06:00
Kevin DeLorey
52c4324e31
Added some documentation to the complete_trait_impl
completion.
2020-02-10 20:55:49 -06:00
Kevin DeLorey
3ffc84fd15
Added associated const magic completion.
2020-02-09 20:59:12 -06:00
Matthew Jasper
8c8d0bb34f
Add or- and parenthesized-patterns
2020-02-09 22:06:15 +00:00
Kevin DeLorey
d85abd77b9
Added a utility function that can be used to determine the missing impl items.
2020-02-09 12:24:59 -06:00
Kevin DeLorey
a957c473fd
Merge branch 'master' into kdelorey/complete-trait-impl
2020-02-09 10:37:43 -06:00
Aleksey Kladov
9769c5140c
Simplify Assists interface
...
Instead of building a physical tree structure, just "tag" related
assists with the same group
2020-02-09 16:03:54 +01:00
Edwin Cheng
3038470c68
Use get_or_insert_with
2020-02-09 20:41:29 +08:00
Edwin Cheng
dd0421e587
Handle macro token cases for rename
2020-02-09 17:17:56 +08:00
Aleksey Kladov
409f8e1fb0
Remove hard-coded auto-import during completion
...
We now have a real auto-import system, so we can do a proper thing.
2020-02-09 10:04:47 +01:00
Kevin DeLorey
22caf982b9
Added associated type completion.
2020-02-08 15:41:25 -06:00
Kevin DeLorey
5c0c18926b
Cleaning up unessicary code that the Magic completion takes care of.
2020-02-08 13:22:31 -06:00
Kevin DeLorey
f801723dd2
Got the magic completion working.
2020-02-08 11:28:39 -06:00
Kevin DeLorey
5216b09ed6
Update completion kind to Magic in the unit tests.
2020-02-07 21:02:01 -06:00
Kirill Bulatov
740a26b7d2
Rename add import assist
2020-02-07 23:53:08 +02:00
Aleksey Kladov
ae70d07237
Rename
2020-02-07 14:26:59 +01:00
Aleksey Kladov
f55be75a17
Remove irrelevant distinction
2020-02-07 14:25:16 +01:00
Aleksey Kladov
7e73b7a5f8
Minor rename
2020-02-06 18:47:26 +01:00
Aleksey Kladov
ad204f7562
Mostly remove ImoportLocator infra
2020-02-06 17:17:51 +01:00
Aleksey Kladov
a173e31890
Make assists use ImportsLocator directly
2020-02-06 16:40:28 +01:00
Aleksey Kladov
dfbe96750b
Move imports locator to ide_db
2020-02-06 16:26:43 +01:00
Aleksey Kladov
271017e6bf
Move NameKind up
2020-02-06 16:23:28 +01:00
Aleksey Kladov
f8dde21fe9
Simplify
2020-02-06 16:00:39 +01:00
Aleksey Kladov
832dfae250
Tweak goto parent module
2020-02-06 15:47:33 +01:00
Aleksey Kladov
8a39519e1c
Cleanup
2020-02-06 15:10:07 +01:00
Aleksey Kladov
88267c86c0
cleanup imports
2020-02-06 14:03:45 +01:00
Aleksey Kladov
939f05f3e3
Move to a crate
2020-02-06 12:43:56 +01:00
Aleksey Kladov
1bfb111cf9
Move change to ide-db
2020-02-06 12:35:40 +01:00
Aleksey Kladov
ee76e6141e
Fix test imports
2020-02-06 12:26:10 +01:00
Aleksey Kladov
0509a0a34e
Move Query
2020-02-06 12:24:13 +01:00
Aleksey Kladov
ad247aa670
Move symbol_index
2020-02-06 12:22:35 +01:00
Aleksey Kladov
ec95152a4e
Move FeatureFlags
2020-02-06 12:18:52 +01:00
Aleksey Kladov
ee2ee1a8ff
Move line_index
2020-02-06 12:17:40 +01:00
Aleksey Kladov
551f33d754
Move ide-db
2020-02-06 12:08:08 +01:00
Aleksey Kladov
896906fea8
Start ide_db
2020-02-06 12:07:06 +01:00
Kirill Bulatov
78092c7c66
Apply the reviews suggestions
2020-02-05 12:47:28 +02:00
Kevin DeLorey
fc46ed81ee
Add detection for a user already starting a fn impl and still providing completion.
2020-02-04 22:04:57 -06:00
Aleksey Kladov
f5a20014ce
minor, if let else -> match
2020-02-04 13:41:56 +01:00
Veetaha
9e7eaa959f
ra_syntax: refactored the lexer design as per @matklad and @kiljacken PR review
2020-02-04 00:00:55 +02:00
Veetaha
ac37a11f04
Reimplemented lexer with vectors instead of iterators
2020-02-04 00:00:55 +02:00
Kirill Bulatov
fcf5bbbbeb
Fix inlay hints test snippet compilation
2020-02-03 13:35:14 +02:00
Aleksey Kladov
24ad1cce2c
Avoid premature pessimization
...
The extra allocation for message should not matter here at all, but
using a static string is just as ergonomic, if not more, and there's
no reason to write deliberately slow code
2020-02-02 18:56:37 +01:00
Kirill Bulatov
c669b2f489
Code review fixes
2020-02-02 14:27:52 +02:00
Kirill Bulatov
6dae5cbb11
Require ModPath for importing
2020-02-02 14:06:51 +02:00
Aleksey Kladov
f1720d7983
Re-sync queries for memory usage measurnment
2020-01-29 16:10:46 +01:00
Kevin DeLorey
698ff91c13
Already implemented fn will no longer be suggested for trait implementations.
2020-01-28 20:33:12 -06:00
Mikhail Modin
fbc3ffcee6
Improves reference search by StructLiteral
2020-01-27 21:34:19 +00:00
bors[bot]
1d729033eb
Merge #2883
...
2883: Implement Syntax Highlight inside macro call r=matklad a=edwin0cheng
Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2020-01-27 13:36:26 +00:00
Kirill Bulatov
9be1ab7ff9
Code review fixes
2020-01-27 14:42:45 +02:00
Kirill Bulatov
d0a782ef1c
Have a better trait interface
2020-01-27 00:17:10 +02:00
Kirill Bulatov
bef5cf0b99
Raise the import search query cap
2020-01-27 00:16:29 +02:00
Kirill Bulatov
f57239729c
Remove unnecessary lifetime parameter
2020-01-27 00:16:29 +02:00
Kirill Bulatov
316795e074
Initial auto import action implementation
2020-01-27 00:16:29 +02:00
bors[bot]
adda6dbdf8
Merge #2899
...
2899: Provide more runners for potential tests r=matklad a=SomeoneToIgnore
Based on the https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Fwg-rls-2.2E0/topic/Runners.20for.20custom.20test.20annotations discussion.
Adds a test runner for every method that has an annotation that contains `test` word in it, allowing to run tests annotated with custom testing annotations such as `#[tokio::test]`, `#[test_case(...)]` and others at costs of potentially emitting some false-positives.
Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
2020-01-25 11:10:28 +00:00
Aleksey Kladov
b90ea640e6
Cancel requests during shutdown
2020-01-24 16:35:37 +01:00
Kirill Bulatov
3137215e8d
Provide more runners for potential tests
2020-01-23 13:40:21 +02:00
Kevin DeLorey
bc1fc6239d
Renamed the trait completion mod.
2020-01-22 22:38:03 -06:00
Kevin DeLorey
e3cda83f90
Added basic support for completing fn
for trait impl.
2020-01-22 22:34:00 -06:00
Kirill Bulatov
4029e44102
Omit default parameters for reference types
2020-01-22 16:55:09 +02:00
Edwin Cheng
f320af4d63
Implement Syntax Highlight inside Macro
2020-01-21 00:06:47 +08:00
Florian Diebold
18ec4e3403
Improve parameter hints a bit & add emacs support
...
- just include the name, not e.g. `mut`
- don't return empty hints (or `_`)
2020-01-18 13:40:32 +01:00
Aleksey Kladov
595b06a1b8
Create modules via SourceBinder
2020-01-16 17:33:07 +01:00
Aleksey Kladov
9a6c26e348
Move module to SourceBinder
2020-01-16 16:53:11 +01:00
Aleksey Kladov
7aa627fe58
Move more stuff to SourceBinder
2020-01-16 16:37:51 +01:00
Aleksey Kladov
a3d6ddbe69
More natural trait setup
2020-01-16 16:27:21 +01:00
Aleksey Kladov
81a45ca1b3
Make FromSource private
2020-01-16 16:08:46 +01:00
Aleksey Kladov
272f6dfd9e
Micro-optimize type hints to avoid allocations
2020-01-16 14:31:34 +01:00
bors[bot]
c78d269b66
Merge #2837
...
2837: Accidentally quadratic r=matklad a=matklad
Our syntax highlighting is accdentally quadratic. Current state of the PR fixes it in a pretty crude way, looks like for the proper fix we need to redo how source-analyzer works.
**NB:** don't be scared by diff stats, that's mostly a test-data file
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-01-15 19:38:10 +00:00
Kirill Bulatov
d51cf7794d
itertools::Either -> either::Either
2020-01-15 20:20:20 +02:00
Kirill Bulatov
78a21253b4
Apply the api design suggestions
2020-01-15 20:17:17 +02:00
Kirill Bulatov
73dc8b6f06
Another attempt to add multiple edits
2020-01-15 20:16:27 +02:00
Aleksey Kladov
aaef88db0e
Typos
2020-01-15 16:53:01 +01:00
Aleksey Kladov
5b255b4e6b
⬆️ once_cell
2020-01-15 16:52:28 +01:00
Aleksey Kladov
787d1aba63
Add comment
2020-01-15 16:52:28 +01:00
Aleksey Kladov
4194e5c88c
Optimize inlay hints
2020-01-15 16:52:28 +01:00
Aleksey Kladov
11d6b9dadd
Only new-style classification
2020-01-15 16:52:28 +01:00
Aleksey Kladov
35bfeaf4af
Add a test
2020-01-15 16:52:28 +01:00
Aleksey Kladov
c640c2ea11
Make syntax highlighting linear
2020-01-15 16:52:28 +01:00
Aleksey Kladov
ccfe53376a
Introduce SourceBinder
2020-01-15 16:52:28 +01:00
bors[bot]
876f92d547
Merge #2843
...
2843: Add inlay parameter name hints for call expr r=matklad a=imtsuki
This patch adds Intellij-like parameter name hints for literal values in function calls.
<img width="624" alt="Screenshot" src="https://user-images.githubusercontent.com/8423594/72366533-68d7f800-3735-11ea-9279-cf193ca8ca2f.png ">
Signed-off-by: imtsuki <me@qjx.app>
Co-authored-by: imtsuki <me@qjx.app>
2020-01-15 10:24:51 +00:00
imtsuki
d854ad8f27
FnSignature: use unwrap_or_default for parameter_name_list
...
Signed-off-by: imtsuki <me@qjx.app>
2020-01-15 09:30:19 +08:00
imtsuki
d78a3cb638
Update test snapshot
...
Signed-off-by: imtsuki <me@qjx.app>
2020-01-15 01:32:03 +08:00
imtsuki
c390e92fdd
Add inlay parameter name hints for function calls
...
Signed-off-by: imtsuki <me@qjx.app>
2020-01-15 01:18:52 +08:00
Aleksey Kladov
a38540771f
Move Type API to type
2020-01-14 14:42:52 +01:00
Aleksey Kladov
52e7f67128
Move impls_future to Type, where it belongs
2020-01-14 11:29:43 +01:00
Aleksey Kladov
0358f5fdeb
Use lang-items to resolve future trait
2020-01-14 11:29:43 +01:00
kjeremy
c5c5f4260b
Readability
2020-01-13 11:38:53 -05:00
kjeremy
a82c679c97
Some clippy lints
2020-01-13 11:27:06 -05:00
memoryruins
5575588387
Add macro_rules item snippet
2020-01-12 18:47:15 -05:00
Roland Ruckerbauer
20b8d283ae
Remove hir usage from macro_rules! detection in structure_node()
2020-01-12 17:34:57 +01:00
Roland Ruckerbauer
15c5426b54
Use hir .path() and .name() to differentiate
...
macro call and macro definition
2020-01-12 17:34:57 +01:00
Roland Ruckerbauer
c6655c67d2
Added test for file_structure unidentified macro definition
2020-01-12 17:34:57 +01:00
Roland Ruckerbauer
db151763d4
Fix file_structure() to recognize macro_rules!
...
where first token != "macro_rules"
2020-01-12 17:34:57 +01:00
Edwin Cheng
0593da9a36
Fix format
2020-01-12 20:25:58 +08:00
Edwin Cheng
384e1ced88
Use prev_token and next_token
2020-01-12 20:25:58 +08:00
Edwin Cheng
b7ab079211
Use indices first and last instead of min-max
2020-01-12 20:25:58 +08:00
Edwin Cheng
caed836e41
Use first and last token only
2020-01-12 20:25:58 +08:00
Edwin Cheng
b30e6a7b56
Handle extend selection in recursive macro
2020-01-12 20:25:58 +08:00
Edwin Cheng
07f4171b18
Minor fix
2020-01-12 20:25:58 +08:00
Edwin Cheng
4c4416543a
Fix formatting
2020-01-12 20:25:58 +08:00
Edwin Cheng
83b2d78bbb
Supporting extend selection inside macro calls
2020-01-12 20:25:58 +08:00
Edwin Cheng
db5f73d261
Add test
2020-01-12 19:24:34 +08:00
Edwin Cheng
d7be1a4372
Use attr location for builtin macro goto-imp
2020-01-12 18:08:53 +08:00
Florian Diebold
15fc643e05
Fix ordering problem between qualifying paths and substituting params
2020-01-11 23:33:04 +01:00
kjeremy
32540abcb3
Add AccessMode to decls
2020-01-10 15:14:19 -05:00
kjeremy
49fd6a5228
Split Declaration out into it's own type
2020-01-10 15:14:19 -05:00
kjeremy
cc96ddfe69
Simplify and update tests to account for access
2020-01-10 15:14:19 -05:00
Jeremy Kolb
6c89d86ade
Tweaks
2020-01-10 15:14:19 -05:00
Jeremy Kolb
d993f329a0
Basic DocumentHighlightKind support for assignments
2020-01-10 15:14:19 -05:00
Edwin Cheng
19094abd41
Proper handling local in hover
2020-01-11 01:51:08 +08:00
Aleksey Kladov
cf5bdf464c
Merge pull request #2732 from detrumi/cargo-toml-not-found-message-toggle
...
Flag to hide cargo.toml not found error
2020-01-09 15:16:39 +01:00
bors[bot]
3263c70766
Merge #2772
...
2772: Actually test references r=kjeremy a=kjeremy
This will be a little more work when `ReferenceSearchResults` change but I think it's easier to maintain in the end. It also follows a similar pattern to navigation targets and call hierarchy.
Co-authored-by: kjeremy <kjeremy@gmail.com>
Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
2020-01-09 12:26:59 +00:00
Jeremy Kolb
6fc80efe77
visibility tweak
2020-01-09 07:26:04 -05:00
kjeremy
9791b9c36a
Actually test references
2020-01-08 16:35:58 -05:00
Michal Terepeta
d761435ba0
Remove the Default impl for SourceRoot
...
Let's be always explicit whether we create a library (i.e., an immutable
dependency) or a local `SourceRoot`, since it can have a large impact on
the validation performance in salsa. (we found it the hard way recently,
where the `Default` instance made it quite tricky to spot a bug)
Signed-off-by: Michal Terepeta <michal.terepeta@gmail.com>
2020-01-08 19:42:27 +01:00
kjeremy
c7b2bc1363
Move private API down
2020-01-08 11:33:04 -05:00
Jeremy Kolb
1b19a8aa5e
Implement proposed CallHierarchy feature
...
See: https://github.com/microsoft/vscode-languageserver-node/blob/master/protocol/src/protocol.callHierarchy.proposed.ts
2020-01-08 10:15:49 -05:00
Mikhail Modin
fb25c91979
Adds a way to limits reference search by StructLiteral
2020-01-08 15:21:54 +01:00
Aleksey Kladov
5d8f2bd822
Merge pull request #2762 from edwin0cheng/fix-2759
...
Reject tuple index for missing fields assist
2020-01-08 12:49:54 +01:00
Edwin Cheng
a4c9babedb
Proper emit diagnostic without fix
2020-01-08 02:18:43 +08:00
Edwin Cheng
e55e6da13a
Reject tuple index for missing fields assist
2020-01-08 02:08:17 +08:00
Edwin Cheng
1fdee24608
Use src node for analyze source
2020-01-08 00:23:53 +08:00
Michal Terepeta
be967b94e1
Fix a problem with Durability
of libraries
...
When processing a change with added libraries, we used
`Default::default` for `SourceRoot` which sets `is_library` to false.
Since we use `is_library` to decide whether to use low or high
durability, I believe that this caused us to mark many library
dependencies as having low durability and thus increased the size of the
graph that salsa needed to verify on every change.
Based on my initial tests this speeds up the `CrateDefMapQuery` on
rust-analyzer from about ~64ms to ~14ms and reduces the number of
validations for the query from over 60k to about 7k.
Signed-off-by: Michal Terepeta <michal.terepeta@gmail.com>
2020-01-06 22:21:56 +01:00
Michal Terepeta
d6c2a59538
Split infer
query into two for better profiling
...
This is the same change as we did with `crate_def_map` and it does seem
that we mostly spend time in salsa, without recomputing much on
rust-analyzer side.
Example output:
```
233ms - handle_inlay_hints
163ms - get_inlay_hints
163ms - SourceAnalyzer::new
67ms - def_with_body_from_child_node
67ms - analyze_container
67ms - analyze_container
67ms - Module::from_definition
67ms - Module::from_file
67ms - crate_def_map
0ms - parse_macro_query (6 calls)
0ms - raw_items_query (1 calls)
66ms - ???
0ms - crate_def_map (1 calls)
0ms - crate_def_map (1 calls)
96ms - infer
2ms - trait_solve_query (2 calls)
94ms - ???
0ms - body_with_source_map_query (1 calls)
0ms - crate_def_map (1 calls)
[...]
```
Signed-off-by: Michal Terepeta <michal.terepeta@gmail.com>
2020-01-03 19:58:11 +01:00
Wilco Kusee
e7bb82c3a4
Allow disabling Cargo.toml not found error
2020-01-03 15:04:54 +01:00
Michal Terepeta
7cd6f12926
Split crate_def_map
into two methods
...
This change:
- introduces `compute_crate_def_map` query and renames
`CrateDefMap::crate_def_map_query` for consistency,
- annotates `crate_def_map` as `salsa::transparent` and adds a
top-level `crate_def_map` wrapper function around that starts the
profiler and immediately calls into `compute_crate_def_map` query.
This allows us to better understand where we spent the time, in
particular, how much is spent in the recomputaiton and how much in
salsa.
Example output (where we don't actually re-compute anything, but the
query still takes a non-trivial amount of time):
```
211ms - handle_inlay_hints
150ms - get_inlay_hints
150ms - SourceAnalyzer::new
65ms - def_with_body_from_child_node
65ms - analyze_container
65ms - analyze_container
65ms - Module::from_definition
65ms - Module::from_file
65ms - crate_def_map
1ms - parse_macro_query (6 calls)
0ms - raw_items_query (1 calls)
64ms - ???
```
Signed-off-by: Michal Terepeta <michal.terepeta@gmail.com>
2020-01-03 13:59:46 +01:00
Aleksey Kladov
26bd7a896b
Drop support for legacy colorization
2019-12-31 14:11:25 +01:00