Skip to content

Commit

Permalink
Add the missing Diagnostic props to BSDebugDiagnostic (#203)
Browse files Browse the repository at this point in the history
* Add the missing diagnostic props to our internal diagnostic interface

* Remove the 'vscode' import
  • Loading branch information
TwitchBronBron authored Dec 2, 2024
1 parent f5aada7 commit 41e5157
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 9 deletions.
7 changes: 0 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@
"@types/request": "^2.48.8",
"@types/semver": "^7.3.9",
"@types/sinon": "^10.0.6",
"@types/vscode": "^1.61.0",
"@typescript-eslint/eslint-plugin": "^5.27.0",
"@typescript-eslint/parser": "^5.27.0",
"@types/yargs": "^15.0.5",
Expand Down
45 changes: 44 additions & 1 deletion src/CompileErrorProcessor.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { EventEmitter } from 'events';
import { logger } from './logging';
import type { Range } from 'brighterscript';
import type { DiagnosticTag, Range } from 'brighterscript';
import { DiagnosticSeverity, util as bscUtil } from 'brighterscript';

export class CompileErrorProcessor {
Expand Down Expand Up @@ -372,6 +372,18 @@ export interface BSDebugDiagnostic {
* The diagnostic's code, which usually appear in the user interface.
*/
code?: number | string;
/**
* An optional property to describe the error code.
* Requires the code field (above) to be present/not null.
*
* @since 3.16.0
*/
codeDescription?: {
/**
* An URI to open with more information about the diagnostic error.
*/
href: string;
};
/**
* A human-readable string describing the source of this
* diagnostic, e.g. 'typescript' or 'super lint'. It usually
Expand All @@ -393,6 +405,37 @@ export interface BSDebugDiagnostic {
* client to interpret diagnostics as error, warning, info or hint.
*/
severity?: DiagnosticSeverity;

/**
* Additional metadata about the diagnostic.
*
* @since 3.15.0
*/
tags?: DiagnosticTag[];
/**
* An array of related diagnostic information, e.g. when symbol-names within
* a scope collide all definitions can be marked via this property.
*/
relatedInformation?: Array<{
/**
* The location of this related diagnostic information.
*/
location: {
uri: string;
range: Range;
};
/**
* The message of this related diagnostic information.
*/
message: string;
}>;
/**
* A data entry field that is preserved between a `textDocument/publishDiagnostics`
* notification and `textDocument/codeAction` request.
*
* @since 3.16.0
*/
data?: any;
}

export enum CompileStatus {
Expand Down

0 comments on commit 41e5157

Please sign in to comment.