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

".." In the middle of a glob pattern breaks language server file watching. #76959

Closed
l0hn opened this issue Jan 29, 2025 · 1 comment · Fixed by #76961
Closed

".." In the middle of a glob pattern breaks language server file watching. #76959

l0hn opened this issue Jan 29, 2025 · 1 comment · Fixed by #76961

Comments

@l0hn
Copy link

l0hn commented Jan 29, 2025

matcher.AddIncludePatterns()

This is causing the language server's file watcher to break. As it throws an exception for paths with ".." in the middle:

I put some error handling around it and logged some paths to the lsp log as an example:

[ERROR][2025-01-29 17:02:25] ...lsp/handlers.lua:623	"[LanguageServerProjectSystem] failed to add includes to matcher /Users/john/.nuget/packages/harfbuzzsharp.nativeassets.webassembly/7.3.0/buildTransitive/netstandard1.0/../../build/netstandard1.0/libHarfBuzzSharp.a/**/*.a"
[ERROR][2025-01-29 17:02:25] ...lsp/handlers.lua:623	"[LanguageServerProjectSystem] failed to add includes to matcher /Users/john/.nuget/packages/skiasharp.nativeassets.webassembly/2.88.7/buildTransitive/netstandard1.0/../../build/netstandard1.0/libSkiaSharp.a/**/*.a"
[ERROR][2025-01-29 17:02:25] ...lsp/handlers.lua:623	"[LanguageServerProjectSystem] failed to add includes to matcher /Users/john/.nuget/packages/harfbuzzsharp.nativeassets.webassembly/7.3.0/buildTransitive/netstandard1.0/../../build/netstandard1.0/libHarfBuzzSharp.a/**/*.a"
[ERROR][2025-01-29 17:02:25] ...lsp/handlers.lua:623	"[LanguageServerProjectSystem] failed to add includes to matcher /Users/john/.nuget/packages/skiasharp.nativeassets.webassembly/2.88.7/buildTransitive/netstandard1.0/../../build/netstandard1.0/libSkiaSharp.a/**/*.a"

Seems to work fine if I catch the error and return a default matcher (fine for my purposes in that I don't have to keep restarting LSP everytime I want to add a new .cs file to a project).

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead labels Jan 29, 2025
@l0hn
Copy link
Author

l0hn commented Jan 29, 2025

Specifically here:

@l0hn l0hn changed the title ".." In the middle of a glob pattern breaks langauge server file watching. ".." In the middle of a glob pattern breaks language server file watching. Jan 29, 2025
JoeRobich added a commit that referenced this issue Jan 30, 2025
MSBuild will return globs with relative paths. These globs do not work
properly with M.E.FileSystemGlobbing. This PR ensures we return the
absolute paths for globs.

Resolves #76959
@dotnet-policy-service dotnet-policy-service bot removed the untriaged Issues and PRs which have not yet been triaged by a lead label Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant