You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Steps to Reproduce: Configuration to connect to SQL from the extension
Reference: #19732
Repro steps - execute 2 separate queries
Highlight the text select * from sys.databases and execute MS SQL: Execute Query (Ctrl+Shift+E) to run
You will notice the results editor tab opens, which is a WebView component.
Hide this webview behind the .sql document you just created:
Highlight the text select * from sys.tables and execute the MS SQL: Execute Query
Expected:
The results editor tab is found, brought to the foreground, and refreshed.
Actual:
The results editor tab is not found and not refreshed. A new results tab with the same URI is opened in the second pane.
Note that, if you have the results tab in the foreground, it is always found and refreshed properly.
The reason this is not happening is because this slice of code tells us if there is one already open or not:
public doesResultPaneExist(resultsUri: string): boolean {
let resultPaneURIMatch = vscode.workspace.textDocuments.find(tDoc => tDoc.uri.toString() === resultsUri);
return (resultPaneURIMatch !== undefined);
}
vscode.workspace.textDocuments contains all text documents, regardless of if they are visible or not, but it does not contain all previewHtml documents. It only contains the previewHtml documents that are visible. (In other words, any previewHtml documents which are not visible are not found in vscode.workspace.textDocuments which is inconsistent with other types of text documents)
The text was updated successfully, but these errors were encountered:
This issue also effects the markdown preview (see issues like #8581). When I looked through the implementation in VSCode, I believe the current behavior may have been by design but perhaps we need a way to return all documents including html previews.
Closing this as dupe of #15178 which is about knowing what tabs (tab != editors != documents) are open. Ultimately we should migrate folks from the dark side and enable actual UX extensions
Steps to Reproduce:
Configuration to connect to SQL from the extension
Reference: #19732
Repro steps - execute 2 separate queries
Highlight the text
select * from sys.databases
and executeMS SQL: Execute Query
(Ctrl+Shift+E) to runYou will notice the results editor tab opens, which is a WebView component.
Hide this webview behind the .sql document you just created:
Highlight the text
select * from sys.tables
and execute the MS SQL: Execute QueryExpected:
The results editor tab is found, brought to the foreground, and refreshed.
Actual:
The results editor tab is not found and not refreshed. A new results tab with the same URI is opened in the second pane.
Note that, if you have the results tab in the foreground, it is always found and refreshed properly.
The reason this is not happening is because this slice of code tells us if there is one already open or not:
vscode.workspace.textDocuments
contains all text documents, regardless of if they are visible or not, but it does not contain all previewHtml documents. It only contains the previewHtml documents that are visible. (In other words, any previewHtml documents which are not visible are not found invscode.workspace.textDocuments
which is inconsistent with other types of text documents)The text was updated successfully, but these errors were encountered: