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

Fix new result pane column behavior #582

Merged
merged 10 commits into from
Jan 7, 2017
Merged

Fix new result pane column behavior #582

merged 10 commits into from
Jan 7, 2017

Conversation

Raymondd
Copy link
Contributor

@Raymondd Raymondd commented Jan 5, 2017

Fixes #549.
splitPaneSelection configuration property added. Corresponding behavior added to vscodeWrapper class.

@msftclas
Copy link

msftclas commented Jan 5, 2017

Hi @Raymondd, 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 (Raymond Martin). 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 (-0.2%) to 57.742% when pulling 4cd43dc on fix/resultsPaneColumn into ccc7eb2 on dev.

@coquagli
Copy link
Contributor

coquagli commented Jan 5, 2017

Might be a good idea to write a simple unit test for this.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.1%) to 58.125% when pulling ac950fb on fix/resultsPaneColumn into ccc7eb2 on dev.

},
"mssql.splitPaneSelection": {
"type": "string",
"description": "[Optional] Configuration options for which column new result panes should open in (Options: {'next'|'same'|'last'})",
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you can remove the (Options: {'next'|'same'|'last'}) part - the enum values are listed as options by VSCode when altering them

"default": "next",
"enum": [
"next",
"same",
Copy link
Contributor

Choose a reason for hiding this comment

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

current instead of same, end instead of last unless you mean previous ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It does mean 'end'. Will change.

@@ -269,4 +269,5 @@ export default class VscodeWrapper {
public get workspaceRootPath(): string {
return vscode.workspace.rootPath;
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like you can undo the change in this file


// Check if the results window already exists
if (resultPaneURIMatch !== undefined) {
if (this.doesResultPaneExist(resultsUri)) {
// Implicity Use existsing results window by not providing an pane
Copy link
Contributor

Choose a reason for hiding this comment

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

typo existing instead of existsing (since you're changing this area anyhow)

@@ -535,4 +534,51 @@ export class SqlOutputContentProvider implements vscode.TextDocumentContentProvi
}
return path.join(os.tmpdir(), columnName + '_' + String(Math.floor( Date.now() / 1000)) + String(process.pid) + '.' + linkType);
}

/**
* Returns wether or not a result pane with the same URI exists
Copy link
Contributor

Choose a reason for hiding this comment

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

typo whether

/**
* Returns wether or not a result pane with the same URI exists
* @param The string value of a Uri.
* @return Existence boolean
Copy link
Contributor

Choose a reason for hiding this comment

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

@return boolean true if pane exists

* public for testing purposes
*/
public doesResultPaneExist(resultsUri: string): boolean {
let resultPaneURIMatch = vscode.workspace.textDocuments.find(tDoc => tDoc.uri.toString() === resultsUri);
Copy link
Contributor

Choose a reason for hiding this comment

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

please use this._vscodeWrapper.textDocuments() instead of direct references so it's easier to mock.

viewColumn = this._vscodeWrapper.activeTextEditor.viewColumn;
break;
case 'last' :
viewColumn = vscode.ViewColumn.Three;
Copy link
Contributor

Choose a reason for hiding this comment

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

Is three the max value? Could this ever change?

Copy link
Contributor Author

@Raymondd Raymondd Jan 6, 2017

Choose a reason for hiding this comment

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

Three is the maximum number of panes one can have open in VSCode. Also vscode.ViewColumn only has properties one, two, and three.

});


// TODO: rewrite all the outputprodiver handle tests (old ones kept for reference)
Copy link
Contributor

Choose a reason for hiding this comment

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

is there an issue tracking it? if so what's the issue #? also typo outputprovider

expectedColumn: number;
}

let cases: Case[] = [
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be nice if each of these was a test case. See https://mochajs.org/#dynamically-generating-tests for how to easily convert this (basically define cases at the suite level and in the foreach define a test.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I could dynamically generate each test, but would it be worth it to have 9 test cases and an entire suite for this one function?

Copy link
Contributor

@kevcunnane kevcunnane Jan 7, 2017

Choose a reason for hiding this comment

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

Sounds good, leave as-is

@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 58.002% when pulling 9088be1 on fix/resultsPaneColumn into ccc7eb2 on dev.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.1%) to 58.125% when pulling 73042fd on fix/resultsPaneColumn into ccc7eb2 on dev.

@Raymondd Raymondd merged commit 597fe49 into dev Jan 7, 2017
@Raymondd Raymondd deleted the fix/resultsPaneColumn branch January 7, 2017 00:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants