-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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
MarkdownWorkspaceSymbolProvider opens all .md files in the workspace as documents #50874
Comments
Yes, we can use |
What you need is #48034 but for now there is just |
My extension, MarkDown Link Suggestions, uses I initially used it because I figured there was no harm in pre-warming the files and getting the nice TextDocument interface to work with (free I will in the meanwhile, waiting for #48034 to land, use Worth the shot though :-) |
It seems that it's impossible to fix it cleanly with the current API (the other solution is to hardcode all extensions from markdown-basics). To understand whether file is md or not, we need to get its type by URI. But there's no such API. Do you mind if I contribute a PR here? I am thinking about adding vscode.workspace.getLanguageId(uri: vscode.Uri). Does it seems legit? |
Another idea which is cleaner than hardcoding but worse than API is to do the following:
@jrieken what do you think? Should I proceed with this hack or create an API for languages? Concerning API for languages, we might expose more information about them, since I am sure that other extensions will need them. |
After talking to @OmarTawfik it seems that the API isn't necessary. Only .md extension is used for watching documents, so we can just hardcode it. It's a rather simple change. |
Fixed by #80506 |
That triggers linters and other decorators on Markdown. I don't see any other types of files behaving the same. Maybe the symbol provider should not use documents? /cc @DavidAnson
The text was updated successfully, but these errors were encountered: