-
Notifications
You must be signed in to change notification settings - Fork 407
Open connection dialog when using connection string input types #2302
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
Conversation
result = await azdata.connection.getConnectionString(connection.connectionId, true); | ||
} | ||
} else { | ||
result = (inputTypeHint === 'file') |
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.
It would be ideal if this block wasn't repeated code, e.g. a map of type hint to implementation that the ADS code could just add a handler to. The code is simple now but additional use of type hints is planned and it will get more complex.
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.
Where would that input handler need to be added? Would it be another RequestInputType command handler that gets registered from the version specific code?
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.
It doesn't need to be a kernel command handler, but just something the kernel calls into when handling an input request. If you add custom handlers there for the hinted type, then use the custom experience. Otherwise, return a value that allows the central handler to fall back to the default behaviors (i.e. currently "file" and "text").
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.
Added a new handler
This change opens the Azure Data Studio connection dialog when using an input token for the connection string in the connect magic command. Since we need to use some ADS-specific extension methods here, I moved the input handling into the versionSpecificFunctions files so that we can import azdata without breaking the vscode extension.