Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/autocomplete/content-assist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -738,8 +738,7 @@ function computeSuggestions(tokens: IToken[]): ComputeResult {
const filteredExtra = extra.filter(
(s) => !isImplicitStatementPath(s.ruleStack, IMPLICIT_RULES),
)
const extraEffective =
filteredExtra.length > 0 ? filteredExtra : extra
const extraEffective = filteredExtra.length > 0 ? filteredExtra : extra
const seen = new Set(result.map((t) => t.name))
for (const s of extraEffective) {
if (!seen.has(s.nextTokenType.name)) {
Expand Down
7 changes: 2 additions & 5 deletions src/parser/visitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3783,17 +3783,14 @@ class QuestDBVisitor extends BaseVisitor {
return this.visit(ctx.qualifiedName) as AST.QualifiedName
}

tableNameOrString(
ctx: TableNameOrStringCstChildren,
): AST.QualifiedName {
tableNameOrString(ctx: TableNameOrStringCstChildren): AST.QualifiedName {
if (ctx.StringLiteral) {
return {
type: "qualifiedName",
parts: [ctx.StringLiteral[0].image.slice(1, -1)],
}
}
if (ctx.tableName)
return this.visit(ctx.tableName) as AST.QualifiedName
if (ctx.tableName) return this.visit(ctx.tableName) as AST.QualifiedName
return { type: "qualifiedName", parts: [] }
}

Expand Down
2 changes: 1 addition & 1 deletion tests/docs-autocomplete.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ function autocompleteWalkthrough(
.getSuggestions(prefix, prefix.length)
.map((s) => s.label)

let found = false
let found: boolean
let expectedLabel: string

if (tokenType === "Identifier" || tokenType === "QuotedIdentifier") {
Expand Down