Extension Dev: Opening files without triggering an onDidOpen event for other extensions #33046
Labels
*duplicate
Issue identified as a duplicate of another issue(s)
extensions
Issues concerning extensions
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
The text was updated successfully, but these errors were encountered: