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

VSCode language specific settings #365

Closed
Anoesj opened this issue Sep 9, 2020 · 8 comments
Closed

VSCode language specific settings #365

Anoesj opened this issue Sep 9, 2020 · 8 comments
Assignees

Comments

@Anoesj
Copy link

Anoesj commented Sep 9, 2020

Hey, thanks for Todo Tree, using it all the time!

It would be nice if, at least, the todo-tree.regex.regex setting can be configured per-language: https://code.visualstudio.com/docs/getstarted/settings#_language-specific-editor-settings

It doesn't work right now. Thank you!

@Gruntfuggly
Copy link
Owner

Hi - the problem with this is I don't think the extension API allows access to language specific settings. I've done it in another extension, but it's a hack and generates warnings in your settings files as far as I remember.

@Anoesj
Copy link
Author

Anoesj commented Sep 13, 2020

Ah okay, too bad! Thanks anyway :)

@Anoesj Anoesj closed this as completed Sep 13, 2020
@tobiasdiez
Copy link

This would indeed be a nice feature.

To enable language-specific settings, one needs to set "scope": "language-overridable" , see "scope" under https://code.visualstudio.com/api/references/contribution-points#Configuration-property-schema. Could this feature request be reopened please?

@Gruntfuggly Gruntfuggly reopened this Sep 11, 2021
@Gruntfuggly Gruntfuggly self-assigned this Sep 11, 2021
@Gruntfuggly
Copy link
Owner

@tobiasdiez Unfortunately it doesn't make any sense to make the regex language overridable because ripgrep does a file search - it has to be able to find things in any type of file. It could be changed for searching within editors, but that could result in inconsistent behaviour.

I will have another think about it though.

@Fred-Vatin
Copy link

Doesn’t extension API allow to only search in comments instead of parsing the whole file ? I’m sure there is an issue on VSCode repo on that if it doesn’t.

@Gruntfuggly
Copy link
Owner

The extension is primarily designed to search files - searching only comments would be a big change and I don't think the API does support it - it would need a language parser to understand the comments, and at that point it might as well be part of a language based extension.

@Fred-Vatin
Copy link

Fred-Vatin commented Nov 22, 2022

There are workarounds like exposed in this issue.

better comments parses files searching for specific language one line comments and block comments. It is pretty smart because it doesn’t use a general regex containing all the possible comments for any languages on each file but a very specific regex for each language detected. It doesn’t solve any issues but prevents some false detection on file that would contains line start with another specific language comment delimiter.

@Gruntfuggly
Copy link
Owner

I'm closing this as it's not something that fits with the way the extension is currently designed.

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

4 participants