diff --git a/src/vs/vscode.d.ts b/src/vs/vscode.d.ts index 8142906c5ec527ec02ea99070176a6db42138b46..92b14c0281bc11fbe19a3805b568047fc48db47a 100644 --- a/src/vs/vscode.d.ts +++ b/src/vs/vscode.d.ts @@ -3680,6 +3680,17 @@ declare module 'vscode' { constructor(uri: Uri, rangeOrPosition: Range | Position); } + /** + * The event that is fired when diagnostics change. + */ + export interface DiagnosticChangeEvent { + + /** + * An array of resources for which diagnostics have changed. + */ + readonly uris: Uri[]; + } + /** * Represents the severity of diagnostics. */ @@ -6044,6 +6055,29 @@ declare module 'vscode' { */ export function match(selector: DocumentSelector, document: TextDocument): number; + /** + * An [event](#Event) which fires when the global set of diagnostics changes. This is + * newly added and removed diagnostics. + */ + export const onDidChangeDiagnostics: Event; + + /** + * Get all diagnostics for a given resource. *Note* that this includes diagnostics from + * all extensions but *not yet* from the task framework. + * + * @param resource A resource + * @returns An arrary of [diagnostics](#Diagnostic) objects or an empty array. + */ + export function getDiagnostics(resource: Uri): Diagnostic[]; + + /** + * Get all diagnostics. *Note* that this includes diagnostics from + * all extensions but *not yet* from the task framework. + * + * @returns An array of uri-diagnostics tuples or an empty array. + */ + export function getDiagnostics(): [Uri, Diagnostic[]][]; + /** * Create a diagnostics collection. * diff --git a/src/vs/vscode.proposed.d.ts b/src/vs/vscode.proposed.d.ts index f61737f591950f1a70f8a44a74462d021bf7dfdc..8704ce7f6f876ef219bb5f41b26b8a1e8e9e59ff 100644 --- a/src/vs/vscode.proposed.d.ts +++ b/src/vs/vscode.proposed.d.ts @@ -11,32 +11,6 @@ declare module 'vscode' { export function sampleFunction(): Thenable; } - //#region Joh: readable diagnostics - - export interface DiagnosticChangeEvent { - uris: Uri[]; - } - - export namespace languages { - - /** - * - */ - export const onDidChangeDiagnostics: Event; - - /** - * - */ - export function getDiagnostics(resource: Uri): Diagnostic[]; - - /** - * - */ - export function getDiagnostics(): [Uri, Diagnostic[]][]; - } - - //#endregion - //#region Aeschli: folding export class FoldingRangeList { diff --git a/src/vs/workbench/api/node/extHost.api.impl.ts b/src/vs/workbench/api/node/extHost.api.impl.ts index 6757325af7650ce2cf9a7704a02ad90b42f5c990..bd3e382a66ff27a200e3cae10e2975aab22566ae 100644 --- a/src/vs/workbench/api/node/extHost.api.impl.ts +++ b/src/vs/workbench/api/node/extHost.api.impl.ts @@ -237,9 +237,9 @@ export function createApiFactory( checkProposedApiEnabled(extension); return extHostDiagnostics.onDidChangeDiagnostics; }, - getDiagnostics: proposedApiFunction(extension, (resource?) => { - return extHostDiagnostics.getDiagnostics(resource); - }), + getDiagnostics: (resource?) => { + return extHostDiagnostics.getDiagnostics(resource); + }, getLanguages(): TPromise { return extHostLanguages.getLanguages(); }, diff --git a/src/vs/workbench/api/node/extHostDiagnostics.ts b/src/vs/workbench/api/node/extHostDiagnostics.ts index 342060762d7f0d67e52bcb55b446be99b9dd6fd8..60f96a01f2ecfa1402882d1d9f65cf27adba9073 100644 --- a/src/vs/workbench/api/node/extHostDiagnostics.ts +++ b/src/vs/workbench/api/node/extHostDiagnostics.ts @@ -229,6 +229,7 @@ export class ExtHostDiagnostics implements ExtHostDiagnosticsShape { } } } + Object.freeze(uris); return { uris }; }