mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
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:
@@ -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
|
||||
|
||||
@@ -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'; } };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user