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,13 +0,0 @@
language: node_js
sudo: false
node_js:
- "0.12"
install:
- cd jsonrpc && npm install && cd ../client && mkdir node_modules && cd node_modules && ln -s ../../jsonrpc vscode-jsonrpc && cd .. && npm install && cd ../server && mkdir node_modules && cd node_modules && ln -s ../../jsonrpc vscode-jsonrpc && cd .. && npm install && cd ..
- cd types && npm install && cd ../client && cd node_modules && ln -s ../../types vscode-languageserver-types && cd .. && npm install && cd ../server && cd node_modules && ln -s ../../types vscode-languageserver-types && cd .. && npm install && cd ..
script:
- cd jsonrpc && npm run compile && cd ../types && npm run compile && cd ../client && npm run compile && cd ../server && npm run compile && cd ..
- cd jsonrpc && npm test && cd ../types && npm test && cd ..

View File

@@ -0,0 +1,18 @@
Copyright (c) Microsoft Corporation
All rights reserved.
Source EULA
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 AUTHORS OR COPYRIGHT HOLDERS
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT
OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

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

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

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

@@ -467,7 +467,7 @@ function createMessageConnection<T extends MessageConnection>(messageReader: Mes
eventHandlers[type.method] = handler;
},
sendRequest: <P, R, E>(type: RequestType<P, R, E>, params: P, token?: CancellationToken): any => {
sendRequest: <P, R, E>(type: RequestType<P, R, E>, params: P, token?: CancellationToken) => {
throwIfClosedOrDisposed();
let id = sequenceNumber++;

View File

@@ -108,7 +108,7 @@ export class IPCMessageWriter extends AbstractMessageWriter implements MessageWr
public write(msg: Message): void {
try {
(<any>this.process).send(<any>msg);
(this.process.send as Function)(msg);
this.errorCount = 0;
} catch (error) {
this.errorCount++;

View File

@@ -9,7 +9,7 @@ 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.
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

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

@@ -480,8 +480,8 @@ export interface RestoreDatabaseFileInfo {
}
export interface FileBrowserOpenParams {
ownerUri: string;
expandPath: string;
ownerUri: string;
expandPath: string;
fileFilters: string[];
changeFilter: boolean;
}
@@ -507,8 +507,8 @@ export interface FileBrowserOpenedParams {
}
export interface FileBrowserExpandParams {
ownerUri: string;
expandPath: string;
ownerUri: string;
expandPath: string;
}
export interface FileBrowserExpandedParams {
@@ -520,9 +520,9 @@ export interface FileBrowserExpandedParams {
}
export interface FileBrowserValidateParams {
ownerUri: string;
serviceType: string;
selectedFiles: string[];
ownerUri: string;
serviceType: string;
selectedFiles: string[];
}
export interface FileBrowserValidatedParams {
@@ -531,7 +531,7 @@ export interface FileBrowserValidatedParams {
}
export interface FileBrowserCloseParams {
ownerUri: string;
ownerUri: string;
}
export interface FileBrowserCloseResponse {
@@ -721,7 +721,9 @@ export enum ScriptOperation {
Create = 1,
Insert = 2,
Update = 3,
Delete = 4
Delete = 4,
Execute = 5,
Alter = 6
}
export interface ScriptOptions {
@@ -1079,6 +1081,77 @@ export class TableMetadata {
}
/**
* Parameters to start a profiler session
*/
export interface StartProfilingParams {
/**
* Session Owner URI
*/
ownerUri: string;
/**
* Session options
*/
options: {};
}
export interface StartProfilingResponse {
succeeded: string;
errorMessage: string;
}
/**
* Parameters to start a profiler session
*/
export interface StopProfilingParams {
/**
* Session Owner URI
*/
ownerUri: string;
}
export interface StopProfilingResponse {
succeeded: string;
errorMessage: string;
}
/**
* Profiler Event
*/
export interface ProfilerEvent {
/**
* Event class name
*/
name: string;
/**
* Event timestamp
*/
timestamp: string;
/**
* Event values
*/
values: {};
}
/**
* Profiler events available notification parameters
*/
export interface ProfilerEventsAvailableParams
{
/**
* Session owner URI
*/
ownerUri: string;
/**
* New profiler events available
*/
events: ProfilerEvent[];
}
/**
* Position in a text document expressed as zero-based line and character offset.
*/