-
Notifications
You must be signed in to change notification settings - Fork 62
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
fix: Use connected connection model options VSCODE-234 #255
fix: Use connected connection model options VSCODE-234 #255
Conversation
…d against the correct connection
} | ||
|
||
this._activeConnectionCodeLensProvider?.refresh(); | ||
const connectionDetails = dataService.getConnectionOptions(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like connectionDetails
name is confusing because we get connectionOptions from dataservice
. Probably should be renamed in the dataservice
since it includes options and URL and not just options.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. I think this is a bit of a hack in general. Will be nice to update to new driver and clean up some of this.
); | ||
|
||
return resolve(undefined); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Great refactoring of the playground controller! It will definitely ensure that playgrounds are running on the proper connection. Does this fix also address the directConnection issue? |
@alenakhineika Here are the connection options being used to connect on the language server now (ssh tunnel connection): |
VSCODE-234
This PR updates how we fetch connection details to pass to playgrounds, so that we take the options which were used when connecting. This should fix #249 since now we'll use the options with
directionConnection
set: https://github.com/mongodb-js/connection-model/blob/master/lib/connect.js#L228 Alternatively we could setdirectConnection
manually, or set it in connection options in connection-model.This PR also adds a check so that we only run a playground when the connected connection's id matches the connection id passed when running the playground.
The way we're handling these ssl files, and connection options is a bit confusing. I think we can clear it up a bit in future, especially once we upgrade to 4.0. We can remove sslKey from our model and avoid any ssl file reading. I also think how we're deriving these connection options from the data service post connection is a bit error prone. I think some better defaults on the connection model or how its originally parsed could clear it up a bit. Not for this PR though.