Refresh master with initial release/0.24 snapshot (#332)

* Initial port of release/0.24 source code

* Fix additional headers

* Fix a typo in launch.json
This commit is contained in:
Karl Burtram
2017-12-15 15:38:57 -08:00
committed by GitHub
parent 271b3a0b82
commit 6ad0df0e3e
7118 changed files with 107999 additions and 56466 deletions

View File

@@ -1,4 +1,4 @@
# Microsoft Data Management Protocol - Node
## License
[Source EULA](https://github.com/Microsoft/sqlopsstudio/blob/dev/license.txt)
[MIT](https://github.com/Microsoft/carbon/blob/dev/license.txt)

View File

@@ -30,7 +30,8 @@ import {
ExpandNodeInfo, ObjectExplorerCloseSessionInfo, ObjectExplorerSession, ObjectExplorerExpandInfo,
TaskServicesProvider, ListTasksParams, ListTasksResponse, CancelTaskParams, TaskProgressInfo, TaskInfo,
AdminServicesProvider, DisasterRecoveryProvider, RestoreInfo, ExecutionPlanOptions,
RestoreConfigInfo, SerializationProvider, FileBrowserProvider, FileBrowserOpenedParams, FileBrowserExpandedParams, FileBrowserValidatedParams
SerializationProvider, FileBrowserProvider, FileBrowserOpenedParams, FileBrowserExpandedParams, FileBrowserValidatedParams,
RestoreConfigInfo, ProfilerProvider, ProfilerSessionEvents
} from 'data';
import {
@@ -63,7 +64,9 @@ import {
DefaultDatabaseInfoResponse, DefaultDatabaseInfoParams,
GetDatabaseInfoResponse, GetDatabaseInfoParams,
BackupConfigInfoResponse, FileBrowserOpenParams, FileBrowserCloseResponse,
FileBrowserCloseParams, FileBrowserExpandParams, FileBrowserValidateParams
FileBrowserCloseParams, FileBrowserExpandParams, FileBrowserValidateParams,
StartProfilingParams, StartProfilingResponse, StopProfilingParams, StopProfilingResponse,
ProfilerEventsAvailableParams
} from 'dataprotocol-languageserver-types';
@@ -126,7 +129,8 @@ import {
RestoreRequest, RestorePlanRequest, CancelRestorePlanRequest, RestoreConfigInfoRequest,
ListTasksRequest, CancelTaskRequest, TaskStatusChangedNotification, TaskCreatedNotification,
LanguageFlavorChangedNotification, DidChangeLanguageFlavorParams, FileBrowserOpenRequest, FileBrowserOpenedNotification,
FileBrowserValidateRequest, FileBrowserValidatedNotification, FileBrowserExpandRequest, FileBrowserExpandedNotification, FileBrowserCloseRequest
FileBrowserValidateRequest, FileBrowserValidatedNotification, FileBrowserExpandRequest, FileBrowserExpandedNotification, FileBrowserCloseRequest,
StartProfilingRequest, StopProfilingRequest, ProfilerEventsAvailableNotification
} from './protocol';
import * as c2p from './codeConverter';
@@ -835,6 +839,7 @@ export class LanguageClient {
this.state = ClientState.StartFailed;
this._onReadyCallbacks.reject(error);
this.error('Starting client failed', error);
Window.showErrorMessage(`Couldn't start client ${this._name}`);
});
return new Disposable(() => {
if (this.needsStop()) {
@@ -2026,53 +2031,10 @@ export class LanguageClient {
let scriptingProvider: ScriptingProvider = {
scriptAsSelect(connectionUri: string, metadata: ObjectMetadata, paramDetails: ScriptingParamDetails): Thenable<ScriptingResult> {
return self.sendRequest(ScriptingRequest.type,
self._c2p.asScriptingParams(connectionUri, ScriptOperation.Select, metadata, paramDetails), undefined).then(
self._p2c.asScriptingResult,
(error) => {
self.logFailedRequest(ScriptingRequest.type, error);
return Promise.resolve(undefined);
}
);
},
scriptAsCreate(connectionUri: string, metadata: ObjectMetadata, paramDetails: ScriptingParamDetails): Thenable<ScriptingResult> {
scriptAsOperation(connectionUri: string, operation: ScriptOperation, metadata: ObjectMetadata, paramDetails: ScriptingParamDetails): Thenable<ScriptingResult> {
return self.sendRequest(ScriptingRequest.type,
self._c2p.asScriptingParams(connectionUri, ScriptOperation.Create, metadata, paramDetails), undefined).then(
self._p2c.asScriptingResult,
(error) => {
self.logFailedRequest(ScriptingRequest.type, error);
return Promise.resolve(undefined);
}
);
},
scriptAsInsert(connectionUri: string, metadata: ObjectMetadata, paramDetails: ScriptingParamDetails): Thenable<ScriptingResult> {
return self.sendRequest(ScriptingRequest.type,
self._c2p.asScriptingParams(connectionUri, ScriptOperation.Insert, metadata, paramDetails), undefined).then(
self._p2c.asScriptingResult,
(error) => {
self.logFailedRequest(ScriptingRequest.type, error);
return Promise.resolve(undefined);
}
);
},
scriptAsUpdate(connectionUri: string, metadata: ObjectMetadata, paramDetails: ScriptingParamDetails): Thenable<ScriptingResult> {
return self.sendRequest(ScriptingRequest.type,
self._c2p.asScriptingParams(connectionUri, ScriptOperation.Update, metadata, paramDetails), undefined).then(
self._p2c.asScriptingResult,
(error) => {
self.logFailedRequest(ScriptingRequest.type, error);
return Promise.resolve(undefined);
}
);
},
scriptAsDelete(connectionUri: string, metadata: ObjectMetadata, paramDetails: ScriptingParamDetails): Thenable<ScriptingResult> {
return self.sendRequest(ScriptingRequest.type,
self._c2p.asScriptingParams(connectionUri, ScriptOperation.Delete, metadata, paramDetails), undefined).then(
self._c2p.asScriptingParams(connectionUri, operation, metadata, paramDetails), undefined).then(
self._p2c.asScriptingResult,
(error) => {
self.logFailedRequest(ScriptingRequest.type, error);
@@ -2211,12 +2173,61 @@ export class LanguageClient {
}
};
let serializationProvider: SerializationProvider = {
handle: 0,
saveAs(saveFormat: string, savePath: string, results: string, appendToFile: boolean): Thenable<SaveResultRequestResult> {
throw new Error('NotImplemented');
let profilerProvider: ProfilerProvider = {
startSession(sessionId: string): Thenable<boolean> {
let params: StartProfilingParams = {
ownerUri: sessionId,
options: { }
};
return self.sendRequest(StartProfilingRequest.type, params, undefined).then(
(result) => {
return result;
},
(error) => {
self.logFailedRequest(StartProfilingRequest.type, error);
return Promise.reject(error);
}
);
},
stopSession(sessionId: string): Thenable<boolean> {
let params: StopProfilingParams = {
ownerUri: sessionId
};
return self.sendRequest(StopProfilingRequest.type, params, undefined).then(
(result) => {
return result;
},
(error) => {
self.logFailedRequest(StopProfilingRequest.type, error);
return Promise.reject(error);
}
);
},
pauseSession(sessionId: string): Thenable<boolean> {
return undefined;
},
connectSession(sessionId: string): Thenable<boolean> {
return undefined;
},
disconnectSession(sessionId: string): Thenable<boolean> {
return undefined;
},
registerOnSessionEventsAvailable(handler: (response: ProfilerSessionEvents) => any) {
self.onNotification(ProfilerEventsAvailableNotification.type, (params: ProfilerEventsAvailableParams) => {
handler(<ProfilerSessionEvents>{
sessionId: params.ownerUri,
events: params.events
});
});
}
}
};
this._providers.push(dataprotocol.registerProvider({
handle: -1,
@@ -2241,7 +2252,9 @@ export class LanguageClient {
taskServicesProvider: taskServicesProvider,
fileBrowserProvider: fileBrowserProvider
fileBrowserProvider: fileBrowserProvider,
profilerProvider: profilerProvider
}));
// Hook to the workspace-wide notifications that aren't routed to a specific provider

View File

@@ -34,7 +34,9 @@ import {
TaskInfo, ListTasksParams, ListTasksResponse, CancelTaskParams, TaskProgressInfo,
DefaultDatabaseInfoParams, DefaultDatabaseInfoResponse, BackupConfigInfoResponse, FileBrowserOpenParams, FileBrowserOpenedParams,
FileBrowserCloseParams, FileBrowserExpandParams, FileBrowserValidateParams,
FileBrowserCloseResponse, FileBrowserExpandedParams, FileBrowserValidatedParams
FileBrowserCloseResponse, FileBrowserExpandedParams, FileBrowserValidatedParams,
StartProfilingParams, StartProfilingResponse, StopProfilingParams, StopProfilingResponse,
ProfilerEventsAvailableParams
} from 'dataprotocol-languageserver-types';
@@ -1583,3 +1585,17 @@ export namespace FileBrowserValidatedNotification {
export namespace FileBrowserCloseRequest {
export const type: RequestType<FileBrowserCloseParams, FileBrowserCloseResponse, void> = { get method(): string { return 'filebrowser/close'; } };
}
// ------------------------------- < Profiler Events > ------------------------------------
export namespace StartProfilingRequest {
export const type: RequestType<StartProfilingParams, StartProfilingResponse, void> = { get method(): string { return 'profiler/start'; } };
}
export namespace StopProfilingRequest {
export const type: RequestType<StopProfilingParams, StopProfilingResponse, void> = { get method(): string { return 'profiler/stop'; } };
}
export namespace ProfilerEventsAvailableNotification {
export const type: NotificationType<ProfilerEventsAvailableParams> = { get method(): string { return 'profiler/eventsavailable'; } };
}

View File

@@ -1,27 +1,27 @@
THIRD-PARTY SOFTWARE NOTICES AND INFORMATION
For Microsoft vscode-languageclient
This project incorporates material from the project(s) listed below (collectively, “Third Party Code”).
Microsoft is not the original author of the Third Party Code. The original copyright notice and license
under which Microsoft received such Third Party Code are set out below. This Third Party Code is licensed
to you under their original license terms set forth below. Microsoft reserves all other rights not expressly
Microsoft is not the original author of the Third Party Code. The original copyright notice and license
under which Microsoft received such Third Party Code are set out below. This Third Party Code is licensed
to you under their original license terms set forth below. Microsoft reserves all other rights not expressly
granted, whether by implication, estoppel or otherwise.
1. DefinitelyTyped version 0.0.1 (https://github.com/borisyankov/DefinitelyTyped)
This project is licensed under the Source EULA license.
This project is licensed under the MIT license.
Copyrights are respective of each contributor listed at the beginning of each definition file.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE