提交 ab50c4dc 编写于 作者: D Dirk Baeumer

Add support for build status

上级 a4aeaa1d
......@@ -1009,6 +1009,11 @@ export interface DiagnosticEventBody {
* An array of diagnostic information items.
*/
diagnostics: Diagnostic[];
/**
* Information about the current length of the build queue.
*/
queueLength?: number;
}
/**
......
......@@ -19,6 +19,9 @@ nls.config({locale: env.language});
import * as path from 'path';
import * as Proto from './protocol';
import * as Is from './utils/is';
import TypeScriptServiceClient from './typescriptServiceClient';
import { ITypescriptServiceClientHost } from './typescriptService';
......@@ -36,6 +39,7 @@ import WorkspaceSymbolProvider from './features/workspaceSymbolProvider';
import * as VersionStatus from './utils/versionStatus';
import * as ProjectStatus from './utils/projectStatus';
import * as BuildStatus from './utils/buildStatus';
interface LanguageDescription {
id: string;
......@@ -83,6 +87,7 @@ export function activate(context: ExtensionContext): void {
}, () => {
// Nothing to do here. The client did show a message;
});
BuildStatus.update({ queueLength: 0 });
}
const validateSetting = 'validate.enable';
......@@ -362,6 +367,9 @@ class TypeScriptServiceClientHost implements ITypescriptServiceClientHost {
language.semanticDiagnosticsReceived(body.file, this.createMarkerDatas(body.diagnostics, language.diagnosticSource));
}
}
if (Is.defined(body.queueLength)) {
BuildStatus.update( { queueLength: body.queueLength });
}
}
private createMarkerDatas(diagnostics: Proto.Diagnostic[], source: string): Diagnostic[] {
......
......@@ -241,6 +241,12 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient
}
private serviceStarted(resendModels: boolean): void {
if (this.storagePath) {
try {
fs.mkdirSync(this.storagePath);
} catch(error) {
}
}
this.execute('configure', {
autoBuild: this.storagePath ? true : false,
metaDataDirectory: this.storagePath
......
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import vscode = require('vscode');
const statusItem: vscode.StatusBarItem = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Left, Number.MIN_VALUE);
export interface BuildInfo {
queueLength: number;
}
export function update(info: BuildInfo): void {
if (info.queueLength === 0) {
statusItem.hide();
return;
}
statusItem.text = info.queueLength.toString();
statusItem.show();
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册