Lukas Wirth
439a8194b0
Replace more Name::to_string usages with Name::to_smol_str
2021-11-04 18:12:05 +01:00
Aramis Razzaghipour
9583dd5725
Replace if let with match where appropriate
2021-10-05 09:00:21 +11:00
Lukas Wirth
b6ed91a6de
Rename *Owner traits to Has*
2021-09-27 12:54:24 +02:00
Lukas Wirth
d777eddf0d
Improve call_hierarchy and incoming/outgoing_calls
2021-09-16 02:25:02 +02:00
Dezhi Wu
ba0947dded
switch log crate to tracing
2021-08-30 15:11:42 +08:00
Lukas Wirth
c67ecbebc4
Rename fails on renaming definitions created by macros
2021-08-20 00:12:47 +02:00
Lukas Wirth
0c0142f61a
Simplify
2021-08-16 16:12:20 +02:00
Lukas Wirth
894a09b749
Simplify
2021-08-14 18:02:51 +02:00
Lukas Wirth
62ab73767f
resolve_doc_path is able to resolve to macros
2021-08-02 14:33:09 +02:00
Aleksey Kladov
c2015e7d18
internal: more natural order of sources for TypeParam
...
We usually use first (left) variant of `Either` for "usual" case, and
use right for odd things. For example, pat source is Pat | SelfParam.
2021-06-14 22:42:43 +03:00
Aleksey Kladov
188b0f96f9
Add more docs
2021-05-22 16:53:47 +03:00
Danny Zhu
09fc5e1dd7
Check more carefully for cases where a rename can't be done
...
Attempting to rename an element of a tuple field would previously
replace the type with the new name, which doesn't make sense; now it
fails instead.
The check is done in both `prepare_rename` and `rename` so that the case
is caught before the user is prompted for a new name. Some other
existing failure cases are also now additionally checked in
`prepare_rename`.
2021-04-25 14:08:56 -07:00
Jonas Schievink
c05a1a6e37
Store an AstId for procedural macros
2021-03-18 16:11:18 +01:00
Lukas Wirth
4628d94e74
Remove ShortLabel
2021-03-16 15:44:31 +01:00
oxalica
7c855c940a
Clean usage of ShortLabel
2021-03-16 01:05:56 +08:00
Aleksey Kladov
ef8f38efc6
More precise navigation to parent
2021-02-09 18:21:09 +03:00
Lukas Wirth
d912444cac
Shorten hir::TypeParam full_range in NavigationTarget
2021-01-26 01:01:00 +01:00
Lukas Wirth
a872ebf81f
Support unions in symbol search
2021-01-24 01:32:52 +01:00
bors[bot]
0c37b3a0fc
Merge #7353
...
7353: Add LifetimeParam and ConstParam to CompletionItemKind r=matklad a=Veykril
Adds `LifetimeParam` and `ConstParam` to `CompletionItemKind` and maps them both to `TypeParam` in the protocol conversion as there are no equivalents, so nothing really changes there.
`ConstParam` could be mapped to `Const` I guess but I'm split on whether that would be better?
Additions were solely inspired by (the single) test output for const params.
Also sorts the variants of `CompletionItemKind` and its to_proto match.
Co-authored-by: Lukas Wirth <lukastw97@gmail.com >
2021-01-22 15:31:47 +00:00
Jonas Schievink
82146737ac
Treat BlockExpr as a potential module origin
2021-01-20 20:05:48 +01:00
Lukas Wirth
563a175fdb
Move SymbolKind to ide_db
2021-01-20 15:25:34 +01:00
Aleksey Kladov
46b4f89c92
.
2021-01-20 01:56:11 +03:00
Lukas Wirth
98718e0544
Wrap remaining self/super/crate in Name{Ref}
2021-01-15 22:18:43 +01:00
Lukas Wirth
cb863390f2
Handle self/super/crate in PathSegment as NameRef
2021-01-15 19:21:23 +01:00
Lukas Wirth
b795128dde
Use hir::GenericParam in ide_db::Definition instead of relisting all 3
2021-01-10 12:33:47 +01:00
Nick Spain
40cd6cdf67
Fix ConstParam HasSource impl and implement TryToNav not Nav
2021-01-02 22:11:25 +11:00
Nick Spain
3f1b3df65b
Move impls of ToNav that use source() to TryToNav
2021-01-02 21:53:52 +11:00
Nick Spain
14d0db0759
HasSource::source_old -> HasSource::source for places where proc-macros were special cased
...
In #6901 some special case handling for proc-macros was introduced to
prevent panicing as they have no AST. Now the new HasSource::source
method is used that returns an option.
Generally this was a pretty trivial change, the only thing of much
interest is that `hir::MacroDef` now implements `TryToNav` not `ToNav`
as this allows us to handle `HasSource::source` now returning an option.
2021-01-02 21:53:52 +11:00
Nick Spain
ea4708c444
Mark HasSource::source_old as deprecated but allow at all call sites
2021-01-02 21:53:51 +11:00
Nick Spain
27cadcd531
HasSource::source -> HasSource::source_old
...
To start migrating HasSource::source to return an Option.
2021-01-02 21:53:51 +11:00
Lukas Wirth
18bf2e5af5
Add ConstParams to the ide layer
2021-01-01 14:43:16 +01:00
Lukas Wirth
42e3f97c30
Support labels in reference search
2020-12-24 15:40:18 +01:00
Aleksey Kladov
f6ed16674c
Align code_model name with ungrammar
2020-12-20 10:05:24 +03:00
Aleksey Kladov
c45221907a
Deduplicate highlight tags and symbol kinds
...
Curiously, LSP uses different enums for those, and unsurprising and
annoyingly, there are things which exist in one but not in the other.
Let's not repeat the mistake and unify the two things
2020-12-18 23:04:26 +03:00
Aleksey Kladov
ade2f5cd12
Reduce test verbosity
2020-12-18 21:26:47 +03:00
Aleksey Kladov
0e3581e823
NavTarget doesn't assume that it points to a symbol
2020-12-18 21:15:48 +03:00
Aleksey Kladov
55ba353b39
Don't expose SyntaxKind from IDE API
...
SyntaxKind is somewhat of an internal type, but IDE is using it to
basically specify an icon. Let's have a dedicated entity for this
instead.
2020-12-18 19:28:48 +03:00
bors[bot]
f4929fa9cc
Merge #6901
...
6901: Temp fixes panic caused by no ast for proc-macro r=maklad a=edwin0cheng
There are some panic when hover/goto definition for proc-macro. It is because in current design, we don't have `ast-node` for proc-macro and then it trigger [this](479d1f7eec/crates/hir/src/has_source.rs (L116) ) line to panic.
This PR is a temp fix for all of these similar to bd4c352831/crates/completion/src/render/macro_.rs (L42)
Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com >
2020-12-18 02:30:51 +00:00
Edwin Cheng
60a3785ac2
Temp fixes panic caused by no ast for proc-macro
2020-12-18 10:26:17 +08:00
Aleksey Kladov
c888f1de6f
Rewrite doctest runnables
...
Handle more cases in a generic way without copy-pasting code.
2020-12-17 20:11:40 +03:00
Jonas Schievink
9231821c03
Make Attrs::from_attrs_owner private
2020-12-17 15:45:26 +01:00
Aleksey Kladov
2ae31e34b1
Rename ImplDef -> Impl
...
We used to have `Def` suffix for all symbols, but we moved off from
that. `FunctionDef` isn't better than `Function`. Looks like we've
forgot to change `Impl` though!
2020-12-17 14:36:15 +03:00
Lukas Wirth
55faa2daa3
Lifetime reference search
2020-12-16 22:21:01 +01:00
Lukas Wirth
8ed8e4f25a
Use Attrs::docs in NavigationTarget instead of DocCommentsOwner
2020-12-11 21:19:58 +01:00
Jonas Schievink
4943ef085d
Make original_range a method on InFile<&SyntaxNode>
2020-12-08 19:01:27 +01:00
Igor Aleksanov
19cce08662
Re-export base_db from ide_db
2020-10-24 11:39:57 +03:00
Aleksey Kladov
b06259673f
rename mock_analysis -> fixture
2020-10-02 17:49:44 +02:00
Aleksey Kladov
09348b2474
Get rid of MockAnalysis
2020-10-02 17:31:20 +02:00
Aleksey Kladov
b0fd3faf36
Switch to expect_test from crates.io
2020-08-21 13:19:31 +02:00
Aleksey Kladov
1b0c7701cc
Rename ra_ide -> ide
2020-08-13 17:58:27 +02:00