11import * as vscode from 'vscode' ;
2+ import * as webTreeSitter from 'web-tree-sitter' ;
23import * as vscodeOniguruma from 'vscode-oniguruma' ;
34import * as textmateOnigmo from "./Onigmo/Onigmo" ;
4- import { Node , QueryCapture } from 'web-tree-sitter' ;
5- import { getLastNode , getTrees , queryNode , toRange , trees } from "./TreeSitter" ;
65import { closeEnoughQuestionMark , DocumentSelector , getPackageJSON , stringify , wagnerFischer } from "./extension" ;
7- import { unicodeproperties } from "./UNICODE_PROPERTIES " ;
6+ import { getLastNode , getTrees , queryNode , toRange , trees } from "./TreeSitter " ;
87import { ignoreDiagnosticsUnusedRepos } from "./Providers/CodeActionsProvider" ;
8+ import { unicodeproperties } from "./UNICODE_PROPERTIES" ;
99
1010
1111type Pointer = number ;
@@ -214,7 +214,7 @@ async function Diagnostics(document: vscode.TextDocument) {
214214}
215215
216216
217- async function diagnosticsTreeSitterJSONErrors ( diagnostics : vscode . Diagnostic [ ] , rootNode : Node ) {
217+ async function diagnosticsTreeSitterJSONErrors ( diagnostics : vscode . Diagnostic [ ] , rootNode : webTreeSitter . Node ) {
218218 // vscode.window.showInformationMessage(JSON.stringify("diagnostics JSON"));
219219 // const start = performance.now();
220220 const jsonQuery = `;scm
@@ -397,7 +397,7 @@ async function diagnosticsOnigurumaRegexErrors(diagnostics: vscode.Diagnostic[],
397397 continue ;
398398 }
399399
400- let groupCaptures ! : QueryCapture [ ] ;
400+ let groupCaptures ! : webTreeSitter . QueryCapture [ ] ;
401401
402402 const regex : string = JSON . parse ( `"${ text } "` ) ;
403403 const hasBackreferences = ( key . text == 'end' || key . text == 'while' ) && / \\ [ 0 - 9 ] / . test ( regex ) ;
@@ -530,7 +530,7 @@ async function diagnosticsOnigurumaRegexErrors(diagnostics: vscode.Diagnostic[],
530530 // vscode.window.showInformationMessage(`Oniguruma ${(performance.now() - start).toFixed(3)}ms`);
531531}
532532
533- async function diagnosticsBrokenIncludes ( diagnostics : vscode . Diagnostic [ ] , rootNode : Node ) {
533+ async function diagnosticsBrokenIncludes ( diagnostics : vscode . Diagnostic [ ] , rootNode : webTreeSitter . Node ) {
534534 // vscode.window.showInformationMessage(JSON.stringify("diagnostics #includes"))
535535 // const start = performance.now();
536536
@@ -540,7 +540,7 @@ async function diagnosticsBrokenIncludes(diagnostics: vscode.Diagnostic[], rootN
540540 const nestedRepoQuery = `;scm
541541 (repo (repository (repo (key) @repo)))
542542 ` ;
543- let nestedRepoCaptures : QueryCapture [ ] = [ ] ;
543+ let nestedRepoCaptures : webTreeSitter . QueryCapture [ ] = [ ] ;
544544
545545 // TreeSitter compiling sibling nodes query very slow
546546 // https://github.com/tree-sitter/tree-sitter/issues/3956
@@ -691,14 +691,14 @@ async function diagnosticsBrokenIncludes(diagnostics: vscode.Diagnostic[], rootN
691691 // vscode.window.showInformationMessage(`include ${(performance.now() - start).toFixed(3)}ms`);
692692}
693693
694- async function diagnosticsUnusedRepos ( diagnostics : vscode . Diagnostic [ ] , rootNode : Node ) {
694+ async function diagnosticsUnusedRepos ( diagnostics : vscode . Diagnostic [ ] , rootNode : webTreeSitter . Node ) {
695695 if ( ignoreDiagnosticsUnusedRepos ) {
696696 return ;
697697 }
698698 // vscode.window.showInformationMessage(`diagnostics unusedRepos\n${JSON.stringify(rootNode)}`)
699699 // const start = performance.now();
700700
701- const includeCapturesCache : { [ id : number ] : QueryCapture [ ] ; } = { } ;
701+ const includeCapturesCache : { [ id : number ] : webTreeSitter . QueryCapture [ ] ; } = { } ;
702702
703703 // should validate all #include first
704704 // but TS too slow
@@ -746,7 +746,7 @@ async function diagnosticsUnusedRepos(diagnostics: vscode.Diagnostic[], rootNode
746746 // vscode.window.showInformationMessage(`unusedRepos ${(performance.now() - start).toFixed(3)}ms`);
747747}
748748
749- async function diagnosticsDeadTextMateCode ( diagnostics : vscode . Diagnostic [ ] , rootNode : Node ) {
749+ async function diagnosticsDeadTextMateCode ( diagnostics : vscode . Diagnostic [ ] , rootNode : webTreeSitter . Node ) {
750750 // vscode.window.showInformationMessage(JSON.stringify("diagnostics TextMate dead"));
751751 // const start = performance.now();
752752
@@ -837,7 +837,7 @@ async function diagnosticsDeadTextMateCode(diagnostics: vscode.Diagnostic[], roo
837837 // vscode.window.showInformationMessage(`dead ${(performance.now() - start).toFixed(3)}ms\n${JSON.stringify(diagnostics, stringify)}`);
838838}
839839
840- async function diagnosticsMismatchingRootScopeName ( diagnostics : vscode . Diagnostic [ ] , rootNode : Node , document : vscode . TextDocument ) {
840+ async function diagnosticsMismatchingRootScopeName ( diagnostics : vscode . Diagnostic [ ] , rootNode : webTreeSitter . Node , document : vscode . TextDocument ) {
841841 // vscode.window.showInformationMessage(JSON.stringify("diagnostics scopeName"));
842842 // const start = performance.now();
843843
0 commit comments