upgrade service downloader (#20703)

* use new service downloader

* update other extensions

* fix errors
This commit is contained in:
Alan Ren
2022-10-02 20:30:53 -07:00
committed by GitHub
parent 85dc506a3c
commit 1df976d79d
19 changed files with 88 additions and 70 deletions

View File

@@ -3,12 +3,12 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { IConfig, Events } from '@microsoft/ads-service-downloader';
import { IConfig, Events, LogLevel } from '@microsoft/ads-service-downloader';
import { ServerOptions, TransportKind } from 'vscode-languageclient';
import * as Constants from './constants';
import * as vscode from 'vscode';
import * as path from 'path';
import { getCommonLaunchArgsAndCleanupOldLogFiles, getOrDownloadServer, getParallelMessageProcessingConfig } from './utils';
import { getCommonLaunchArgsAndCleanupOldLogFiles, getConfigTracingLevel, getOrDownloadServer, getParallelMessageProcessingConfig, TracingLevel } from './utils';
import { Telemetry, LanguageClientErrorHandler } from './telemetry';
import { SqlOpsDataClient, ClientOptions } from 'dataprotocol-client';
import { TelemetryFeature, AgentServicesFeature, SerializationFeature, AccountFeature, SqlAssessmentServicesFeature, ProfilerFeature, TableDesignerFeature, ExecutionPlanServiceFeature } from './features';
@@ -32,6 +32,16 @@ const localize = nls.loadMessageBundle();
const outputChannel = vscode.window.createOutputChannel(Constants.serviceName);
const statusView = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Left);
// The mapping between MSSQL log level and the service downloader log level.
const LogLevelMapping: { [key: string]: number } = {
[TracingLevel.All]: LogLevel.Verbose,
[TracingLevel.Critical]: LogLevel.Critical,
[TracingLevel.Error]: LogLevel.Error,
[TracingLevel.Information]: LogLevel.Information,
[TracingLevel.Verbose]: LogLevel.Verbose,
[TracingLevel.Warning]: LogLevel.Warning
};
export class SqlToolsServer {
private client: SqlOpsDataClient;
@@ -145,6 +155,14 @@ function handleServerProviderEvent(e: string, ...args: any[]): void {
case Events.ENTRY_EXTRACTED:
outputChannel.appendLine(localize('entryExtractedChannelMsg', "Extracted {0} ({1}/{2})", args[0], args[1], args[2]));
break;
case Events.LOG_EMITTED:
const configuredLevel: number | undefined = LogLevelMapping[getConfigTracingLevel()];
const logLevel = args[0] as LogLevel;
const message = args[1] as string;
if (configuredLevel !== undefined && logLevel >= configuredLevel) {
outputChannel.appendLine(message);
}
break;
}
}