Skip to content
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

Merged
merged 5 commits into from
Jan 4, 2017
Merged

Conversation

llali
Copy link
Member

@llali llali commented Dec 29, 2016

  • 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

@mention-bot
Copy link

@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.

@msftclas
Copy link

Hi @llali, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!


It looks like you're a Microsoft contributor (Leila Lali). If you're full-time, we DON'T require a Contribution License Agreement. If you are a vendor, please DO sign the electronic Contribution License Agreement. It will take 2 minutes and there's no faxing! https://cla.microsoft.com.

TTYL, MSBOT;

@coveralls
Copy link

Coverage Status

Coverage decreased (-32.7%) to 28.594% when pulling f3bed39 on feature/newquery into acafa52 on dev.

@coveralls
Copy link

Coverage Status

Coverage decreased (-32.7%) to 28.61% when pulling dd4f8fa on feature/newquery into acafa52 on dev.

Copy link
Contributor

@benrr101 benrr101 left a 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;
Copy link
Contributor

@benrr101 benrr101 Dec 29, 2016

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 {
Copy link
Contributor

@benrr101 benrr101 Dec 29, 2016

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that one doesn't let me change the language to sql


In reply to: 94176030 [](ancestors = 94176030)

Copy link
Contributor

@benrr101 benrr101 Dec 29, 2016

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

Copy link
Member Author

@llali llali Jan 3, 2017

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

Copy link
Contributor

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';
Copy link
Contributor

@benrr101 benrr101 Dec 29, 2016

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

Copy link
Member Author

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)

@coveralls
Copy link

Coverage Status

Coverage increased (+0.3%) to 61.648% when pulling 1ffbcf8 on feature/newquery into acafa52 on dev.

Copy link
Contributor

@benrr101 benrr101 left a 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.

@coveralls
Copy link

Coverage Status

Coverage decreased (-3.4%) to 57.98% when pulling 007a8b5 on feature/newquery into acafa52 on dev.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.4%) to 57.98% when pulling 21a0c55 on feature/newquery into 5ccfccf on dev.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants