diff --git a/CHANGELOG.md b/CHANGELOG.md index 995da37..af36450 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to the "vscode-parse-tree" extension will be documented in this file. +## 0.53.0 (26 Mar 2026) + +- Re-added `getNodeAtLocation` per user request. + ## 0.51.0 (12 Mar 2026) Removed deprecated api endpoints: diff --git a/package-lock.json b/package-lock.json index 8782952..4ffc4c9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "parse-tree", - "version": "0.52.0", + "version": "0.53.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "parse-tree", - "version": "0.52.0", + "version": "0.53.0", "license": "MIT", "dependencies": { "semver": "^7.7.4", diff --git a/package.json b/package.json index c2d881b..4cf2134 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "parse-tree", "displayName": "Parse tree", "description": "Access document syntax using tree-sitter", - "version": "0.52.0", + "version": "0.53.0", "publisher": "pokey", "repository": { "type": "git", diff --git a/src/extension.ts b/src/extension.ts index f0dc4a6..2c3cca9 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -4,6 +4,7 @@ import type { TextDocument, TextDocumentChangeEvent, Uri, + Location, } from "vscode"; import { window, workspace } from "vscode"; import type { Tree } from "web-tree-sitter"; @@ -196,12 +197,16 @@ export function activate(context: ExtensionContext) { return getTreeForUri(document.uri); }, + getNodeAtLocation(location: Location) { + return getTreeForUri(location.uri).rootNode.descendantForPosition({ + row: location.range.start.line, + column: location.range.start.character, + }); + }, + getLanguage() { throw new DeprecatedError("getLanguage"); }, - getNodeAtLocation() { - throw new DeprecatedError("getNodeAtLocation"); - }, registerLanguage() { throw new DeprecatedError("registerLanguage"); },