diff --git a/CHANGELOG.md b/CHANGELOG.md index e7b6d16..ca0e087 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,5 @@ # 0.1.0 (2023-02-19) -Update xqlint 0.2.0 +Update xqlint to 0.2.0 # 0.0.64 (2023-01-26) * add simple hover display diff --git a/README.md b/README.md index b4f40c2..8f3157f 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ For XQuery * [XQuery Linting](https://git.quodatum.duckdns.org/apb/vscode-basex/wiki/xquery-linting) * [XQuery Code Completion](https://git.quodatum.duckdns.org/apb/vscode-basex/wiki/xquery-code-completion) * [XQuery Execution](https://git.quodatum.duckdns.org/apb/vscode-basex/wiki/xquery-script-execution) +* [XQuery source formating](https://git.quodatum.duckdns.org/apb/vscode-basex/wiki/xquery-source-formating) * [XML Formatting](https://git.quodatum.duckdns.org/apb/vscode-basex/wiki/xml-formatting) * [XML Tree View](https://git.quodatum.duckdns.org/apb/vscode-basex/wiki/xml-tree-view) @@ -39,11 +40,16 @@ npm install --global vsce npm run compile vsce package ``` + +## Inspiration + +This project was created from a fork of [DotJoshJohnson/vscode-xml](https://github.com/DotJoshJohnson/vscode-xml). Much of `DotJoshJohnson/vscode-xml` code dealing with XML has been removed and additional XQuery features added. + +The code parsing uses [quodatum/xqlint] which is based on [wcandillon/xqlint] + ## Icon Credits Icons used in the XML Tree View are used under the Creative Commons 3.0 BY license. * "Code" icon by Dave Gandy from www.flaticon.com * "At" icon by FreePik from www.flaticon.com -## Inspiration -This project was created from a fork of [DotJoshJohnson/vscode-xml](https://github.com/DotJoshJohnson/vscode-xml). Much of `DotJoshJohnson/vscode-xml` code dealing with XML has been removed and additional XQuery features added. \ No newline at end of file diff --git a/src/hover/hover.ts b/src/hover/hover.ts index 02063ae..84150b5 100644 --- a/src/hover/hover.ts +++ b/src/hover/hover.ts @@ -2,7 +2,6 @@ import { CancellationToken, Hover, HoverProvider, Position, TextDocument } from "vscode"; import { XQLint} from "@quodatum/xqlint"; -import { channel,dump } from "../common/logger"; export class XQueryHoverProvider implements HoverProvider { public provideHover( @@ -11,16 +10,16 @@ export class XQueryHoverProvider implements HoverProvider { token: CancellationToken ): Hover | null { const linter = new XQLint(document.getText()); - const posx=position.translate(1,1); //@TODO - const node=linter.getAST(posx); - const sctx=linter.getCompletions(posx); - channel.log("Hover: " + node.name); + + const node=linter.getAST(position); + //const sctx=linter.getCompletions(position); + //channel.log("Hover: " + node.name); //const dx=dump(node); //channel.appendLine(dx); const range = document.getWordRangeAtPosition(position); const word = document.getText(range); - return new Hover(`XQuery Hover info: ${word} at ${posx.line}: ${posx.character} + return new Hover(`XQuery Hover info: ${word} at ${position.line}: ${position.character} value: ${ node.value }, name: ${ node.name } `);