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

No support for braces in globPatterns #708

Open
igor-ramazanov opened this issue Jan 4, 2024 · 1 comment
Open

No support for braces in globPatterns #708

igor-ramazanov opened this issue Jan 4, 2024 · 1 comment

Comments

@igor-ramazanov
Copy link
Contributor

igor-ramazanov commented Jan 4, 2024

Not critical and does not prevent the server from working in this case.

Jan 04 23:15:34.555 DEBG From server metals: {"jsonrpc":"2.0","id":"4","method":"client/registerCapability","params":{"registrations":[{"id":"1","method":"workspace/didChangeWatchedFiles","registerOptions":{"watchers":[{"globPattern":"file:///home/igor/magine/promo-codes/*.sbt"},{"globPattern":"file:///home/igor/magine/promo-codes/pom.xml"},{"globPattern":"file:///home/igor/magine/promo-codes/*.sc"},{"globPattern":"file:///home/igor/magine/promo-codes/*?.gradle"},{"globPattern":"file:///home/igor/magine/promo-codes/*.gradle.kts"},{"globPattern":"file:///home/igor/magine/promo-codes/project/*.{scala,sbt}"},{"globPattern":"file:///home/igor/magine/promo-codes/project/project/*.{scala,sbt}"},{"globPattern":"file:///home/igor/magine/promo-codes/project/build.properties"},{"globPattern":"file:///home/igor/magine/promo-codes/.metals/.reports/bloop/*/*"}]}}]}}, module: kak_lsp::language_server_transport:168
Jan 04 23:15:34.555 ERRO unsupported braces in glob patttern: 'file:///home/igor/magine/promo-codes/project/*.{scala,sbt}', module: kak_lsp::text_sync:249
Jan 04 23:15:34.555 ERRO unsupported braces in glob patttern: 'file:///home/igor/magine/promo-codes/project/project/*.{scala,sbt}', module: kak_lsp::text_sync:249

The issue comes from the upstream library: rust-lang/glob#2

The library suddenly got a new release, looks like it's maintained again?

@krobelus
Copy link
Member

krobelus commented Jan 5, 2024

yeah it should interpret project/*.{scala,sbt} as two globs project/*.scala and project/*.sbt.
Shouldn't be too hard to implement. I don't have a solid opinion yet on whether this should be part of the glob library.
I don't know anything besides LSP that uses braces in that way. Gitignore-like patterns yes but that's another language with its own crate.

The concern I have with this feature is that it dilutes the meaning of { in a glob; it will be more difficult to predict the behavior if there are two competing meanings out there.
But I guess that's a mostly academic concern because filenames won't contain {.
So I think it's fine to add it to the library.

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

No branches or pull requests

2 participants