Skip to content
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

Completion in pubspec.yaml is not completing top-level properties #54264

Open
sigurdm opened this issue Dec 7, 2023 · 3 comments
Open

Completion in pubspec.yaml is not completing top-level properties #54264

sigurdm opened this issue Dec 7, 2023 · 3 comments
Labels
analyzer-completion Issues with the analysis server's code completion feature analyzer-completion-correctness area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P3 A lower priority bug or feature request type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@sigurdm
Copy link
Contributor

sigurdm commented Dec 7, 2023

At least for me, the top-level completers in the pubspec don't work. eg.

name: foo
dep # Completion doesn't give me anything here, I would expect "dependencies"

I'm using VS-code.

I do get completion for individual package names, and for the version constraint:

environment:
  sdk: ^3.2.0

dependencies:
  analyzer: ^6.2.0
  ya # suggests yaml, yaml_edit etc...

One thing though, if I try to insert a new dependency at the top of the list, I don't get completion:

name: pub

environment:
  sdk: ^3.2.0

dependencies:
  ya # No completion here
  analyzer: ^6.2.0
@lrhn lrhn added the area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. label Dec 7, 2023
@bwilkerson
Copy link
Member

I haven't investigated, but I suspect that this has to do with the way the YAML parser recovers (or fails to recover) from errors in the file.

@bwilkerson bwilkerson added the analyzer-completion Issues with the analysis server's code completion feature label Dec 7, 2023
@pq pq added the P2 A bug or feature request we're likely to work on label Dec 7, 2023
@keertip
Copy link
Contributor

keertip commented Dec 19, 2023

Confirming that it is indeed the case where the YAML parser fails to recover from the errors, and so is unable to parse the incomplete yaml. Hence no suggestions.

@bwilkerson , is there anything we can do here?

@bwilkerson
Copy link
Member

We could try adding an issue on the yaml parser. I opened dart-lang/yaml#102 and Danny made one fix, perhaps having another concrete use case would get more recovery work done.

@srawlins srawlins added the type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) label Apr 5, 2024
@keertip keertip added P3 A lower priority bug or feature request and removed P2 A bug or feature request we're likely to work on labels Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer-completion Issues with the analysis server's code completion feature analyzer-completion-correctness area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P3 A lower priority bug or feature request type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

7 participants