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
14 changes: 0 additions & 14 deletions .vscodeignore

This file was deleted.

Binary file added images/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 0 additions & 4 deletions oxlint.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,10 @@ const disabledRules = [
"oxc/no-optional-chaining",
"oxc/no-rest-spread-properties",
"promise/prefer-await-to-callbacks",
"typescript/explicit-function-return-type",
"typescript/parameter-properties",
"typescript/prefer-readonly-parameter-types",
"typescript/promise-function-async",
"typescript/strict-void-return",
"unicorn/filename-case",
"unicorn/no-array-for-each",
"unicorn/no-lonely-if",
"unicorn/no-null",
"unicorn/prefer-at",
"unicorn/prefer-spread",
Expand Down
388 changes: 194 additions & 194 deletions package-lock.json

Large diffs are not rendered by default.

21 changes: 14 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,20 @@
"name": "parse-tree",
"displayName": "Parse tree",
"description": "Access document syntax using tree-sitter",
"version": "0.55.0",
"version": "0.56.0",
"publisher": "pokey",
"repository": {
"type": "git",
"url": "https://github.com/pokey/vscode-parse-tree"
"url": "git+https://github.com/pokey/vscode-parse-tree.git"
},
"icon": "images/icon.png",
"main": "./out/extension.js",
"files": [
"out",
"parsers",
"images",
"CHANGELOG.md"
],
"license": "MIT",
"extensionKind": [
"ui",
Expand Down Expand Up @@ -72,7 +80,6 @@
"onLanguage:yaml",
"onLanguage:zig"
],
"main": "./out/extension.js",
"capabilities": {
"untrustedWorkspaces": {
"supported": true
Expand Down Expand Up @@ -101,9 +108,9 @@
"@types/node": "^24.12.2",
"@types/semver": "^7.7.1",
"@types/vscode": "1.98.0",
"oxfmt": "^0.44.0",
"oxlint-tsgolint": "^0.20.0",
"oxlint": "^1.59.0",
"typescript": "^6.0.2"
"oxfmt": "^0.47.0",
"oxlint-tsgolint": "^0.22.1",
"oxlint": "^1.62.0",
"typescript": "^6.0.3"
}
}
8 changes: 4 additions & 4 deletions src/Trees.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ import type { Parser, Point, Tree } from "web-tree-sitter";
export class Trees {
private readonly trees = new Map<string, Tree>();

get(uri: string): Tree | undefined {
public get(uri: string): Tree | undefined {
return this.trees.get(uri);
}

set(uri: string, tree: Tree): void {
public set(uri: string, tree: Tree): void {
this.trees.set(uri, tree);
}

delete(uri: string): void {
public delete(uri: string): void {
this.trees.delete(uri);
}

updateTree(parser: Parser, edit: TextDocumentChangeEvent): void {
public updateTree(parser: Parser, edit: TextDocumentChangeEvent): void {
if (edit.contentChanges.length === 0) {
return;
}
Expand Down
10 changes: 5 additions & 5 deletions src/errors.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Uri } from "vscode";

export class UnsupportedLanguageError extends Error {
constructor(language: string) {
public constructor(language: string) {
super(
`Language '${language}' not supported by parse tree extension. See https://github.com/pokey/vscode-parse-tree#adding-a-new-language`,
);
Expand All @@ -10,28 +10,28 @@ export class UnsupportedLanguageError extends Error {
}

export class LanguageStillLoadingError extends Error {
constructor(language: string) {
public constructor(language: string) {
super(`Language '${language}' is still loading; please wait and try again`);
this.name = "LanguageStillLoadingError";
}
}

export class DeprecatedError extends Error {
constructor(name: string) {
public constructor(name: string) {
super(`${name} is deprecated and has been removed from the API`);
this.name = "DeprecatedError";
}
}

export class FailedToParseError extends Error {
constructor(uri: Uri) {
public constructor(uri: Uri) {
super(`Failed to parse document: ${uri.toString()}`);
this.name = "FailedToParseError";
}
}

export class DocumentNotOpenError extends Error {
constructor(uri: Uri) {
public constructor(uri: Uri) {
super(`Document not open: ${uri.toString()}`);
this.name = "DocumentNotOpenError";
}
Expand Down
2 changes: 1 addition & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export function activate(context: ExtensionContext): ReturnValue {
* @param languageId The vscode language id of the language to load
* @returns a promise resolving to boolean an indicating whether the language could be loaded
*/
async function loadLanguage(languageId: string) {
async function loadLanguage(languageId: string): Promise<boolean> {
const language = languages[languageId];

// Language without a parser, e.g. plaintext
Expand Down