Skip to content

Conversation

@khensunny
Copy link
Contributor

@khensunny khensunny commented Jan 14, 2026

Replace full YAML parsing with simple pattern matching for detecting
pub workspace members and roots. The YAML parser fails silently on
complex pubspec files (e.g., containing generate:dart syntax),
causing workspace root detection to fail and multiple LSP servers
to spawn.

Also fix iterate_parents skipping the immediate parent directory
when searching for workspace root.

Patterns match VS Code Dart extension behavior.

Note

AI was used in the creation of this work

Closes: #515

Copilot AI review requested due to automatic review settings January 14, 2026 01:11
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes workspace root detection in the LSP by replacing full YAML parsing with simple regex-based pattern matching for detecting pub workspace members and roots. The YAML parser was failing silently on complex pubspec files (e.g., those containing generate:dart syntax), causing workspace root detection to fail and multiple LSP servers to spawn.

Changes:

  • Replaced YAML parsing with regex pattern matching for workspace detection, matching VS Code Dart extension behavior
  • Fixed iterate_parents skipping the immediate parent directory during workspace root search

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@khensunny
Copy link
Contributor Author

this is the pubspec.yaml section that made the yaml parser fail:

// melos configure
melos:
// ...
    generate:
      steps:
        - generate:dart
        - generate:flutter
      description: Build all generated files for Dart & Flutter packages.

@sidlatau sidlatau merged commit 6d040bc into nvim-flutter:main Jan 14, 2026
9 of 10 checks passed
@sidlatau
Copy link
Collaborator

Thanks, @khensunny!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Single pub workspace lsp support not working

2 participants