-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: worksofliam <[email protected]>
- Loading branch information
1 parent
34d59d8
commit 79ffbc0
Showing
5 changed files
with
36 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { Disposable, languages, LanguageStatusSeverity } from "vscode"; | ||
import { SQLStatementChecker } from "../../connection/syntaxChecker"; | ||
import { getCheckerTimeout } from "./problemProvider"; | ||
|
||
export class Db2StatusProvider extends Disposable { | ||
private item = languages.createLanguageStatusItem(`sql`, {language: `sql`}); | ||
constructor() { | ||
super(() => this.item.dispose()); | ||
|
||
this.item.name = `SQL Language Status`; | ||
this.setState(false); | ||
} | ||
|
||
setState(hasJob: Boolean) { | ||
if (hasJob) { | ||
const checker = SQLStatementChecker.get(); | ||
const checkerTimeout = getCheckerTimeout() / 1000; | ||
this.item.text = `SQL assistance available. ${checker ? `Syntax checking enabled (every ${checkerTimeout}s after editing)` : `Syntax checking not available.`}`; | ||
this.item.detail = `You're connected to an IBM i - you can use the advanced SQL language tooling. ${checker ? `` : `Syntax checking not available. This means that the syntax checker did not install when connecting to this system.`}`; | ||
this.item.severity = checker ? LanguageStatusSeverity.Information : LanguageStatusSeverity.Warning; | ||
} else { | ||
this.item.text = `Basic SQL assistance available`; | ||
this.item.detail = `Connect to an IBM i to enable advanced SQL language tooling.`; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters