-
Notifications
You must be signed in to change notification settings - Fork 358
Description
This is slightly related to microsoft/vscode#15178. Right now there's no way for an editor to know when a document is either "open" or "visible" in a way that matches the users expectation:
Open in this sense means it is managed by the client. It doesn’t necessarily mean that its content is presented in an editor.
There are many situations where a server would like to know what files a user has open (or visible). For example:
- The user wants to ignore lints/errors in certain files - for example files generated by tools
- When the user opens the file in the editor, they want to see these errors/lints (eg. to debug something going wrong in them)
- When the user closes the file, they expect the errors/lints to disappear (immediately, not after 3 minutes)
Even though VS Code doesn't have an API for "open editors", it does have an API for "visible editors". Even if VS Code plans to never support "open editors" it would be very useful for LSP to provide "visible editors". On the other hand, if VS Code does add support for "open editors", then that could be provided instead/as well. In either case, it seems like LSP needs some changes to support one or the other (or both).
(as a workaround, I'm considering implementing custom messages in the VS Code extension + LSP server to pass the "visible editors" over to the server.. it feels really hacky though).