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

fix: don't attach lsp to buffer with empty path #332

Merged
merged 1 commit into from
Feb 14, 2024

Conversation

IgorKhramtsov
Copy link
Contributor

For some reason, on one of my projects, LSP tries to attach to a buffer with an empty path. Dart language server recognizes this as / root directory and starts to analyze the whole file system and eventually just freezes.
https://github.com/akinsho/flutter-tools.nvim/blob/271eec9edb0f1a2bf30ad449ec3b4eeb2c88af05/lua/flutter-tools/lsp/init.lua#L198
After adding some print statements for debugging, I found out it happens every time the floating window with diagnostic is open. However, there is no such buffer when I check the buffer list with :ls, so I'm not sure what exactly causes this. Anyway, check for an empty string is a nice addition to is_valid_path function.

Copy link
Collaborator

@sidlatau sidlatau left a comment

Choose a reason for hiding this comment

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

Thanks, @IgorKhramtsov

@sidlatau sidlatau merged commit 78b5a42 into nvim-flutter:main Feb 14, 2024
3 of 4 checks passed
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.

2 participants