-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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
Conditional Visibility Check for Custom View and resourceLangId #30981
Comments
@sandy081, attached are some screenshots and an animated gif to demonstrate the issue. I've seen it work and not work at various times. In the animated gif, it finally starts showing up after I open a folder, open a document, then switch back to the main document. Notice that the Editor recognizes the "NZQ" language pattern and is being used as noted in the bottom, right status bar. Let me know if you need any other details, as I'd really like the ability to hide custom views when not necessary. |
Tagging @jrieken since this is probably more of an issue of how resourceLangId is set. |
It depends on the context key service you are using... There is usually one per editor and one for the sidebar. I assume you are using the latter which means it depends on the explorer selection. Unsure if that makes sense and unsure if the |
Hmm understood. So, I have to use the context key service from editor irrespective of where How can I get such a service? |
It doesn't work like that. The |
Got it. Thanks. |
This is as designed now. To need a change we need to have support for global context keys. |
I'm using the new when condition check for custom views (#29436) and for a check against resourceLangId, it doesn't appear to be working all the time. Specifically, if I open VSCode and it restores the windows from a previous session, it doesn't display the custom view even though the current file matches the language ID. Sometimes, after clicking around various documents, opening/closing new ones, it will finally show up.
Does something need to happen to set the resourceLangId when launching VSCode? The extension is for a custom language, which detects files from the filenamePatterns in the package.json. Is the resourceLangId not checking against it or is the URI not being set properly from it so that resourceLangID is set?
So using this setup, if I have a file open that has a filename of N93845, the editor does recognize it as belonging to the nzq language, but the custom view isn't showing up.
The text was updated successfully, but these errors were encountered: