-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Code completion at the top of non-empty maps in analysis_options.yaml and pubspec.yaml shows incorrect completions #59827
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Part of the difference might be due to me having |
Correct. I have it set to I can reproduce this one: |
I`ve tested it again and I can confirm that was it. I've also confirmed that the case you managed to repro above only happens if you already have one of the internal options for If you trigger autocomplete after, it still thinks you're at the last spot: See that there is no auto-complete option for |
I had a quick look at this thinking it'd be a trivial fix, but I don't think it is. The reason it fails is that in code like: analyzer:
^ The AST for the file looks like However, in the caseof: analyzer:
^
foo: bar Here, the AST looks like So I think it'll need a little reworking of In the meantime, I did open a fix for the missing booleans for the |
Doing so would probably help with #57034, too. Is your change enough for me to use the |
…tions in analysis_options Fixes part of #59827, but not the main issue. Change-Id: I7f9d6cfd5163a1bf6c72f9eea4bb71872d3dfa15 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/409140 Reviewed-by: Brian Wilkerson <[email protected]> Commit-Queue: Samuel Rawlins <[email protected]> Reviewed-by: Samuel Rawlins <[email protected]>
I believe that the medium to long term goal is to replace the language options with lints. I don't know what the time frame is for that, so I don't know whether it's worth the effort. |
No, all I did was make the completion for the existing (map) entries provide boolean completions instead of no completions. Since it just occurred to me, I'll also note the original issue described above also affects Pubspec (eg. you get "dependencies:" in completion here instead of package names): |
Working as intented
If you have on
analysis_options.yaml
the following:On either
^
it will show you the possible rules for lints or possible experiments we have.If you trigger auto-complete (CTRL + Space) on the left of the file, it will show you the sections; analyzer, linter, code-style, etc.
NOT Working as intended
If you do that with one indentation inside
analyzer
it still shows the same as the previous paragraph.If you do that on
^
below:Here is the output:
This is a mix of the possible entries for the
analyzer
section and the entire file-valid sections and (at the end because this is alphabetically sorted) the valid options for theanalyzer.language
section (strict-inference
,strict-casts
, etc).Also, on another note, we can't do with the
analyzer.language
section what we can with thelinter.rules
section of posting them on a list. We need to add each one with: true
(again, the auto-complete here is totally lost when it would showtrue
/false
options it shows a lot more).Related to #57034.
The text was updated successfully, but these errors were encountered: