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

Extension Dev: Opening files without triggering an onDidOpen event for other extensions #33046

Closed
joshbw opened this issue Aug 23, 2017 · 2 comments
Labels
*duplicate Issue identified as a duplicate of another issue(s) extensions Issues concerning extensions

Comments

@joshbw
Copy link

joshbw commented Aug 23, 2017

In reference to this thread: #15723

I'd like to implement a "Scan all" command in my extension, that scans all of the relevant files in the workspace. The easiest way to do this is to call workspace.OpenTextDocument, but doing so triggers an onDidOpen event that a lot of extensions listen for. The result is that the "Problems" window doesn't just get the output of the analysis my own extension produces, but the output for every extension that generates problems and listens to the onDidOpen event. Ideally I wouldn't inundate my users with output for other extensions when running a command for my own extension.

I don't need the onDidOpen event myself (I can just do a client.sendRequest in the "then" of openTextDocument to trigger my own analysis). Is there any chance @dbaeumer that you changed your stance from the previous thread and there is now some mechanism to open a file without triggered an onDidOpen? I would argue that there is a difference between the user opening a file in the UI, and an extension opening a file that is never displayed in the UI. In the latter case, probably doesn't make sense for anyone but that extension to know it opened (i.e. be able to suppress sending onDidOpen to any other extensions).

thanks

@vscodebot vscodebot bot added the extensions Issues concerning extensions label Aug 23, 2017
@dbaeumer
Copy link
Member

@joshbw I am not against this the problem is that even a normal VS Code extension and therefore the LSP client as well can currently not reliably distinguish between a document opened from a user and available in the editor or a document opened via workspace.OpenTextDocument. To do so we need to address #15178.

Marking as dup of #15178

@dbaeumer dbaeumer added the *duplicate Issue identified as a duplicate of another issue(s) label Aug 24, 2017
@joshbw
Copy link
Author

joshbw commented Aug 24, 2017

Thanks @dbaeumer

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*duplicate Issue identified as a duplicate of another issue(s) extensions Issues concerning extensions
Projects
None yet
Development

No branches or pull requests

2 participants