Skip to content

Commit 721682f

Browse files
committed
Changed autoit3-pegjs dependency to 1.2.0
1 parent d89c195 commit 721682f

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@
126126
]
127127
},
128128
"dependencies": {
129-
"autoit3-pegjs": "github:genius257/autoit3-pegjs#1.1.6"
129+
"autoit3-pegjs": "github:genius257/autoit3-pegjs#1.2.0"
130130
},
131131
"devDependencies": {
132132
"@types/jest": "^29.4.0",

server/src/autoit/Script.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import parser, { ArgumentList, ArrayDeclaration, ArrayDeclarationElementList, AssignmentExpression, CaseClause, CaseValueList, DefaultClause, ElseClause, ElseIfClause, ElseIfClauses, FormalParameter, FormalParameterList, FunctionDeclaration, IdentifierName, IncludeStatement, LocationRange, Macro, Program, SelectCaseClause, SourceElement, SourceElements, SwitchCaseValue, VariableDeclaration, VariableDeclarationList, VariableIdentifier } from "autoit3-pegjs";
1+
import parser, { ArgumentList, ArrayDeclaration, ArrayDeclarationElementList, AssignmentExpression, CaseClause, CaseValueList, DefaultClause, ElseClause, ElseIfClause, ElseIfClauses, EnumDeclaration, EnumDeclarationList, FormalParameter, FormalParameterList, FunctionDeclaration, IdentifierName, IncludeStatement, LocationRange, Macro, Program, SelectCaseClause, SourceElement, SourceElements, SwitchCaseValue, VariableDeclaration, VariableDeclarationList, VariableIdentifier } from "autoit3-pegjs";
22
import { Diagnostic, DiagnosticSeverity, Position } from "vscode-languageserver";
33
import { URI } from 'vscode-uri';
44
import Parser from "./Parser";
@@ -19,8 +19,8 @@ export type ScriptHint = Diagnostic & { severity: typeof DiagnosticSeverity.Hint
1919

2020
export type ScriptDiagnostic = ScriptError | ScriptWarning | ScriptInformation | ScriptHint;
2121

22-
export type Node = SourceElement | AssignmentExpression | FormalParameter | VariableDeclaration | ArrayDeclaration | DefaultClause | CaseClause | SelectCaseClause | SwitchCaseValue | Macro | IncludeStatement | ElseIfClause | ElseClause;
23-
export type NodeList = SourceElements | ArgumentList | VariableDeclarationList | FormalParameterList | (DefaultClause | CaseClause | SelectCaseClause)[] | ArrayDeclarationElementList | CaseValueList | ElseIfClauses | ElseClause[];
22+
export type Node = SourceElement | AssignmentExpression | FormalParameter | VariableDeclaration | EnumDeclaration | ArrayDeclaration | DefaultClause | CaseClause | SelectCaseClause | SwitchCaseValue | Macro | IncludeStatement | ElseIfClause | ElseClause;
23+
export type NodeList = SourceElements | ArgumentList | VariableDeclarationList | EnumDeclarationList | FormalParameterList | (DefaultClause | CaseClause | SelectCaseClause)[] | ArrayDeclarationElementList | CaseValueList | ElseIfClauses | ElseClause[];
2424

2525
export enum NodeFilterAction {
2626
/** Adds the current node and continues down the branch */
@@ -716,7 +716,7 @@ export default class Script {
716716
* @param functions Function map for fallback lookups
717717
* @param depth Recursive depth tracking variable
718718
*/
719-
public getIdentifierDeclarator(identifier: IdentifierName | VariableIdentifier | Macro | null, stack: string[] = [], functions: FunctionDeclaration[] = [], depth: number = 0): FormalParameter | FunctionDeclaration | VariableDeclaration | null {
719+
public getIdentifierDeclarator(identifier: IdentifierName | VariableIdentifier | Macro | null, stack: string[] = [], functions: FunctionDeclaration[] = [], depth: number = 0): FormalParameter | FunctionDeclaration | VariableDeclaration | EnumDeclaration | null {
720720
if (identifier === null || identifier.type === "Macro") {
721721
return null;
722722
}
@@ -731,7 +731,7 @@ export default class Script {
731731
stack.push(uri);
732732
}
733733

734-
let declaration: FormalParameter | FunctionDeclaration | VariableDeclaration | undefined | null;
734+
let declaration: FormalParameter | FunctionDeclaration | VariableDeclaration | EnumDeclaration | undefined | null;
735735

736736
switch (identifier.type) {
737737
case "Identifier":

server/src/main.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { /*Color, ColorInformation, Range,*/ InitializeParams, InitializeResult,
1010
import { URI } from 'vscode-uri';
1111

1212
import nativeSuggestions from "./autoit/internal";
13-
import { CallExpression, FormalParameter, FunctionDeclaration, Identifier, IncludeStatement, LocationRange, Macro, SingleLineComment, VariableDeclaration, VariableIdentifier } from 'autoit3-pegjs';
13+
import { CallExpression, EnumDeclaration, FormalParameter, FunctionDeclaration, Identifier, IncludeStatement, LocationRange, Macro, SingleLineComment, VariableDeclaration, VariableIdentifier } from 'autoit3-pegjs';
1414
import Parser from './autoit/Parser';
1515
import PositionHelper from './autoit/PositionHelper';
1616
import { Workspace } from './autoit/Workspace';
@@ -168,7 +168,7 @@ connection.onHover((hoverParams, token, workDoneProgress):Hover|null => {
168168
}
169169
}
170170

171-
let identifier: FormalParameter | FunctionDeclaration | VariableDeclaration | null | undefined = null;
171+
let identifier: FormalParameter | FunctionDeclaration | VariableDeclaration | EnumDeclaration | null | undefined = null;
172172

173173
identifier = identifier ?? workspace.get(hoverParams.textDocument.uri)?.getIdentifierDeclarator(identifierAtPos);
174174
if (!identifier) {

0 commit comments

Comments
 (0)