Skip to content

Commit

Permalink
Use client ID as fallback for diagnostics collection (#1445)
Browse files Browse the repository at this point in the history
* Use client ID as fallback for diagnostics collection

This sets the language client ID as a fallback for the diagnostics
collection name. If no collection name is provided, VSCode generates
one. This name is visible in the diagnostics table view of the problems
panel.

* Use nullish coalescing to fallback to the id

This means the name can be set to an empty string.

---------

Co-authored-by: Dirk Bäumer <dirkb@microsoft.com>
  • Loading branch information
remcohaszing and dbaeumer authored Jun 28, 2024
1 parent 33cbe5c commit 6d2a392
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions client/src/common/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1073,9 +1073,7 @@ export abstract class BaseLanguageClient implements FeatureClient<Middleware, La

// If we restart then the diagnostics collection is reused.
if (this._diagnostics === undefined) {
this._diagnostics = this._clientOptions.diagnosticCollectionName
? Languages.createDiagnosticCollection(this._clientOptions.diagnosticCollectionName)
: Languages.createDiagnosticCollection();
this._diagnostics = Languages.createDiagnosticCollection(this._clientOptions.diagnosticCollectionName ?? this._id);
}

// When we start make all buffer handlers pending so that they
Expand Down

0 comments on commit 6d2a392

Please sign in to comment.