Commit graph

172 commits

Author SHA1 Message Date
bors
691600a885 Auto merge of #15181 - lowr:patch/import-map-purge-unused, r=Veykril
Clean up `ImportMap`

There are several things in `hir_def::import_map` that are never used. This PR removes them and restructures the code. Namely:

- Removes `Query::name_only`, because it's *always* true.
  - Because of this, we never took advantage of storing items' full path. This PR removes `ImportPath` and changes `ImportInfo` to only store items' name, which should reduce the memory consumption to some extent.
- Removes `SearchMode::Contains` for `Query` because it's never used.
- Merges `Query::assoc_items_only` and `Query::exclude_import_kinds` into `Query::assoc_mode`, because the latter is never used besides filtering associated items out.

Best reviewed one commit at a time. I made sure each commit passes full test suite. I can squash the first three commits if needed.
2023-07-03 14:37:55 +00:00
Ryo Yoshida
860628af7c
Remove SearchMode:Contains
Also micro-optimizes fuzzy search.
2023-06-30 23:37:23 +09:00
Ryo Yoshida
8cd4e9f7ec
Merge assoc_items_only and exclude_import_kinds into assoc_mode 2023-06-30 23:37:10 +09:00
Ryo Yoshida
97b725e269
Remove name_only from import map query 2023-06-30 23:35:55 +09:00
Ryo Yoshida
4e793e7859
Use anonymous lifetime where possible 2023-06-29 23:27:28 +09:00
Josh Stone
380773b3e8 Upgrade to indexmap v2 2023-06-24 17:35:20 -07:00
bors
bc26e81cd5 Auto merge of #15070 - Veykril:analysis-stat-stuff, r=Veykril
internal: Report metric timings for file item trees and crate def map creation
2023-06-21 05:58:13 +00:00
bors
a1b536ec6f Auto merge of #15054 - ponyii:fix/implement-missing-members-do-not-transform-const-params, r=lowr
fix: implement missing members doesn't transform const params and default types

Fixes https://github.com/rust-lang/rust-analyzer/issues/13363
2023-06-18 09:30:13 +00:00
Lukas Wirth
58ac823864 Less eager parsing for module sources 2023-06-17 10:58:52 +02:00
ponyii
7e08933a26 the "implement missing members" assist's const transformation patched 2023-06-16 20:34:44 +04:00
ponyii
8a3c21442e refactoring 2023-06-15 17:56:08 +04:00
ponyii
b07490ffe9 made the add_missing_impl_members and add_missing_default_members assists transform default generic types 2023-06-14 17:37:34 +04:00
ponyii
5ce65a1d92 the "implement missing members" assist's const transformation implemented 2023-06-12 20:16:22 +04:00
hkalbasi
a481e004b0 Lower const params with a bad id 2023-06-11 00:39:28 +03:30
bors
95228d23bb Auto merge of #14875 - ponyii:fix/implement-missing-members-do-not-transform-lifetimes, r=Veykril
fix: implemeted lifetime transformation fot assits

A part of https://github.com/rust-lang/rust-analyzer/issues/13363
I expect to implement transformation of const params in a separate PR

