Compare commits

...

10 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
Cory Rivera
b765e5aa90 Add updater service url to product.json. (#467) 2018-01-10 16:51:56 -08:00
17 changed files with 79 additions and 39 deletions

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": [

2
npm-shrinkwrap.json generated
View File

@@ -1,6 +1,6 @@
{
"name": "sqlops",
"version": "0.25.2",
"version": "0.25.4",
"dependencies": {
"@angular/animations": {
"version": "4.1.3",

View File

@@ -1,6 +1,6 @@
{
"name": "sqlops",
"version": "0.25.2",
"version": "0.25.4",
"electronVersion": "1.7.9",
"distro": "8c3e97e3425cc9814496472ab73e076de2ba99ee",
"author": {

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

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

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

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

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

@@ -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.'),

View File

@@ -366,10 +366,7 @@ export abstract class TextFileService implements ITextFileService {
}
// Hot exit
// {{SQL CARBON EDIT}}
// const hotExitMode = configuration && configuration.files ? configuration.files.hotExit : HotExitConfiguration.ON_EXIT;
const hotExitMode = HotExitConfiguration.OFF;
const hotExitMode = configuration && configuration.files ? configuration.files.hotExit : HotExitConfiguration.ON_EXIT;
if (hotExitMode === HotExitConfiguration.OFF || hotExitMode === HotExitConfiguration.ON_EXIT_AND_WINDOW_CLOSE) {
this.configuredHotExit = hotExitMode;
} else {