Skip to content

Commit

Permalink
Resolves: #78: Diagnostics for build output messages of all severity …
Browse files Browse the repository at this point in the history
…types
  • Loading branch information
urvapatel authored Jun 18, 2020
1 parent 28bfbcc commit 8da60f7
Show file tree
Hide file tree
Showing 8 changed files with 84 additions and 16 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Update default save file location to user's home directory ([#69](https://github.com/IBMStreams/vscode-ide/issues/69))
- Warn user when building a file with unsaved changes ([#70](https://github.com/IBMStreams/vscode-ide/issues/70))
- Allow user to start an IBM Streaming Analytics service if stopped ([#72](https://github.com/IBMStreams/vscode-ide/issues/72))
- Diagnostics for build output messages of all severity types ([#78](https://github.com/IBMStreams/vscode-ide/issues/78))
- Keyboard shortcuts for build commands ([#79](https://github.com/IBMStreams/vscode-ide/issues/79))
- Better support for job configuration overlay files when configuring job submissions ([#81](https://github.com/IBMStreams/vscode-ide/issues/81))
- Changelog file to document changes between releases ([#87](https://github.com/IBMStreams/vscode-ide/issues/87))
Expand Down
19 changes: 11 additions & 8 deletions images/markers/error-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 11 additions & 8 deletions images/markers/error-light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions images/markers/information-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions images/markers/information-light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions images/markers/warning-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions images/markers/warning-light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions src/utils/diagnostics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ export default class Diagnostics {
private static diagnosticCollection: DiagnosticCollection;
private static activeEditor: TextEditor;
private static errorDecorationType: TextEditorDecorationType;
private static warningDecorationType: TextEditorDecorationType;
private static informationDecorationType: TextEditorDecorationType;

/**
* Perform initial configuration
Expand Down Expand Up @@ -80,6 +82,9 @@ export default class Diagnostics {
dark: { gutterIconPath: iconPathDark }
});
this.errorDecorationType = createDecoration(context.asAbsolutePath('images/markers/error-light.svg'), context.asAbsolutePath('images/markers/error-dark.svg'));
this.warningDecorationType = createDecoration(context.asAbsolutePath('images/markers/warning-light.svg'), context.asAbsolutePath('images/markers/warning-dark.svg'));
this.informationDecorationType = createDecoration(context.asAbsolutePath('images/markers/information-light.svg'), context.asAbsolutePath('images/markers/information-dark.svg'));


const isSplFile = (): boolean => this.activeEditor && this.activeEditor.document.languageId === LANGUAGE_SPL;

Expand Down Expand Up @@ -130,5 +135,7 @@ export default class Diagnostics {
.map((diagnostic: Diagnostic) => diagnostic.range);

this.activeEditor.setDecorations(this.errorDecorationType, getDiagnosticRanges(DiagnosticSeverity.Error));
this.activeEditor.setDecorations(this.warningDecorationType, getDiagnosticRanges(DiagnosticSeverity.Warning));
this.activeEditor.setDecorations(this.informationDecorationType, getDiagnosticRanges(DiagnosticSeverity.Information));
}
}

0 comments on commit 8da60f7

Please sign in to comment.