Skip to content

refactor: use new parser for autocompletion#536

Open
emrberk wants to merge 27 commits intomainfrom
refactor/new-parser
Open

refactor: use new parser for autocompletion#536
emrberk wants to merge 27 commits intomainfrom
refactor/new-parser

Conversation

@emrberk
Copy link
Collaborator

@emrberk emrberk commented Feb 13, 2026

No description provided.

@emrberk emrberk marked this pull request as ready for review February 24, 2026 18:27
@emrberk emrberk changed the title refactor: use new parser for autocompletion and query detection refactor: use new parser for autocompletion Feb 24, 2026
Copy link

@RaphDal RaphDal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great PR!

Comment on lines +111 to +131
function isCursorInComment(text: string, cursorOffset: number): boolean {
let i = 0
const end = Math.min(cursorOffset, text.length)
while (i < end) {
const ch = text[i]
const next = text[i + 1]
// Line comment: -- until end of line
if (ch === "-" && next === "-") {
i += 2
while (i < end && text[i] !== "\n") i++
if (i >= cursorOffset) return true
continue
}
// Block comment: /* until */
if (ch === "/" && next === "*") {
i += 2
while (i < text.length && !(text[i] === "*" && text[i + 1] === "/")) i++
if (i >= cursorOffset) return true
i += 2 // skip */
continue
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Double-quoted identifiers like "my--table" or "data/set/" causes false comment detection.
Example: SELECT AdvEngineID FROM "hits--table";

if (validationTimeoutRef.current) {
window.clearTimeout(validationTimeoutRef.current)
}

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't the unmount calls clearValidationMarkers to abort in-flight network requests?

}

export const createSchemaCompletionProvider = (
editor: editor.IStandaloneCodeEditor,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The editor parameter is not used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants