vscode-postgres
vscode-postgres copied to clipboard
Unable to select a connection - a document is not active
When opening an SQL file and selection PG Server I get Unable to select a connection - a document is not active.
However, when I click on the extension and select new query I am able to connect and execute queries.
That particular error is coming from the "Select Connection" command, and is activated by choosing the command from the command palette or by clicking on the server selector in the status bar.
The very first thing that command does is to make sure there is an active document to associate a connection with - specifically looking for a value in vscode.window.activeTextEditor.document.uri
.
Preview windows (like the query results, or a markdown preview) will fail this check and you are unable to set a connection on those types of windows. The biggest reason for that is there needs to be a common way to associate a results window with the window containing the query that generated it.
What are your steps so I can try to reproduce your specific scenario?