Skip to content

Commit e15ddf3

Browse files
committed
Working binder
Signed-off-by: worksofliam <mrliamallan@live.co.uk>
1 parent d334256 commit e15ddf3

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

src/language/providers/problemProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ function getStatementRangeFromGroup(currentGroup: StatementGroup, groupId: numbe
287287

288288
const label = firstStatement.getLabel();
289289
if (label) {
290-
if (label.toUpperCase() === `CL`) {
290+
if ([`CL`, `BIND`].includes(label.toUpperCase())) {
291291
statementRange.validate = false;
292292
} else {
293293
statementRange.start = firstStatement.tokens[2].range.start;

src/language/sql/statement.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export default class Statement {
3030
first = this.tokens[2];
3131
}
3232

33-
const wordValue = first.value?.toUpperCase();
33+
const wordValue = first?.value?.toUpperCase();
3434

3535
this.type = StatementTypeWord[wordValue] || StatementType.Unknown;
3636

src/views/results/binding.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export function getLiteralsFromStatement(group: StatementGroup): SqlParameter[]
3030
for (const statement of group.statements) {
3131
for (const token of statement.tokens) {
3232
if (token.type === `string`) {
33-
literals.push(token.value);
33+
literals.push(token.value.substring(1, token.value.length - 1)); // Remove quotes
3434
}
3535
}
3636
}

src/views/results/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ export function parseStatement(editor?: vscode.TextEditor, existingInfo?: Statem
577577
}
578578

579579
if (statementInfo.content) {
580-
[`cl`, `json`, `csv`, `sql`, `explain`, `update`, `rpg`].forEach(mode => {
580+
[`cl`, `json`, `csv`, `sql`, `explain`, `update`, `rpg`, `bind`].forEach(mode => {
581581
if (statementInfo.content.trim().toLowerCase().startsWith(mode + `:`)) {
582582
statementInfo.content = statementInfo.content.substring(mode.length + 1).trim();
583583

0 commit comments

Comments
 (0)