-
Notifications
You must be signed in to change notification settings - Fork 463
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
added new command to create new SQL query document #569
Conversation
@llali, thanks for your PR! By analyzing the history of the files in this pull request, we identified @MitchellSternke, @anthonydresser and @kburtram to be potential reviewers. |
Hi @llali, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!
TTYL, MSBOT; |
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.
My overall opinion is that we really should strive to capitalize on whatever built-in functionality we have -- if we can.
@@ -52,7 +54,10 @@ export default class MainController implements vscode.Disposable { | |||
} | |||
if (vscodeWrapper) { | |||
this._vscodeWrapper = vscodeWrapper; |
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.
We can simplify this with the or operator into this._vscodeWrapper = vscodeWrapper || new VscodeWrapper()
Or we could use a ternary operator. But I think we should avoid using if/else for this kind of logic #Resolved
/** | ||
* Service for creating untitled documents for SQL query | ||
*/ | ||
export default class UntitledSqlDocumentService { |
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'm sure you explored this already, but I feel like there has to be some command built into VS Code to just create an untitled document. I'm thinking by opening an in-memory untitled doc, the header for the file would be "untitled 1" or some such. Can we verify that there isn't any way to programmatically create an untitled document before we go ahead with this change? #WontFix
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.
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.
Is it possible to change the language of the document after it's created? I took a look at the API but it claims that the languageId of a TextDocument is readonly. I can't really understand why that would be the case, and I'd want further clarification from VS Code folks. #WontFix
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 tried that also and it didn't work. I created a feature request in VsCode: microsoft/vscode#17917 (comment)
#WontFix
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.
Fair enough, seems silly they don't have a programmatic way of doing that, but it's a project that's still growing.
@@ -0,0 +1,128 @@ | |||
import * as TypeMoq from 'typemoq'; |
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 see there's a good number of tests added here, but Coveralls says this change drops code coverage by 32%. That's a huge change. Can we make sure we understand what's going on with coveralls's assessment before we move forward? #Resolved
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.
yes not sure why. I see a permission error in travis job, might be related
In reply to: 94176306 [](ancestors = 94176306)
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.
Pending the Coveralls build looks good, I'm fine with these changes.
Added new command "mssql: New query" TODO: not sure what to use for the short but
The new command creates new SQL query untitled document in the temp folder but because it's untitled, the file doesn't get created so user can decide to save it or not
the new query command activates the extension is not already activated.
The name of the document will be SQLQuery[number].sql
after a new SQL query is created the new connection command will be called for user to open a connection