diff --git a/src/vs/workbench/api/node/extHostDiagnostics.ts b/src/vs/workbench/api/node/extHostDiagnostics.ts index 791de4d587d..e88ae6266c9 100644 --- a/src/vs/workbench/api/node/extHostDiagnostics.ts +++ b/src/vs/workbench/api/node/extHostDiagnostics.ts @@ -8,9 +8,9 @@ import { IMarkerData, MarkerSeverity } from 'vs/platform/markers/common/markers' import { URI } from 'vs/base/common/uri'; import * as vscode from 'vscode'; import { MainContext, MainThreadDiagnosticsShape, ExtHostDiagnosticsShape, IMainContext } from './extHost.protocol'; -import { DiagnosticSeverity, Diagnostic } from './extHostTypes'; +import { DiagnosticSeverity } from './extHostTypes'; import * as converter from './extHostTypeConverters'; -import { mergeSort, equals } from 'vs/base/common/arrays'; +import { mergeSort } from 'vs/base/common/arrays'; import { Event, Emitter } from 'vs/base/common/event'; import { keys } from 'vs/base/common/map'; @@ -61,13 +61,9 @@ export class DiagnosticCollection implements vscode.DiagnosticCollection { this._checkDisposed(); let toSync: vscode.Uri[] = []; - let hasChanged = true; if (first instanceof URI) { - // check if this has actually changed - hasChanged = hasChanged && !equals(diagnostics, this.get(first), Diagnostic.isEqual); - if (!diagnostics) { // remove this entry this.delete(first); @@ -109,14 +105,6 @@ export class DiagnosticCollection implements vscode.DiagnosticCollection { // send event for extensions this._onDidChangeDiagnostics.fire(toSync); - // if nothing has changed then there is nothing else to do - // we have updated the diagnostics but we don't send a message - // to the renderer. tho we have still send an event for other - // extensions because the diagnostic might carry more information - // than known to us - if (!hasChanged) { - return; - } // compute change and send to main side const entries: [URI, IMarkerData[]][] = []; for (let uri of toSync) { diff --git a/src/vs/workbench/test/electron-browser/api/extHostDiagnostics.test.ts b/src/vs/workbench/test/electron-browser/api/extHostDiagnostics.test.ts index de772e5d024..02419a4d34e 100644 --- a/src/vs/workbench/test/electron-browser/api/extHostDiagnostics.test.ts +++ b/src/vs/workbench/test/electron-browser/api/extHostDiagnostics.test.ts @@ -188,7 +188,7 @@ suite('ExtHostDiagnostics', () => { lastEntries = undefined!; }); - test('don\'t send message when not making a change', function () { + test('do send message when not making a change', function () { let changeCount = 0; let eventCount = 0; @@ -209,7 +209,7 @@ suite('ExtHostDiagnostics', () => { assert.equal(eventCount, 1); collection.set(uri, [diag]); - assert.equal(changeCount, 1); + assert.equal(changeCount, 2); assert.equal(eventCount, 2); }); @@ -418,10 +418,10 @@ suite('ExtHostDiagnostics', () => { assert.equal(callCount, 1); collection.set(URI.parse('test:me'), array); - assert.equal(callCount, 1); // equal array + assert.equal(callCount, 2); // equal array array.push(diag2); collection.set(URI.parse('test:me'), array); - assert.equal(callCount, 2); // same but un-equal array + assert.equal(callCount, 3); // same but un-equal array }); });