Skip to content

Commit 5a7f699

Browse files
committed
Mention naming usage in status
Signed-off-by: worksofliam <[email protected]>
1 parent 802fd32 commit 5a7f699

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

src/language/providers/completionProvider.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,10 @@ import { CTEReference, ClauseType, ObjectRef, StatementType } from "../sql/types
1010
import { CallableType } from "../../database/callable";
1111
import { prepareParamType, createCompletionItem, getParmAttributes } from "./logic/completion";
1212
import { isCallableType, getCallableParameters } from "./logic/callable";
13-
import { localAssistIsEnabled, remoteAssistIsEnabled } from "./logic/available";
13+
import { localAssistIsEnabled, remoteAssistIsEnabled, useSystemNames } from "./logic/available";
1414
import { DbCache } from "./logic/cache";
1515
import { getSqlDocument } from "./logic/parse";
1616
import { TableColumn, BasicSQLObject } from "../../types";
17-
import Configuration from "../../configuration";
18-
19-
function useSystemNames() {
20-
return Configuration.get<boolean>(`syntax.useSystemNames`) || false;
21-
}
2217

2318
export interface CompletionType {
2419
order: string;

src/language/providers/logic/available.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ import { env } from "process";
33
import { ServerComponent } from "../../../connection/serverComponent";
44
import { JobManager } from "../../../config";
55
import { JobInfo } from "../../../connection/manager";
6+
import Configuration from "../../../configuration";
7+
8+
export function useSystemNames() {
9+
return Configuration.get<boolean>(`syntax.useSystemNames`) || false;
10+
}
611

712
export function localAssistIsEnabled() {
813
return (env.DB2I_DISABLE_CA !== `true`);

src/language/providers/statusProvider.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Disposable, languages, LanguageStatusSeverity } from "vscode";
22
import { SQLStatementChecker } from "../../connection/syntaxChecker";
33
import { getCheckerTimeout } from "./problemProvider";
4+
import { useSystemNames } from "./logic/available";
45

56
export class Db2StatusProvider extends Disposable {
67
private item = languages.createLanguageStatusItem(`sql`, {language: `sql`});
@@ -16,7 +17,12 @@ export class Db2StatusProvider extends Disposable {
1617
const checker = SQLStatementChecker.get();
1718
const checkerTimeout = getCheckerTimeout() / 1000;
1819
this.item.text = `SQL assistance available. ${checker ? `Syntax checking enabled (every ${checkerTimeout}s after editing)` : `Syntax checking not available.`}`;
19-
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.`}`;
20+
this.item.detail = `You're connected to an IBM i. ${checker ? `You can use the advanced SQL language tooling.` : `Syntax checking not available. This means that the syntax checker did not install when connecting to this system.`}`;
21+
this.item.detail = [
22+
`You're connected to an IBM i.`,
23+
checker ? `You can use the advanced SQL language tooling.` : `Syntax checking not available. This means that the syntax checker did not install when connecting to this system.`,
24+
(useSystemNames() ? `System names` : `SQL names`) + ` for columns will be used in the content assist.`
25+
].join(` `);
2026
this.item.severity = checker ? LanguageStatusSeverity.Information : LanguageStatusSeverity.Warning;
2127
} else {
2228
this.item.text = `Basic SQL assistance available`;

0 commit comments

Comments
 (0)