hover #5

Closed
opened 2025-08-09 22:59:12 +01:00 by apb · 0 comments
Owner
const range = document.getWordRangeAtPosition(position);
        if (!range) return null
        const word = document.getText(range);
        const linter = xqLinters.xqlint(document.uri);
        const what = inspectAst(linter, position);
        if (what.type === 'WS') return null;

        const hovers: vscode.MarkdownString[]=[
            what.display?markdownString("**"+what.display+"**"):null,
            markdownString(what.get?.description)
        ];

        if (Configuration.xqueryShowHovers) {
            const parsePath = markdownString(
                '<a href="https://quodatum.github.io/basex-xqparse/i-BaseX.xhtml#' + what.path[0] + '">Path:<a>');
            parsePath.appendText(what.path.join("/"));
            const debugInfo=`[${position.line},${position.character}] Word: ${word},
            value: ${what.value}, type: ${what?.type}`;
            hovers.push(markdownString(debugInfo));
            hovers.push( parsePath);
        }
        return new vscode.Hover(hovers);
``` const range = document.getWordRangeAtPosition(position); if (!range) return null const word = document.getText(range); const linter = xqLinters.xqlint(document.uri); const what = inspectAst(linter, position); if (what.type === 'WS') return null; const hovers: vscode.MarkdownString[]=[ what.display?markdownString("**"+what.display+"**"):null, markdownString(what.get?.description) ]; if (Configuration.xqueryShowHovers) { const parsePath = markdownString( '<a href="https://quodatum.github.io/basex-xqparse/i-BaseX.xhtml#' + what.path[0] + '">Path:<a>'); parsePath.appendText(what.path.join("/")); const debugInfo=`[${position.line},${position.character}] Word: ${word}, value: ${what.value}, type: ${what?.type}`; hovers.push(markdownString(debugInfo)); hovers.push( parsePath); } return new vscode.Hover(hovers); ```
apb closed this issue 2025-08-25 11:27:11 +01:00
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: quodatum/basex-lsp#5
No description provided.