Other assists and a completion affected:
- `generate_function` currently just ignores lifetimes and, consequently, is not affected
- `inline_call` and `replace_derive_with...` don't seem to need lifetime transformation
- `trait_impl` (a completion) is fixed and tested
2023-06-10 13:22:50 +00:00
Lukas Wirth
ccce893577 Count query entries in memory usage command 2023-06-10 01:49:32 +02:00
Lukas Wirth
a02b9b279e internal: Lazy eager macros 2023-06-09 13:02:13 +02:00
ponyii
7f45cccda4 lifetime transformation: refactoring & a new test 2023-06-03 21:34:31 +04:00
ponyii
fe8f862757 made the add_missing_impl_members and add_missing_default_members assists transform lifetimes 2023-06-03 21:12:11 +04:00
Lukas Wirth
dc7c6d43c7 Slightly shrink DefMap 2023-06-01 14:46:36 +02:00
bors
8589a2d843 Auto merge of #14849 - alibektas:14557n, r=Veykril
enhancement : using doc aliases to search workspace symbols  ( fixes #14557 )

Doc aliases are now visible among symbols and can be used for searching.
2023-05-26 11:30:40 +00:00
alibektas
1222869b3e Fix #14557. Docs aliases can now be detected and used in searching for workspace symbols 2023-05-24 23:57:24 +02:00
Lukas Wirth
c7ef6c25b7 internal: Replace Display impl for Name 2023-05-24 20:55:12 +02:00
Lukas Wirth
c0519daf3b
Update crates/ide-db/src/syntax_helpers/node_ext.rs
Co-authored-by: Bastiaan Marinus van de Weerd <id@bm-w.eu>
2023-05-19 09:33:57 +02:00
Bastiaan Marinus van de Weerd
5857836047
Fix preorder_expr skipping the else block of let-else statements
Fixes exit/yield points not getting highlighted in such blocks for `highlight_related` (#14813; and possibly other bugs in features that use `preorder_expr`).
2023-05-18 18:30:27 -04:00
Lukas Wirth
2e03b198ca fix: Fix perf regression from symbol index refactor 2023-05-13 17:41:09 +02:00
Ariel Davis
02e8bb0c6e Return Option 2023-05-06 00:57:57 -07:00
Ariel Davis
1ad0779a00 Make WideEncoding non-exhaustive 2023-05-06 00:49:23 -07:00
Ariel Davis
4a1922fd1a Depend on nohash-hasher individually 2023-05-06 00:49:23 -07:00
Ariel Davis
85dd7b22b4 Use nohash_hasher, rm comment 2023-05-06 00:49:23 -07:00
Ariel Davis
7e1992a0d9 Make line-index an external lib 2023-05-06 00:49:23 -07:00
Laurențiu Nicola
7197a27028 Use triomphe Arc 2023-05-02 20:02:43 +03:00
Lukas Wirth
f501c6a516 Refactor symbol index 2023-05-02 12:11:42 +02:00
Lukas Wirth
10d7d7304b
Revert "Handle dev-dependency cycles" 2023-04-25 14:29:26 +02:00
Lukas Wirth
e205af259d Prefer test duped crates for ide features 2023-04-25 11:39:58 +02:00
bors
5750d81e30 Auto merge of #14632 - Veykril:lru-macro, r=lnicola
internal: Increase LRU cache size for parse_expansion and macro_expand queries
2023-04-22 11:13:35 +00:00
Lukas Wirth
6253fc031b Increase LRU cache size for parse_expansion and macro_expand queries 2023-04-22 11:28:56 +02:00
bors
1379b5fac7 Auto merge of #14630 - Veykril:arc, r=Veykril
internal: `Arc<String>` -> `Arc<str>`
2023-04-22 07:58:13 +00:00
Lukas Wirth
f00dcf9a69 internal: Arc<String> -> Arc<str> 2023-04-22 09:48:37 +02:00
bors
779b891526 Auto merge of #14628 - Veykril:symbols, r=Veykril
internal: Restructure symbol queries a bit
2023-04-22 07:04:33 +00:00
Lukas Wirth
e7285507f6 Restructure symbol queries 2023-04-22 08:27:10 +02:00
bors
2400b36a2e Auto merge of #14577 - jsoref:spelling, r=lnicola
Spelling

This PR corrects misspellings identified by the [check-spelling action](https://github.com/marketplace/actions/check-spelling).

The misspellings have been reported at https://github.com/jsoref/rust-analyzer/actions/runs/4699991040#summary-12751355796

The action reports that the changes in this PR would make it happy: https://github.com/jsoref/rust-analyzer/actions/runs/4699991284#summary-12751356293

closes #14567
2023-04-19 14:05:40 +00:00
Josh Soref
bc7d84c3ce Spelling
* a rule
* access
* after
* amount
* annotations
* assignment
* assist
* associated
* attribute
* borrowed
* built-in type
* clarification
* command
* const
* constructor
* corresponding
* counterparts
* curlies
* dependencies
* deterministic
* diagnostic
* duplicates
* edge
* edited
* efficient
* elsewhere
* execution
* expression
* extensions
* extracted
* fill
* github
* helper
* heuristic
* incomplete
* indent end
* inlay
* invocation
* lifetime
* looking
* maybe
* move
* mutability
* mutable
* necessarily
* necessary
* negative
* nonexistent
* occurred
* offsets
* offsetted
* overridden
* parameters
* params
* params_and_where_preds_in_scope
* paredit
* parent
* parentheses
* prepended if
* punctuation
* receive
* receiver
* referring
* repeated
* representing
* semantically
* separately
* shouldnot
* siblings
* similar
* something's
* statement
* struct
* structure
* surprise
* the
* this
* transparent
* unimplemented
* unnamed
* unnecessary
* unneeded
* unreachable
* unterminated
* utilities
* variant
* variants
* visibility
* work around (v)
* workaround

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-19 09:45:55 -04:00
Lukas Wirth
bca8029a6e Move Expander and LowerCtx into separate modules 2023-04-17 20:44:06 +02:00
Lukas Wirth
fd4bbcabe8 Actually bring back LRU limit for macro_expand query 2023-04-16 23:12:25 +02:00
Lukas Wirth
76718ea2fc Bring back LRU limit for macro_expand query 2023-04-16 21:30:04 +02:00
Lukas Wirth
a2a3fecae3 Option begone part 2 2023-04-16 19:20:48 +02:00
Lukas Wirth
0f4ffaa5af Fix duplicate eager expansion errors 2023-04-16 19:20:35 +02:00
Ryo Yoshida
ac03de773f
Add flag to disallow opaque types for DisplayTarget::SourceCode 2023-04-12 19:03:48 +09:00
bors
da9c0bd0a7 Auto merge of #14442 - DropDemBits:structured-snippet-api, r=Veykril
internal: Implement Structured API for snippets

Fixes #11638 (including moving the cursor before the generated type parameter)

Adds `add_tabstop_{before,after}` for inserting tabstop snippets before & after nodes, and `add_placeholder_snippet` for wrapping nodes inside placeholder nodes.

Currently, the snippets are inserted into the syntax tree in `SourceChange::commit` so that snippet bits won't interfere with syntax lookups before completing a `SourceChange`.

It would be preferable if snippet rendering was deferred to after so that rendering can work directly with text ranges, but have left that for a future PR (it would also make it easier to finely specify which text edits have snippets in them).

Another possible snippet variation to support would be a group of placeholders (i.e. placeholders with the same tabstop number) so that a generated item and its uses can be renamed right as it's generated, which is something that is technically supported by the current snippet hack in VSCode, though it's not clear if that's a thing that is officially supported.
2023-04-05 14:33:30 +00:00