]> git.lizzy.rs Git - rust.git/log
rust.git
2 years agoAuto merge of #12642 - weirdsmiley:master, r=Veykril
bors [Mon, 27 Jun 2022 12:16:06 +0000 (12:16 +0000)]
Auto merge of #12642 - weirdsmiley:master, r=Veykril

fix: deduplicate cfg completions

cfg completions are duplicated if they are set with multiple values.
This patch deduplicates them.

fixes: [#12623](https://github.com/rust-lang/rust-analyzer/issues/12623)

2 years agofix: deduplicate cfg completions
Manas [Mon, 27 Jun 2022 10:47:06 +0000 (16:17 +0530)]
fix: deduplicate cfg completions

cfg completions are duplicated if they are set with multiple values.
This patch deduplicates them.

2 years agoUdate unit tests
Antonello Palazzi [Mon, 27 Jun 2022 08:04:42 +0000 (09:04 +0100)]
Udate unit tests

2 years agoWellFormed -> Holds
bitgaoshu [Sun, 26 Jun 2022 15:09:06 +0000 (23:09 +0800)]
WellFormed -> Holds

2 years agoadd test for item same name
bitgaoshu [Sun, 26 Jun 2022 14:48:26 +0000 (22:48 +0800)]
add test for item same name

2 years agoAuto merge of #12638 - buffet:fix-typo, r=flodiebold
bors [Sun, 26 Jun 2022 10:43:30 +0000 (10:43 +0000)]
Auto merge of #12638 - buffet:fix-typo, r=flodiebold

Fix typo in build.rs

2 years agoFix typo in build.rs
buffet [Sun, 26 Jun 2022 10:09:45 +0000 (10:09 +0000)]
Fix typo in build.rs

2 years agocomplete raw identifier with "r#" prefix
Hongxu Xu [Sun, 26 Jun 2022 06:45:30 +0000 (14:45 +0800)]
complete raw identifier with "r#" prefix

2 years agoCorrect target_feature completion
Antonello Palazzi [Sat, 25 Jun 2022 23:50:41 +0000 (00:50 +0100)]
Correct target_feature completion

2 years agoReduce intermediate allocations while printing witnesses
iDawer [Sat, 25 Jun 2022 15:08:00 +0000 (20:08 +0500)]
Reduce intermediate allocations while printing witnesses

2 years agoadd test for suggest_name
bitgaoshu [Sat, 25 Jun 2022 09:33:27 +0000 (17:33 +0800)]
add test for suggest_name

2 years agorestore sth
bitgaoshu [Sat, 25 Jun 2022 02:25:56 +0000 (10:25 +0800)]
restore sth

2 years agoAuto merge of #12520 - Veykril:flycheck-cancel, r=Veykril
bors [Fri, 24 Jun 2022 17:42:00 +0000 (17:42 +0000)]
Auto merge of #12520 - Veykril:flycheck-cancel, r=Veykril

internal: Bring back JodChild into flychecking for cancellation

cc https://github.com/rust-lang/rust-analyzer/pull/10517/files#r895241975

2 years agofix test in resolve_proc_macro: Foo is Owner
bitgaoshu [Fri, 24 Jun 2022 17:02:39 +0000 (01:02 +0800)]
fix test in resolve_proc_macro:  Foo is Owner

2 years agorename "trait_def" to "def_in_trait"
bitgaoshu [Fri, 24 Jun 2022 14:42:30 +0000 (22:42 +0800)]
rename "trait_def" to "def_in_trait"

2 years agohighlight: trait path
bitgaoshu [Fri, 24 Jun 2022 14:41:07 +0000 (22:41 +0800)]
highlight: trait path

2 years agofix test in qualify_method: stay in trait path
bitgaoshu [Fri, 24 Jun 2022 14:17:26 +0000 (22:17 +0800)]
fix test in qualify_method:  stay in trait path

2 years agoAuto merge of #12629 - flodiebold:proc-macro-error-improvement, r=Veykril
bors [Fri, 24 Jun 2022 12:27:59 +0000 (12:27 +0000)]
Auto merge of #12629 - flodiebold:proc-macro-error-improvement, r=Veykril

fix: Improve proc macro errors a bit

Distinguish between
 - there is no build data (for some reason?)
 - there is build data, but the cargo package didn't build a proc macro dylib
 - there is a proc macro dylib, but it didn't contain the proc macro we expected
 - the name did not resolve to any macro (this is now an
 unresolved_macro_call even for attributes)

I changed the handling of disabled attribute macro expansion to
immediately ignore the macro and report an unresolved_proc_macro,
because otherwise they would now result in loud unresolved_macro_call
errors. I hope this doesn't break anything.

Also try to improve error ranges for unresolved_macro_call / macro_error
by reusing the code for unresolved_proc_macro. It's not perfect but
probably better than before.

2 years agoImprove comments
Florian Diebold [Fri, 24 Jun 2022 12:19:18 +0000 (14:19 +0200)]
Improve comments

2 years agoImprove proc macro errors a bit
Florian Diebold [Fri, 24 Jun 2022 11:03:13 +0000 (13:03 +0200)]
Improve proc macro errors a bit

Distinguish between
 - there is no build data (for some reason?)
 - there is build data, but the cargo package didn't build a proc macro dylib
 - there is a proc macro dylib, but it didn't contain the proc macro we expected
 - the name did not resolve to any macro (this is now an
 unresolved_macro_call even for attributes)

I changed the handling of disabled attribute macro expansion to
immediately ignore the macro and report an unresolved_proc_macro,
because otherwise they would now result in loud unresolved_macro_call
errors. I hope this doesn't break anything.

Also try to improve error ranges for unresolved_macro_call / macro_error
by reusing the code for unresolved_proc_macro. It's not perfect but
probably better than before.

2 years agofix some test due to resolve to where trait m impl
bitgaoshu [Fri, 24 Jun 2022 11:15:16 +0000 (19:15 +0800)]
fix some test due to resolve to where trait m impl

2 years agofunctions resolve to impl
bitgaoshu [Fri, 24 Jun 2022 11:11:35 +0000 (19:11 +0800)]
functions resolve to impl

2 years agoAuto merge of #12605 - erhuve:fix/determine-doc-link-type-at-start, r=erhuve
bors [Thu, 23 Jun 2022 23:15:33 +0000 (23:15 +0000)]
Auto merge of #12605 - erhuve:fix/determine-doc-link-type-at-start, r=erhuve

fix: doc_links link type - Determine link type at start (fixes #12601)

fixes #12601
Looked like autolink/inline mismatch happened because end_link_type was parsed from the Text/Code events.
I changed it to be determined from the Start event, which should hopefully remain accurate while staying true to the cases where link type may need to be changed, according to the comment
```
// normally link's type is determined by the type of link tag in the end event,
// however in some cases we want to change the link type, for example,
// `Shortcut` type doesn't make sense for url links
```
Hopefully this is the desired behavior?
![Untitled](https://user-images.githubusercontent.com/59463268/174696581-3b1140a5-cdf0-4eda-9a11-ec648e4e7d21.gif)

2 years agoclarify comment and add autolink test case
Raymond Luo [Thu, 23 Jun 2022 23:02:30 +0000 (19:02 -0400)]
clarify comment and add autolink test case

2 years agoTry to publish releases to OpenVSX
Laurențiu Nicola [Thu, 23 Jun 2022 19:18:08 +0000 (22:18 +0300)]
Try to publish releases to OpenVSX

2 years agoAuto merge of #12628 - Veykril:simplify, r=Veykril
bors [Thu, 23 Jun 2022 18:13:08 +0000 (18:13 +0000)]
Auto merge of #12628 - Veykril:simplify, r=Veykril

internal: Simplify

2 years agointernal: Simplify
Lukas Wirth [Thu, 23 Jun 2022 18:08:29 +0000 (20:08 +0200)]
internal: Simplify

2 years agofix: trailing ':' on empty inactive reasons
CuriousCorrelation [Thu, 23 Jun 2022 16:40:27 +0000 (22:10 +0530)]
fix: trailing ':' on empty inactive reasons

Fixes: #12615
2 years agoAuto merge of #12625 - yue4u:fix/non-exhaustive-variant, r=Veykril
bors [Thu, 23 Jun 2022 15:05:39 +0000 (15:05 +0000)]
Auto merge of #12625 - yue4u:fix/non-exhaustive-variant, r=Veykril

fix: completes non exhaustive variant within the defining crate

close #12624

2 years agofix: completes non exhaustive variant within the defining crate
yue4u [Thu, 23 Jun 2022 15:00:51 +0000 (00:00 +0900)]
fix: completes non exhaustive variant within the defining crate

2 years agoFix unstable feature use
Florian Diebold [Thu, 23 Jun 2022 14:05:59 +0000 (16:05 +0200)]
Fix unstable feature use

2 years agoAdd two more tests
Florian Diebold [Thu, 23 Jun 2022 12:49:05 +0000 (14:49 +0200)]
Add two more tests

2 years agoVarious cleanups
Florian Diebold [Thu, 23 Jun 2022 12:10:12 +0000 (14:10 +0200)]
Various cleanups

 - remove Valid, it serves no purpose and just obscures the diff
 - rename some things
 - don't use is_valid_candidate when searching for impl, it's not necessary

2 years agoreformat code
bitgaoshu [Tue, 21 Jun 2022 12:05:49 +0000 (20:05 +0800)]
reformat code

2 years agogoto where trait method impl
bitgaoshu [Wed, 15 Jun 2022 15:13:15 +0000 (23:13 +0800)]
goto where trait method impl

2 years agocondense matches on autolink
Raymond Luo [Thu, 23 Jun 2022 02:07:26 +0000 (22:07 -0400)]
condense matches on autolink

2 years agoadd doc strings to use_trivial_contructor.rs
soruh [Wed, 22 Jun 2022 14:49:50 +0000 (16:49 +0200)]
add doc strings to use_trivial_contructor.rs

2 years agoadd use_trivial_contructor.rs
soruh [Wed, 22 Jun 2022 14:34:01 +0000 (16:34 +0200)]
add use_trivial_contructor.rs

2 years agoapply suggestions
soruh [Wed, 22 Jun 2022 14:29:59 +0000 (16:29 +0200)]
apply suggestions

2 years agohandle autolink as edge case
Raymond Luo [Tue, 21 Jun 2022 03:15:27 +0000 (23:15 -0400)]
handle autolink as edge case

2 years agodetermine doc link type from start instead of text or code
Raymond Luo [Tue, 21 Jun 2022 01:10:45 +0000 (21:10 -0400)]
determine doc link type from start instead of text or code

2 years agoAuto merge of #12604 - Veykril:completions, r=Veykril
bors [Mon, 20 Jun 2022 19:56:05 +0000 (19:56 +0000)]
Auto merge of #12604 - Veykril:completions, r=Veykril

internal: Simplify some completions

2 years agointernal: Simplify some completions
Lukas Wirth [Mon, 20 Jun 2022 19:55:33 +0000 (21:55 +0200)]
internal: Simplify some completions

2 years agoAuto merge of #12599 - flodiebold:no-test-deps, r=flodiebold
bors [Mon, 20 Jun 2022 18:42:48 +0000 (18:42 +0000)]
Auto merge of #12599 - flodiebold:no-test-deps, r=flodiebold

fix: Only apply `cfg(test)` for local crates

Don't analyze dependencies with `test`; this should fix various cases where crates use `cfg(not(test))` and so we didn't find things.

"Local" here currently means anything that's not from the registry, so anything inside the workspace, but also path dependencies. So this isn't perfect, and users might still need to use `rust-analyzer.cargo.unsetTest` for these in some cases.

2 years agoFix test
Florian Diebold [Mon, 20 Jun 2022 18:34:08 +0000 (20:34 +0200)]
Fix test

2 years agoAuto merge of #12597 - Veykril:completions, r=Veykril
bors [Mon, 20 Jun 2022 18:28:08 +0000 (18:28 +0000)]
Auto merge of #12597 - Veykril:completions, r=Veykril

fix: Fix auto-ref completions inserting into wrong locations

Fixes https://github.com/rust-lang/rust-analyzer/issues/8058

2 years agoReimplement auto-ref completions for fields
Lukas Wirth [Mon, 20 Jun 2022 18:22:51 +0000 (20:22 +0200)]
Reimplement auto-ref completions for fields

2 years agoRefactor a bit
Florian Diebold [Mon, 20 Jun 2022 18:21:30 +0000 (20:21 +0200)]
Refactor a bit

2 years agoRemove pattern rendering hack
Lukas Wirth [Mon, 20 Jun 2022 18:16:40 +0000 (20:16 +0200)]
Remove pattern rendering hack

2 years agoOnly apply `cfg(test)` for local crates
Florian Diebold [Mon, 20 Jun 2022 18:10:25 +0000 (20:10 +0200)]
Only apply `cfg(test)` for local crates

Don't analyze dependencies with `test`; this should fix various cases
where crates use `cfg(not(test))` and so we didn't find things.

"Local" here currently means anything that's not from the registry, so
anything inside the workspace, but also path dependencies. So this isn't
perfect, and users might still need to use
`rust-analyzer.cargo.unsetTest` for these in some cases.

2 years agofix: Fix auto-ref completions inserting into wrong locations
Lukas Wirth [Mon, 20 Jun 2022 16:59:57 +0000 (18:59 +0200)]
fix: Fix auto-ref completions inserting into wrong locations

2 years agoAuto merge of #12596 - Veykril:completions, r=Veykril
bors [Mon, 20 Jun 2022 16:03:21 +0000 (16:03 +0000)]
Auto merge of #12596 - Veykril:completions, r=Veykril

fix: Don't trigger pattern completions when typing a wildcard pattern

Fixes https://github.com/rust-lang/rust-analyzer/issues/12592

2 years agofix: Don't trigger pattern completions when typing a wildcard pattern
Lukas Wirth [Mon, 20 Jun 2022 16:02:13 +0000 (18:02 +0200)]
fix: Don't trigger pattern completions when typing a wildcard pattern

2 years agoAuto merge of #12594 - Veykril:completions, r=Veykril
bors [Mon, 20 Jun 2022 15:42:31 +0000 (15:42 +0000)]
Auto merge of #12594 - Veykril:completions, r=Veykril

internal: Lift out IdentContext from CompletionContext

Makes things a bit messy overall, but with this I can start cleaning up the render functions properly now.
cc https://github.com/rust-lang/rust-analyzer/issues/12571

2 years agointernal: Lift out IdentContext from CompletionContext
Lukas Wirth [Mon, 20 Jun 2022 15:41:04 +0000 (17:41 +0200)]
internal: Lift out IdentContext from CompletionContext

2 years agointernal: Remove `previous_token` field from `CompletionContext`
Lukas Wirth [Mon, 20 Jun 2022 13:07:48 +0000 (15:07 +0200)]
internal: Remove `previous_token` field from `CompletionContext`

2 years agoAuto merge of #12588 - Veykril:completions, r=Veykril
bors [Mon, 20 Jun 2022 12:50:59 +0000 (12:50 +0000)]
Auto merge of #12588 - Veykril:completions, r=Veykril

internal: More completion reorganizing

2 years agoRemove some usages of `Completions::add_resolution`
Lukas Wirth [Mon, 20 Jun 2022 12:47:30 +0000 (14:47 +0200)]
Remove some usages of `Completions::add_resolution`

2 years agoEven more completion context filtering
Lukas Wirth [Mon, 20 Jun 2022 12:23:46 +0000 (14:23 +0200)]
Even more completion context filtering

2 years agoLift out PathKind variant fields into structs
Lukas Wirth [Mon, 20 Jun 2022 11:29:13 +0000 (13:29 +0200)]
Lift out PathKind variant fields into structs

2 years agoSplit remaining completion calls on the context kinds
Lukas Wirth [Mon, 20 Jun 2022 11:17:30 +0000 (13:17 +0200)]
Split remaining completion calls on the context kinds

2 years agoDisplay witnesses of non-exhaustive match
iDawer [Mon, 20 Jun 2022 10:48:09 +0000 (15:48 +0500)]
Display witnesses of non-exhaustive match

Reporting format follows rustc and shows at most three witnesses.

2 years agoAuto merge of #12581 - lnicola:changelog-number, r=lnicola
bors [Sun, 19 Jun 2022 16:00:33 +0000 (16:00 +0000)]
Auto merge of #12581 - lnicola:changelog-number, r=lnicola

internal: Handle fractional release numbers in changelog naming

2 years agoAuto merge of #12584 - Veykril:attr-diag, r=Veykril
bors [Sat, 18 Jun 2022 22:38:04 +0000 (22:38 +0000)]
Auto merge of #12584 - Veykril:attr-diag, r=Veykril

fix: attribute macros not being properly diagnosed

Closes https://github.com/rust-lang/rust-analyzer/issues/12582

2 years agofix: attribute macros not being properly diagnosed
Lukas Wirth [Sat, 18 Jun 2022 22:37:37 +0000 (00:37 +0200)]
fix: attribute macros not being properly diagnosed

2 years agointernal: Handle fractional release numbers in changelog naming
Laurențiu Nicola [Sat, 18 Jun 2022 14:00:28 +0000 (17:00 +0300)]
internal: Handle fractional release numbers in changelog naming

2 years agoAuto merge of #12580 - Veykril:completion, r=Veykril
bors [Sat, 18 Jun 2022 09:21:13 +0000 (09:21 +0000)]
Auto merge of #12580 - Veykril:completion, r=Veykril

internal: Move more things out of `CompletionContext::function_def` into more specific parts

2 years agoConsider walking up macro expansions when searching for surrounding entities in compl...
Lukas Wirth [Sat, 18 Jun 2022 09:19:36 +0000 (11:19 +0200)]
Consider walking up macro expansions when searching for surrounding entities in completion analysis

2 years agoMove `CompletionContext::impl_def` into corresponding entities
Lukas Wirth [Sat, 18 Jun 2022 08:45:53 +0000 (10:45 +0200)]
Move `CompletionContext::impl_def` into corresponding entities

2 years agoMove `CompletionContext::incomplete_let` into `PathKind::Expr`
Lukas Wirth [Sat, 18 Jun 2022 08:18:56 +0000 (10:18 +0200)]
Move `CompletionContext::incomplete_let` into `PathKind::Expr`

2 years agoAuto merge of #12576 - harpsword:fold_range_non_block_match_arm, r=Veykril
bors [Sat, 18 Jun 2022 08:10:31 +0000 (08:10 +0000)]
Auto merge of #12576 - harpsword:fold_range_non_block_match_arm, r=Veykril

feat: add fold range for multi line match arm list

fix: #11893

2 years agofeat: add fold range for multi line match arm list
harpsword [Sat, 9 Apr 2022 05:44:41 +0000 (13:44 +0800)]
feat: add fold range for multi line match arm list

2 years agoMove `CompletionContext::function_def` into `PathKind::Expr`
Lukas Wirth [Sat, 18 Jun 2022 07:54:03 +0000 (09:54 +0200)]
Move `CompletionContext::function_def` into `PathKind::Expr`

2 years agoAuto merge of #12577 - Veykril:completion, r=Veykril
bors [Sat, 18 Jun 2022 06:59:12 +0000 (06:59 +0000)]
Auto merge of #12577 - Veykril:completion, r=Veykril

internal: NameRefKind classification is not optional

2 years agointernal: NameRefKind classification is not optional
Lukas Wirth [Sat, 18 Jun 2022 06:58:47 +0000 (08:58 +0200)]
internal: NameRefKind classification is not optional

2 years agoAuto merge of #12574 - Veykril:completion, r=Veykril
bors [Fri, 17 Jun 2022 23:15:37 +0000 (23:15 +0000)]
Auto merge of #12574 - Veykril:completion, r=Veykril

minor: Simplify

2 years agominor: Simplify
Lukas Wirth [Fri, 17 Jun 2022 23:15:08 +0000 (01:15 +0200)]
minor: Simplify

2 years agoAuto merge of #12573 - Veykril:completion, r=Veykril
bors [Fri, 17 Jun 2022 22:48:14 +0000 (22:48 +0000)]
Auto merge of #12573 - Veykril:completion, r=Veykril

internal: Split flyimport into its 3 applicable contexts

2 years agointernal: Split flyimport into its 3 applicable contexts
Lukas Wirth [Fri, 17 Jun 2022 22:47:28 +0000 (00:47 +0200)]
internal: Split flyimport into its 3 applicable contexts

2 years agoAuto merge of #12570 - Veykril:completion, r=Veykril
bors [Fri, 17 Jun 2022 22:26:50 +0000 (22:26 +0000)]
Auto merge of #12570 - Veykril:completion, r=Veykril

Only run completion functions if their corresponding context is active

2 years agoOnly run completion functions if their corresponding context is active
Lukas Wirth [Fri, 17 Jun 2022 21:36:39 +0000 (23:36 +0200)]
Only run completion functions if their corresponding context is active

2 years agoRemove superfluous early returns
Lukas Wirth [Fri, 17 Jun 2022 15:49:25 +0000 (17:49 +0200)]
Remove superfluous early returns

2 years agoAuto merge of #12565 - Veykril:completion, r=Veykril
bors [Fri, 17 Jun 2022 15:32:32 +0000 (15:32 +0000)]
Auto merge of #12565 - Veykril:completion, r=Veykril

internal: More completion refactors

2 years agoInline PathQualifierCtx
Lukas Wirth [Fri, 17 Jun 2022 15:27:12 +0000 (17:27 +0200)]
Inline PathQualifierCtx

2 years agointernal: Collapse lift is_infer_qualifier into `Qualified` variant
Lukas Wirth [Fri, 17 Jun 2022 15:15:29 +0000 (17:15 +0200)]
internal: Collapse lift is_infer_qualifier into `Qualified` variant

2 years agoMove existing_derives into PathKind::Derive
Lukas Wirth [Fri, 17 Jun 2022 14:56:21 +0000 (16:56 +0200)]
Move existing_derives into PathKind::Derive

2 years agoAuto merge of #12564 - Veykril:completion, r=Veykril
bors [Fri, 17 Jun 2022 14:38:44 +0000 (14:38 +0000)]
Auto merge of #12564 - Veykril:completion, r=Veykril

internal: Collapse completion ctx path `qualifier` and `is_absolute_path` into enum

2 years agointernal: Collapse completion ctx path qualifier and is_absolute_path into enum
Lukas Wirth [Fri, 17 Jun 2022 14:36:22 +0000 (16:36 +0200)]
internal: Collapse completion ctx path qualifier and is_absolute_path into enum

2 years agoAuto merge of #12563 - Veykril:completion, r=Veykril
bors [Fri, 17 Jun 2022 14:28:52 +0000 (14:28 +0000)]
Auto merge of #12563 - Veykril:completion, r=Veykril

internal: Simplify

2 years agoSimplify
Lukas Wirth [Fri, 17 Jun 2022 14:22:51 +0000 (16:22 +0200)]
Simplify

2 years agoAuto merge of #12562 - Veykril:completion, r=Veykril
bors [Fri, 17 Jun 2022 13:19:45 +0000 (13:19 +0000)]
Auto merge of #12562 - Veykril:completion, r=Veykril

Split completion context module into definitions and analysis parts

2 years agoSplit out tests
Lukas Wirth [Fri, 17 Jun 2022 13:19:09 +0000 (15:19 +0200)]
Split out tests

2 years agoSplit completion context module into definitions and analysis parts
Lukas Wirth [Fri, 17 Jun 2022 13:16:20 +0000 (15:16 +0200)]
Split completion context module into definitions and analysis parts

2 years agoAuto merge of #12560 - Veykril:completion, r=Veykril
bors [Fri, 17 Jun 2022 13:10:05 +0000 (13:10 +0000)]
Auto merge of #12560 - Veykril:completion, r=Veykril

internal: More completions refactoring

This gets rid of the remaining `ImmediateLocation` bits

2 years agoRemove ImmediateLocation in favor of PathKind::Type
Lukas Wirth [Fri, 17 Jun 2022 12:18:03 +0000 (14:18 +0200)]
Remove ImmediateLocation in favor of PathKind::Type

2 years agoMove more ImmediateLocation::TypeAnnotation into PathKind::Type
Lukas Wirth [Fri, 17 Jun 2022 09:31:36 +0000 (11:31 +0200)]
Move more ImmediateLocation::TypeAnnotation into PathKind::Type

2 years agoIntroduce NameRefKind for completions
Lukas Wirth [Fri, 17 Jun 2022 08:45:19 +0000 (10:45 +0200)]
Introduce NameRefKind for completions

2 years agoSend a DidCancel event when restarting flychecks
Lukas Wirth [Thu, 16 Jun 2022 13:25:50 +0000 (15:25 +0200)]
Send a DidCancel event when restarting flychecks

2 years agoAuto merge of #12554 - XFFXFF:fix_11959, r=Veykril
bors [Thu, 16 Jun 2022 12:48:33 +0000 (12:48 +0000)]
Auto merge of #12554 - XFFXFF:fix_11959, r=Veykril

fix: local items should not be completed in parent signature

fixes #11959

> We get a Bar completion for the following snippet which is wrong as the item is not visible in that position.
> ``` rust
> fn foo() -> $0 {
>    struct Bar;
> }
> ```

I investigated the problem and found that the scope of the cursor offset, also `CompletionContext.scope` is the body of the function

2 years agothe offset used for the completion cursor should always be relative to the original...
XFFXFF [Thu, 16 Jun 2022 08:43:08 +0000 (16:43 +0800)]
the offset used for the completion cursor should always be relative to the original file and not to the marco file