Skip to content
This repository has been archived by the owner on May 7, 2020. It is now read-only.

Commit

Permalink
add suggestion diagnostics to ts/js
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesbirtles committed May 5, 2019
1 parent 9b66ae6 commit 651e7fd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,13 @@ Currently Supported:
- Color highlighting and color picker
- Symbols in Outline panel
- TypeScript / JavaScript (via TypeScript)
- Diagnostics messages for syntax and semantic errors
- Diagnostics messages for syntax errors, semantic errors, and suggestions
- Hover info
- Formatting (via [prettier](https://github.com/prettier/prettier))
- Symbols in Outline panel
- Autocompletions
- Go to definition
- Code Actions

## How can I use it?

Expand Down
5 changes: 4 additions & 1 deletion src/plugins/TypeScriptPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,10 @@ export class TypeScriptPlugin
const isTypescript =
getScriptKindFromAttributes(document.getAttributes()) === ts.ScriptKind.TS;

let diagnostics: ts.Diagnostic[] = lang.getSyntacticDiagnostics(document.getFilePath()!);
let diagnostics: ts.Diagnostic[] = [
...lang.getSyntacticDiagnostics(document.getFilePath()!),
...lang.getSuggestionDiagnostics(document.getFilePath()!),
];

if (isTypescript) {
diagnostics.push(...lang.getSemanticDiagnostics(document.getFilePath()!));
Expand Down

0 comments on commit 651e7fd

Please sign in to comment.