Compare commits

..

23 Commits

Author SHA1 Message Date
Karl Burtram
8095643ed4 Merge branch 'master' into release/0.25 2018-01-12 15:43:19 -08:00
Matt Irvine
fcb6f7f9ee open-url changes 2018-01-12 15:00:21 -08:00
Karl Burtram
94bd1c4d7d Bump SQL Ops to 0.25.4 for next Jan release candidate build (#483) 2018-01-12 12:44:00 -08:00
Sebastian Pfliegel
e4a0e4e0c1 Add cursor snippet (#475)
* Add cursor snippet

* Workaround to avoid issue #480

Remove SELECT and tab to the place for custom code
2018-01-12 12:39:17 -08:00
Karl Burtram
96a3ded120 Merge branch 'master' into release/0.25 2018-01-11 17:33:31 -08:00
Karl Burtram
b73b09a1d3 Bump SQL Ops version to 0.23.3 for next release candidate build (#479) 2018-01-11 17:21:53 -08:00
Cory Rivera
a69a9778a6 Fix update package download paths (#476)
* Change update package download path to use sqlops naming.

* Add SqlEdit comments above download path changes.
2018-01-11 17:19:40 -08:00
Matt Irvine
6d3995aa29 Enable hot exit for saved files (#469) 2018-01-11 14:29:26 -08:00
Karl Burtram
bd3aa9c3cf Merge branch 'master' into release/0.25 2018-01-10 22:08:15 -08:00
Karl Burtram
7cf0847ef5 Bump Tools Service version to pick up latest changes (#471) 2018-01-10 21:58:27 -08:00
Matt Irvine
8e8e1f6913 Disable hot exit (#468) 2018-01-10 18:07:49 -08:00
Cory Rivera
b765e5aa90 Add updater service url to product.json. (#467) 2018-01-10 16:51:56 -08:00
Karl Burtram
7a421cc0bd Update changelog for Jan release (#466) 2018-01-10 16:48:08 -08:00
Karl Burtram
fb82440412 Bump product version to 0.25.2 (#461) 2018-01-10 13:10:35 -08:00
Benjamin Russell
2263ea48a1 Disabling the "learn more" link for now (#451)
* Disabling the "learn more" link for now

* Adding date/issue link
2018-01-10 10:29:06 -08:00
Matt Irvine
1868a6127a Fix bug where collapsed OE icon never appeared for selected element (#453) 2018-01-09 15:35:51 -05:00
Matt Irvine
5e4b8924ec Set tab color default off and add config for fill/border (#452) 2018-01-08 20:05:27 -05:00
Matt Irvine
62de97da54 Redraw tab background color when dragged (#442) 2018-01-08 12:40:04 -05:00
Anthony Dresser
9e051c6f63 update shrinkwrap (#445) 2018-01-04 16:32:30 -08:00
Karl Burtram
a43444e95f Bump SQL Ops to 0.25.1 for next release (#444) 2018-01-04 13:39:12 -08:00
Alex Tercete
a3948ac744 Fix "No extension gallery service configured" error (#427)
The error occurred when trying to install an extension from the new
_File > Install Extension from VSIX Package_ menu entry.

Because there's no gallery URL configured at the moment, querying the
gallery to retrieve package metadata is pointless, and skipping this
step fixes the problem for now.
2018-01-04 13:36:25 -08:00
Karl Burtram
1cd4b39e9d Revert "Remove unneeded npm package references from mssql" (#443)
* Revert "update libraries to clean node_modules (#394)"

This reverts commit e691b278ae.

* Revert "Update README.md to link to the insiders build release page (#440)"

This reverts commit 334c755118.

* Revert "Remove unneeded npm package references from mssql (#438)"

This reverts commit ee80bddd17.
2018-01-04 12:52:58 -08:00
Anthony Dresser
e691b278ae update libraries to clean node_modules (#394) 2018-01-04 11:48:21 -08:00
28 changed files with 223 additions and 90 deletions

View File

@@ -1,5 +1,29 @@
# Change Log
## Version 0.25.2
* Release date: January 17, 2017
* Release status: Public Preview
## What's new in this version
The January release focuses on addressing a few of the top upvoted feature suggestions, as well as fixing high-priority bugs. This release period coincides with holiday vacations, so the churn in this release is
relatively scoped.
Here's some of the highlights in the January release.
* Tab-coloring based on Server Group
* Saved Server connections are available in Connection Dialog
* Enable HotExit feature
* Fix broken Run Current Query command
* Fix drag-and-drop breaking scripting bug
* Fix incorrect pinned Start Menu icon
* Fix missing Azure Account branding icon
* Change "Server name" to "Server" in Connection Dialog
## Contributions and "thank you"
We would like to thank all our users who raised issues, and in particular the following users who helped contribute fixes:
* alextercete for `Fix "No extension gallery service configured" error (#427)`
## Version 0.24.1
* Release date: December 19, 2017
* Release status: Public Preview

View File

@@ -1,7 +1,7 @@
{
"service": {
"downloadUrl": "https://github.com/Microsoft/sqltoolsservice/releases/download/v{#version#}/microsoft.sqltools.servicelayer-{#fileName#}",
"version": "1.2.0-alpha.49",
"version": "1.4.0-alpha.3",
"downloadFileNames": {
"Windows_86": "win-x86-netcoreapp2.0.zip",
"Windows_64": "win-x64-netcoreapp2.0.zip",

View File

@@ -2,5 +2,20 @@
"name": "mssql",
"version": "0.1.0",
"dependencies": {
"dataprotocol-client": {
"version": "2.6.3",
"from": "..\\..\\dataprotocol-node\\client",
"resolved": "file:..\\..\\dataprotocol-node\\client"
},
"dataprotocol-jsonrpc": {
"version": "2.4.0",
"from": "..\\..\\dataprotocol-node\\jsonrpc",
"resolved": "file:..\\..\\dataprotocol-node\\jsonrpc"
},
"dataprotocol-languageserver-types": {
"version": "1.0.4",
"from": "..\\..\\dataprotocol-node\\types",
"resolved": "file:..\\..\\dataprotocol-node\\types"
}
}
}

View File

@@ -243,6 +243,33 @@
"description": "Lists all the columns and their types for tables matching a LIKE statement"
},
"Declare a cursor": {
"prefix": "sqlCursor",
"body": [
"-- Declare a cursor for a Table or a View '${1:TableOrViewName}' in schema '${2:SchemaName}'",
"DECLARE @Column1 NVARCHAR(50), @Column2 NVARCHAR(50)",
"",
"DECLARE db_cursor CURSOR FOR",
"SELECT Column1, Column2",
"FROM $2.$1",
"",
"OPEN db_cursor",
"FETCH NEXT FROM db_cursor INTO @Column1, @Column2",
"",
"WHILE @@FETCH_STATUS = 0",
"BEGIN",
"\t-- add instructions to be executed for every row",
"\t$3",
"\tFETCH NEXT FROM db_cursor INTO @Column1, @Column2",
"END",
"",
"CLOSE db_cursor",
"DEALLOCATE db_cursor",
"GO"
],
"description": "Declare a cursor"
},
"Show space used by tables": {
"prefix": "sqlGetSpaceUsed",
"body": [

30
npm-shrinkwrap.json generated
View File

@@ -1,6 +1,6 @@
{
"name": "sqlops",
"version": "0.24.1",
"version": "0.25.4",
"dependencies": {
"@angular/animations": {
"version": "4.1.3",
@@ -63,9 +63,9 @@
"resolved": "https://registry.npmjs.org/angular2-grid/-/angular2-grid-2.0.6.tgz"
},
"angular2-slickgrid": {
"version": "1.2.3",
"from": "git://github.com/Microsoft/angular2-slickgrid.git#1.3.5",
"resolved": "git://github.com/Microsoft/angular2-slickgrid.git#d122015f2f3e4023394a7e485079da62f20b8356"
"version": "1.3.6",
"from": "git://github.com/Microsoft/angular2-slickgrid.git#1.3.6",
"resolved": "git://github.com/Microsoft/angular2-slickgrid.git#0393bae34ba65464e6b6fc248b950ccea44382d9"
},
"anymatch": {
"version": "1.3.2",
@@ -134,9 +134,9 @@
"resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz"
},
"caniuse-db": {
"version": "1.0.30000783",
"version": "1.0.30000787",
"from": "caniuse-db@>=1.0.30000161 <2.0.0",
"resolved": "https://registry.npmjs.org/caniuse-db/-/caniuse-db-1.0.30000783.tgz"
"resolved": "https://registry.npmjs.org/caniuse-db/-/caniuse-db-1.0.30000787.tgz"
},
"chart.js": {
"version": "2.7.1",
@@ -296,9 +296,9 @@
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz"
},
"html-query-plan": {
"version": "1.0.0",
"from": "git://github.com/anthonydresser/html-query-plan.git#2.2.5",
"resolved": "git://github.com/anthonydresser/html-query-plan.git#fbf8beac00b3870c0d3f4e95de979f7f1ec7af5d"
"version": "2.2.6",
"from": "git://github.com/anthonydresser/html-query-plan.git#2.2.6",
"resolved": "git://github.com/anthonydresser/html-query-plan.git#e09ffda978113c73366b663066372f884cf75e05"
},
"http-proxy-agent": {
"version": "0.2.7",
@@ -436,9 +436,9 @@
"resolved": "https://registry.npmjs.org/lodash.isundefined/-/lodash.isundefined-3.0.1.tgz"
},
"make-error": {
"version": "1.3.0",
"version": "1.3.2",
"from": "make-error@>=1.1.1 <2.0.0",
"resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.0.tgz"
"resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.2.tgz"
},
"micromatch": {
"version": "2.3.11",
@@ -451,9 +451,9 @@
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz"
},
"moment": {
"version": "2.20.0",
"version": "2.20.1",
"from": "moment@>=2.15.1 <3.0.0",
"resolved": "https://registry.npmjs.org/moment/-/moment-2.20.0.tgz"
"resolved": "https://registry.npmjs.org/moment/-/moment-2.20.1.tgz"
},
"ms": {
"version": "2.0.0",
@@ -811,9 +811,9 @@
"resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.8.0.tgz"
},
"zone.js": {
"version": "0.8.18",
"version": "0.8.19",
"from": "zone.js@>=0.8.4 <0.9.0",
"resolved": "https://registry.npmjs.org/zone.js/-/zone.js-0.8.18.tgz"
"resolved": "https://registry.npmjs.org/zone.js/-/zone.js-0.8.19.tgz"
}
}
}

View File

@@ -1,6 +1,6 @@
{
"name": "sqlops",
"version": "0.25.0",
"version": "0.25.4",
"electronVersion": "1.7.9",
"distro": "8c3e97e3425cc9814496472ab73e076de2ba99ee",
"author": {
@@ -33,7 +33,7 @@
"@angular/router": "~4.1.3",
"@angular/upgrade": "~4.1.3",
"angular2-grid": "2.0.6",
"angular2-slickgrid": "git://github.com/Microsoft/angular2-slickgrid.git#1.3.5",
"angular2-slickgrid": "git://github.com/Microsoft/angular2-slickgrid.git#1.3.6",
"applicationinsights": "0.17.1",
"chart.js": "^2.6.0",
"core-js": "^2.4.1",
@@ -45,7 +45,7 @@
"gc-signals": "^0.0.1",
"getmac": "1.0.7",
"graceful-fs": "4.1.11",
"html-query-plan": "git://github.com/anthonydresser/html-query-plan.git#2.2.5",
"html-query-plan": "git://github.com/anthonydresser/html-query-plan.git#2.2.6",
"http-proxy-agent": "0.2.7",
"https-proxy-agent": "0.3.6",
"iconv-lite": "0.4.15",

View File

@@ -28,5 +28,7 @@
"releaseNotesUrl": "https://go.microsoft.com/fwlink/?linkid=862039",
"documentationUrl": "https://go.microsoft.com/fwlink/?linkid=862277",
"commit": "9ca6200018fc206d67a47229f991901a8a453781",
"date": "2017-12-15T12:00:00.000Z"
"date": "2017-12-15T12:00:00.000Z",
"updateUrl": "https://sqlops-update.azurewebsites.net",
"quality": "stable"
}

View File

@@ -93,7 +93,7 @@ export class FirewallRuleDialog extends Modal {
protected renderBody(container: HTMLElement) {
let descriptionSection;
$().div({ class: 'firewall-rule-description-section new-section' }, (descriptionContainer) => {
$().div({ 'class': 'firewall-rule-description-section new-section' }, (descriptionContainer) => {
descriptionSection = descriptionContainer.getHTMLElement();
DOM.append(descriptionContainer.getHTMLElement(), DOM.$('div.firewall-rule-icon'));
@@ -101,9 +101,11 @@ export class FirewallRuleDialog extends Modal {
let dialogDescription = localize('firewallRuleDialogDescription',
'Your client IP address does not have access to the server. Sign in to an Azure account and create a new firewall rule to enable access.');
this.createLabelElement(new Builder(textDescriptionContainer), dialogDescription, false);
this._helpLink = DOM.append(textDescriptionContainer, DOM.$('a.help-link'));
this._helpLink.setAttribute('href', 'https://docs.microsoft.com/en-us/azure/sql-database/sql-database-firewall-configure');
this._helpLink.innerHTML += localize('firewallRuleHelpDescription', 'Learn more about firewall settings');
// TODO: Make this 1) extensible and 2) open the info via an action (01/08/2018, https://github.com/Microsoft/sqlopsstudio/issues/450)
// this._helpLink = DOM.append(textDescriptionContainer, DOM.$('a.help-link'));
// this._helpLink.setAttribute('href', 'https://docs.microsoft.com/en-us/azure/sql-database/sql-database-firewall-configure');
// this._helpLink.innerHTML += localize('firewallRuleHelpDescription', 'Learn more about firewall settings');
});
// Create account picker with event handling
@@ -116,43 +118,43 @@ export class FirewallRuleDialog extends Modal {
this._accountPickerService.onAccountSelectionChangeEvent((account) => this.onAccountSelectionChange(account));
let azureAccountSection;
$().div({ class: 'azure-account-section new-section' }, (azureAccountContainer) => {
$().div({ 'class': 'azure-account-section new-section' }, (azureAccountContainer) => {
azureAccountSection = azureAccountContainer.getHTMLElement();
let azureAccountLabel = localize('azureAccount', 'Azure account');
this.createLabelElement(azureAccountContainer, azureAccountLabel, true);
azureAccountContainer.div({ class: 'dialog-input' }, (inputCellContainer) => {
azureAccountContainer.div({ 'class': 'dialog-input' }, (inputCellContainer) => {
this._accountPickerService.renderAccountPicker(inputCellContainer.getHTMLElement());
});
});
let subnetIPRangeSection;
$().div({ class: 'subnet-ip-range-input' }, (subnetIPRangeContainer) => {
$().div({ 'class': 'subnet-ip-range-input' }, (subnetIPRangeContainer) => {
subnetIPRangeSection = subnetIPRangeContainer.getHTMLElement();
subnetIPRangeContainer.div({ class: 'dialog-input-section' }, (inputContainer) => {
inputContainer.div({ class: 'dialog-label' }, (labelContainer) => {
subnetIPRangeContainer.div({ 'class': 'dialog-input-section' }, (inputContainer) => {
inputContainer.div({ 'class': 'dialog-label' }, (labelContainer) => {
labelContainer.innerHtml(localize('from', 'From'));
});
inputContainer.div({ class: 'dialog-input' }, (inputCellContainer) => {
inputContainer.div({ 'class': 'dialog-input' }, (inputCellContainer) => {
this._fromRangeinputBox = new InputBox(inputCellContainer.getHTMLElement(), this._contextViewService);
});
inputContainer.div({ class: 'dialog-label' }, (labelContainer) => {
inputContainer.div({ 'class': 'dialog-label' }, (labelContainer) => {
labelContainer.innerHtml(localize('to', 'To'));
});
inputContainer.div({ class: 'dialog-input' }, (inputCellContainer) => {
inputContainer.div({ 'class': 'dialog-input' }, (inputCellContainer) => {
this._toRangeinputBox = new InputBox(inputCellContainer.getHTMLElement(), this._contextViewService);
});
});
});
let firewallRuleSection;
$().div({ class: 'firewall-rule-section new-section' }, (firewallRuleContainer) => {
$().div({ 'class': 'firewall-rule-section new-section' }, (firewallRuleContainer) => {
firewallRuleSection = firewallRuleContainer.getHTMLElement();
let firewallRuleLabel = localize('filewallRule', 'Firewall rule');
this.createLabelElement(firewallRuleContainer, firewallRuleLabel, true);
firewallRuleContainer.div({ class: 'radio-section' }, (radioContainer) => {
firewallRuleContainer.div({ 'class': 'radio-section' }, (radioContainer) => {
const form = DOM.append(radioContainer.getHTMLElement(), DOM.$('form.firewall-rule'));
const IPAddressDiv = DOM.append(form, DOM.$('div.firewall-ip-address dialog-input'));
const subnetIPRangeDiv = DOM.append(form, DOM.$('div.firewall-subnet-ip-range dialog-input'));
@@ -177,7 +179,7 @@ export class FirewallRuleDialog extends Modal {
});
});
new Builder(container).div({ class: 'firewall-rule-dialog' }, (builder) => {
new Builder(container).div({ 'class': 'firewall-rule-dialog' }, (builder) => {
builder.append(descriptionSection);
builder.append(azureAccountSection);
builder.append(firewallRuleSection);
@@ -214,7 +216,7 @@ export class FirewallRuleDialog extends Modal {
if (isHeader) {
className += ' header';
}
container.div({ class: className }, (labelContainer) => {
container.div({ 'class': className }, (labelContainer) => {
labelContainer.innerHtml(content);
});
}
@@ -305,4 +307,4 @@ export class FirewallRuleDialog extends Modal {
this.show();
}
}
}

View File

@@ -29,6 +29,7 @@ import * as TelemetryUtils from 'sql/common/telemetryUtilities';
import { warn } from 'sql/base/common/log';
import { IResourceProviderService } from 'sql/parts/accountManagement/common/interfaces';
import { IAngularEventingService, AngularEventType } from 'sql/services/angularEventing/angularEventingService';
import * as QueryConstants from 'sql/parts/query/common/constants';
import * as data from 'data';
@@ -1331,7 +1332,7 @@ export class ConnectionManagementService implements IConnectionManagementService
}
public getTabColorForUri(uri: string): string {
if (!WorkbenchUtils.getSqlConfigValue<string>(this._workspaceConfigurationService, 'enableTabColors')) {
if (WorkbenchUtils.getSqlConfigValue<string>(this._workspaceConfigurationService, 'tabColorMode') === QueryConstants.tabColorModeOff) {
return undefined;
}
let connectionProfile = this.getConnectionProfile(uri);

View File

@@ -5,7 +5,6 @@
import { TPromise } from 'vs/base/common/winjs.base';
import { EditorInput, EditorModel } from 'vs/workbench/common/editor';
import { UntitledEditorInput } from 'vs/workbench/common/editor/untitledEditorInput';
import { IDisposable } from 'vs/base/common/lifecycle';
import URI from 'vs/base/common/uri';
import { IModelService } from 'vs/editor/common/services/modelService';
@@ -70,7 +69,7 @@ export class DashboardInput extends EditorInput {
}
public getTypeId(): string {
return UntitledEditorInput.ID;
return DashboardInput.ID;
}
public getResource(): URI {

View File

@@ -10,3 +10,6 @@ export const configShowBatchTime = 'showBatchTime';
export const querySection = 'query';
export const shortcutStart = 'shortcut';
export const tabColorModeOff = 'off';
export const tabColorModeBorder = 'border';
export const tabColorModeFill = 'fill';

View File

@@ -31,6 +31,7 @@ import * as gridActions from 'sql/parts/grid/views/gridActions';
import * as gridCommands from 'sql/parts/grid/views/gridCommands';
import { QueryPlanEditor } from 'sql/parts/queryPlan/queryPlanEditor';
import { QueryPlanInput } from 'sql/parts/queryPlan/queryPlanInput';
import * as Constants from 'sql/parts/query/common/constants';
import { localize } from 'vs/nls';
const gridCommandsWeightBonus = 100; // give our commands a little bit more weight over other default list/tree commands
@@ -240,10 +241,16 @@ let registryProperties = {
'description': localize('sql.showBatchTime', '[Optional] Should execution time be shown for individual batches'),
'default': false
},
'sql.enableTabColors': {
'type': 'boolean',
'description': localize('sql.enableTabColors', 'True to color tabs based on the server group of their active connection, false otherwise'),
'default': true
'sql.tabColorMode': {
'type': 'string',
'enum': [Constants.tabColorModeOff, Constants.tabColorModeBorder, Constants.tabColorModeFill],
'enumDescriptions': [
localize('tabColorMode.off', "Tab coloring will be disabled"),
localize('tabColorMode.border', "The top border of each editor tab will be colored to match the relevant server group"),
localize('tabColorMode.fill', "Each editor tab's background color will match the relevant server group"),
],
'default': Constants.tabColorModeOff,
'description': localize('tabColorMode', "Controls how to color tabs based on the server group of their active connection")
},
'mssql.intelliSense.enableIntelliSense': {
'type': 'boolean',

View File

@@ -116,7 +116,7 @@ export class QueryInput extends EditorInput implements IEncodingSupport, IConnec
public getQueryResultsInputResource(): string { return this._results.uri; }
public showQueryResultsEditor(): void { this._showQueryResultsEditor.fire(); }
public updateSelection(selection: ISelectionData): void { this._updateSelection.fire(selection); }
public getTypeId(): string { return UntitledEditorInput.ID; }
public getTypeId(): string { return QueryInput.ID; }
public getDescription(): string { return this._description; }
public supportsSplitEditor(): boolean { return false; }
public getModeId(): string { return QueryInput.SCHEMA; }

View File

@@ -68,7 +68,7 @@ export class ProductContribution implements IWorkbenchContribution {
text => editorService.openEditor(instantiationService.createInstance(ReleaseNotesInput, pkg.version, text), { pinned: true }),
() => {
messageService.show(Severity.Info, {
message: nls.localize('read the release notes', "Welcome to {0} December Public Preview! Would you like to view the Getting Started Guide?", product.nameLong, pkg.version),
message: nls.localize('read the release notes', "Welcome to {0} January Public Preview! Would you like to view the Getting Started Guide?", product.nameLong, pkg.version),
actions: [
instantiationService.createInstance(OpenGettingStartedInBrowserAction),
CloseAction

View File

@@ -774,7 +774,7 @@ suite('SQL ConnectionManagementService tests', () => {
test('getTabColorForUri returns the group color corresponding to the connection for a URI', done => {
// Set up the connection store to give back a group for the expected connection profile
configResult['enableTabColors'] = true;
configResult['tabColorMode'] = 'border';
let expectedColor = 'red';
connectionStore.setup(x => x.getGroupFromId(connectionProfile.groupId)).returns(() => <IConnectionProfileGroup> {
color: expectedColor

View File

@@ -77,10 +77,14 @@
background-image: url('expanded.svg');
}
.monaco-tree .monaco-tree-rows.show-twisties > .monaco-tree-row.selected > .content:before {
.monaco-tree .monaco-tree-rows.show-twisties > .monaco-tree-row.has-children.selected.expanded > .content:before {
background-image: url('expanded-hc.svg');
}
.monaco-tree .monaco-tree-rows.show-twisties > .monaco-tree-row.has-children.selected > .content:before {
background-image: url('collapsed-hc.svg');
}
.monaco-tree .monaco-tree-rows > .monaco-tree-row.has-children.loading > .content:before {
background-image: url('loading.svg');
}

View File

@@ -83,10 +83,10 @@ export class LaunchService implements ILaunchService {
this.logService.log('Received data from other instance: ', args, userEnv);
// Check early for open-url which is handled in URL service
const openUrlArg = args['open-url'] || [];
const openUrl = typeof openUrlArg === 'string' ? [openUrlArg] : openUrlArg;
if (openUrl.length > 0) {
openUrl.forEach(url => this.urlService.open(url));
if (args['open-url'] && args._urls && args._urls.length > 0) {
// --open-url must contain -- followed by the url(s)
// process.argv is used over args._ as args._ are resolved to file paths at this point
args._urls.forEach(url => this.urlService.open(url));
return TPromise.as(null);
}

View File

@@ -49,7 +49,7 @@ function createServices(args: ParsedArgs): IInstantiationService {
services.set(IStorageService, new SyncDescriptor(StorageService));
services.set(IConfigurationService, new SyncDescriptor(ConfigurationService));
services.set(IRequestService, new SyncDescriptor(RequestService));
services.set(IURLService, new SyncDescriptor(URLService, args['open-url']));
services.set(IURLService, new SyncDescriptor(URLService, args['open-url'] ? args._urls : []));
services.set(IBackupMainService, new SyncDescriptor(BackupMainService));
return new InstantiationService(services, true);

View File

@@ -15,6 +15,11 @@ import { ParsedArgs } from 'vs/platform/environment/common/environment';
import { realpathSync } from 'vs/base/node/extfs';
export function validatePaths(args: ParsedArgs): ParsedArgs {
// Track URLs if they're going to be used
if (args['open-url']) {
args._urls = args._;
args._ = [];
}
// Realpath/normalize paths and watch out for goto line mode
const paths = doValidatePaths(args._, args.goto);

View File

@@ -8,6 +8,7 @@ import { createDecorator } from 'vs/platform/instantiation/common/instantiation'
export interface ParsedArgs {
[arg: string]: any;
_: string[];
_urls?: string[];
help?: boolean;
version?: boolean;
wait?: boolean;
@@ -38,7 +39,7 @@ export interface ParsedArgs {
'install-extension'?: string | string[];
'uninstall-extension'?: string | string[];
'enable-proposed-api'?: string | string[];
'open-url'?: string | string[];
'open-url'?: boolean;
'skip-getting-started'?: boolean;
'sticky-quickopen'?: boolean;
'disable-telemetry'?: boolean;

View File

@@ -24,7 +24,6 @@ const options: minimist.Opts = {
'debugBrkPluginHost',
'debugSearch',
'debugBrkSearch',
'open-url',
'enable-proposed-api',
'export-default-configuration',
'install-source'
@@ -39,6 +38,7 @@ const options: minimist.Opts = {
'new-window',
'unity-launch',
'reuse-window',
'open-url',
'performance',
'prof-startup',
'verbose',

View File

@@ -123,6 +123,14 @@ export class ExtensionManagementService implements IExtensionManagementService {
this._onInstallExtension.fire({ identifier, zipPath });
// {{SQL CARBON EDIT}}
// Until there's a gallery for SQL Ops Studio, skip retrieving the metadata from the gallery
return this.installExtension({ zipPath, id: identifier.id, metadata: null })
.then(
local => this._onDidInstallExtension.fire({ identifier, zipPath, local }),
error => { this._onDidInstallExtension.fire({ identifier, zipPath, error }); return TPromise.wrapError(error); }
);
/*
return this.galleryService.query({ names: [getGalleryExtensionId(manifest.publisher, manifest.name)], pageSize: 1 })
.then(galleryResult => {
const galleryExtension = galleryResult.firstPage[0];
@@ -133,6 +141,7 @@ export class ExtensionManagementService implements IExtensionManagementService {
error => { this._onDidInstallExtension.fire({ identifier, zipPath, error }); return TPromise.wrapError(error); }
);
});
*/
});
});

View File

@@ -41,7 +41,8 @@ export class Win32AutoUpdaterImpl extends EventEmitter implements IAutoUpdater {
}
get cachePath(): TPromise<string> {
const result = path.join(tmpdir(), `vscode-update-${process.arch}`);
// {{SQL CARBON EDIT}}
const result = path.join(tmpdir(), `sqlops-update-${process.arch}`);
return new TPromise<string>((c, e) => mkdirp(result, null, err => err ? e(err) : c(result)));
}
@@ -112,7 +113,8 @@ export class Win32AutoUpdaterImpl extends EventEmitter implements IAutoUpdater {
}
private getUpdatePackagePath(version: string): TPromise<string> {
return this.cachePath.then(cachePath => path.join(cachePath, `CodeSetup-${product.quality}-${version}.exe`));
// {{SQL CARBON EDIT}}
return this.cachePath.then(cachePath => path.join(cachePath, `SqlOpsStudioSetup-${product.quality}-${version}.exe`));
}
private cleanup(exceptVersion: string = null): Promise {

View File

@@ -26,7 +26,7 @@ export class URLService implements IURLService {
...globalBuffer
];
app.setAsDefaultProtocolClient(product.urlProtocol, process.execPath, ['--open-url']);
app.setAsDefaultProtocolClient(product.urlProtocol, process.execPath, ['--open-url', '--']);
const rawOnOpenUrl = fromEventEmitter(app, 'open-url', (event: Electron.Event, url: string) => ({ event, url }));

View File

@@ -42,10 +42,6 @@ import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
import { isMacintosh } from 'vs/base/common/platform';
import { GroupOnePicker, GroupTwoPicker, GroupThreePicker, AllEditorsPicker } from 'vs/workbench/browser/parts/editor/editorPicker';
// {{SQL CARBON EDIT}}
import { QueryResultsInput } from 'sql/parts/query/common/queryResultsInput';
import { QueryInput } from 'sql/parts/query/common/queryInput';
// Register String Editor
Registry.as<IEditorRegistry>(EditorExtensions.Editors).registerEditor(
new EditorDescriptor(
@@ -136,23 +132,15 @@ class UntitledEditorInputFactory implements IEditorInputFactory {
return JSON.stringify(serialized);
}
// {{SQL CARBON EDIT}}
public deserialize(instantiationService: IInstantiationService, serializedEditorInput: string): EditorInput {
return instantiationService.invokeFunction<EditorInput>(accessor => {
public deserialize(instantiationService: IInstantiationService, serializedEditorInput: string): UntitledEditorInput {
return instantiationService.invokeFunction<UntitledEditorInput>(accessor => {
const deserialized: ISerializedUntitledEditorInput = JSON.parse(serializedEditorInput);
const resource = !!deserialized.resourceJSON ? URI.revive(deserialized.resourceJSON) : URI.parse(deserialized.resource);
const filePath = resource.scheme === 'file' ? resource.fsPath : void 0;
const language = deserialized.modeId;
const encoding = deserialized.encoding;
// {{SQL CARBON EDIT}}
let input = accessor.get(IWorkbenchEditorService).createInput({ resource, filePath, language, encoding }) as UntitledEditorInput;
if (deserialized.modeId === QueryInput.SCHEMA) {
const queryResultsInput: QueryResultsInput = instantiationService.createInstance(QueryResultsInput, resource.toString());
return instantiationService.createInstance(QueryInput, input.getName(), '', input, queryResultsInput, undefined);
} else {
return input;
}
return accessor.get(IWorkbenchEditorService).createInput({ resource, filePath, language, encoding }) as UntitledEditorInput;
});
}
}

View File

@@ -47,6 +47,9 @@ import { IWorkspacesService } from 'vs/platform/workspaces/common/workspaces';
// {{SQL CARBON EDIT}} -- Display the editor's tab color
import { Color } from 'vs/base/common/color';
import { IWorkspaceConfigurationService } from 'vs/workbench/services/configuration/common/configuration';
import * as QueryConstants from 'sql/parts/query/common/constants';
import * as WorkbenchUtils from 'sql/workbench/common/sqlWorkbenchUtils';
interface IEditorInputLabel {
name: string;
@@ -80,7 +83,9 @@ export class TabsTitleControl extends TitleControl {
@IWindowsService private windowsService: IWindowsService,
@IThemeService themeService: IThemeService,
@IFileService private fileService: IFileService,
@IWorkspacesService private workspacesService: IWorkspacesService
@IWorkspacesService private workspacesService: IWorkspacesService,
// {{SQL CARBON EDIT}} -- Display the editor's tab color
@IWorkspaceConfigurationService private workspaceConfigurationService: IWorkspaceConfigurationService
) {
super(contextMenuService, instantiationService, editorService, editorGroupService, contextKeyService, keybindingService, telemetryService, messageService, menuService, quickOpenService, themeService);
@@ -245,6 +250,17 @@ export class TabsTitleControl extends TitleControl {
element.style.outlineColor = activeContrastBorderColor;
element.style.outlineOffset = null;
}
// {{SQL CARBON EDIT}} -- Display the editor's tab color
if (isTab) {
const tabContainer = this.tabsContainer.children[index];
if (tabContainer instanceof HTMLElement) {
let editor = this.context.getEditor(index);
if (editor) {
this.setEditorTabColor(editor, tabContainer, isActiveTab);
}
}
}
}
public allowDragging(element: HTMLElement): boolean {
@@ -335,18 +351,7 @@ export class TabsTitleControl extends TitleControl {
}
// {{SQL CARBON EDIT}} -- Display the editor's tab color
let sqlEditor = editor as any;
if (sqlEditor.tabColor && this.themeService.getTheme().type !== HIGH_CONTRAST) {
tabContainer.style.borderTopColor = sqlEditor.tabColor;
tabContainer.style.borderTopWidth = isTabActive ? '2px' : '1px';
let backgroundColor = Color.Format.CSS.parseHex(sqlEditor.tabColor);
if (backgroundColor) {
tabContainer.style.backgroundColor = backgroundColor.transparent(isTabActive ? 0.3 : 0.2).toString();
}
} else {
tabContainer.style.borderTopColor = '';
tabContainer.style.borderTopWidth = '';
}
this.setEditorTabColor(editor, tabContainer, isTabActive);
}
});
@@ -862,6 +867,26 @@ export class TabsTitleControl extends TitleControl {
return !isCopy || source.id === target.id;
}
// {{SQL CARBON EDIT}} -- Display the editor's tab color
private setEditorTabColor(editor: IEditorInput, tabContainer: HTMLElement, isTabActive: boolean) {
let sqlEditor = editor as any;
let tabColorMode = WorkbenchUtils.getSqlConfigValue<string>(this.workspaceConfigurationService, 'tabColorMode');
if (tabColorMode === QueryConstants.tabColorModeOff || (tabColorMode !== QueryConstants.tabColorModeBorder && tabColorMode !== QueryConstants.tabColorModeFill)
|| this.themeService.getTheme().type === HIGH_CONTRAST || !sqlEditor.tabColor) {
tabContainer.style.borderTopColor = '';
tabContainer.style.borderTopWidth = '';
return;
}
tabContainer.style.borderTopColor = sqlEditor.tabColor;
tabContainer.style.borderTopWidth = isTabActive ? '3px' : '2px';
if (tabColorMode === QueryConstants.tabColorModeFill) {
let backgroundColor = Color.Format.CSS.parseHex(sqlEditor.tabColor);
if (backgroundColor) {
tabContainer.style.backgroundColor = backgroundColor.transparent(isTabActive ? 0.5 : 0.2).toString();
}
}
}
}
class TabActionRunner extends ActionRunner {

View File

@@ -17,6 +17,10 @@ import { Registry } from 'vs/platform/registry/common/platform';
import { Position, Direction } from 'vs/platform/editor/common/editor';
import { ResourceMap } from 'vs/base/common/map';
// {{SQL CARBON EDIT}}
import { QueryInput } from 'sql/parts/query/common/queryInput';
import * as CustomInputConverter from 'sql/parts/common/customInputConverter';
export interface EditorCloseEvent extends IEditorCloseEvent {
editor: EditorInput;
}
@@ -643,7 +647,14 @@ export class EditorGroup implements IEditorGroup {
let serializableEditors: EditorInput[] = [];
let serializedEditors: ISerializedEditorInput[] = [];
let serializablePreviewIndex: number;
this.editors.forEach(e => {
// {{SQL CARBON EDIT}}
let editors = this.editors.map(e => {
if (e instanceof QueryInput) {
return e.sql;
}
return e;
});
editors.forEach(e => {
let factory = registry.getEditorInputFactory(e.getTypeId());
if (factory) {
let value = factory.serialize(e);
@@ -658,7 +669,14 @@ export class EditorGroup implements IEditorGroup {
}
});
const serializableMru = this.mru.map(e => this.indexOf(e, serializableEditors)).filter(i => i >= 0);
// {{SQL CARBON EDIT}}
let mru = this.mru.map(e => {
if (e instanceof QueryInput) {
return e.sql;
}
return e;
});
const serializableMru = mru.map(e => this.indexOf(e, serializableEditors)).filter(i => i >= 0);
return {
label: this.label,
@@ -680,7 +698,8 @@ export class EditorGroup implements IEditorGroup {
this.hookEditorListeners(editor);
this.updateResourceMap(editor, false /* add */);
return editor;
// {{SQL CARBON EDIT}}
return CustomInputConverter.convertEditorInput(editor, undefined, this.instantiationService);
}
return null;

View File

@@ -267,7 +267,7 @@ configurationRegistry.registerConfiguration({
'files.hotExit': {
'type': 'string',
'enum': [HotExitConfiguration.OFF, HotExitConfiguration.ON_EXIT, HotExitConfiguration.ON_EXIT_AND_WINDOW_CLOSE],
'default': HotExitConfiguration.ON_EXIT,
'default': HotExitConfiguration.OFF,
'enumDescriptions': [
nls.localize('hotExit.off', 'Disable hot exit.'),
nls.localize('hotExit.onExit', 'Hot exit will be triggered when the application is closed, that is when the last window is closed on Windows/Linux or when the workbench.action.quit command is triggered (command palette, keybinding, menu). All windows with backups will be restored upon next launch.'),