Skip to content

Commit

Permalink
Repair object constant override highlight
Browse files Browse the repository at this point in the history
  • Loading branch information
ironsheep committed Dec 11, 2023
1 parent c3889f4 commit ea3d41b
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 6 deletions.
4 changes: 2 additions & 2 deletions spin2/.vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"typescript.tsc.autoDetect": "off",
"typescript.preferences.quoteStyle": "single",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"source.fixAll.eslint": "explicit"
},
"files.exclude": {
"**/.git": true,
"**/.svn": true,
Expand Down
6 changes: 6 additions & 0 deletions spin2/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ Possible next additions:
- Add new-file templates as Snippets
- Add additional Snippets as the community identifies them

## [2.2.9] 2023-12-11

Update P2 Only

- Fixes to SPIN2 object constant override highlight. (was broken in earlier release)

## [2.2.8] 2023-12-05

Update P1 and P2
Expand Down
2 changes: 1 addition & 1 deletion spin2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"icon": "images/Propeller.ico",
"author": "IronSheep",
"license": "MIT",
"version": "2.2.8",
"version": "2.2.9",
"repository": {
"type": "git",
"url": "https://github.com/ironsheep/P2-vscode-langserv-extension"
Expand Down
2 changes: 1 addition & 1 deletion spin2/scripts/LIVE-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"icon": "images/Propeller.ico",
"author": "IronSheep",
"license": "MIT",
"version": "2.2.8",
"version": "2.2.9",
"repository": {
"type": "git",
"url": "https://github.com/ironsheep/P2-vscode-langserv-extension"
Expand Down
2 changes: 1 addition & 1 deletion spin2/scripts/TEST-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "P1 and P2 Spin/Pasm Syntax/Semantic Highlighting w/Code Outline, Object Outline and Custom tabbing support",
"author": "IronSheep",
"license": "MIT",
"version": "2.2.8",
"version": "2.2.9",
"repository": {
"type": "git",
"url": "https://github.com/ironsheep/P2-vscode-langserv-extension"
Expand Down
4 changes: 3 additions & 1 deletion spin2/server/src/parser/spin2.documentSemanticParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6322,12 +6322,14 @@ export class Spin2DocumentSemanticParser {
const dottedSymbolRegex = /[a-zA-Z0-9_]\.[a-zA-Z_]/; // sym.sym
const dottedIndexedSymbolRegex = /[a-zA-Z0-9_]\]\.[a-zA-Z_]/; // sym#sym
const hashedSymbolRegex = /[a-zA-Z0-9_]\#[a-zA-Z_]/; // sym#sym
const percentSymbolRegex = /[a-zA-Z0-9_]\%[a-zA-Z_]/; // sym#sym
const hasSymbolDotSymbol: boolean = dottedSymbolRegex.test(possibleRef);
const hasSymbolHashSymbol: boolean = hashedSymbolRegex.test(possibleRef);
const hasPercentHashSymbol: boolean = percentSymbolRegex.test(possibleRef);
const hasSymbolDOtIndexedSymbol: boolean = dottedIndexedSymbolRegex.test(possibleRef);
const possibleRefLC: string = possibleRef.toLowerCase();
const isPartialVariableAccess: boolean = possibleRefLC.includes(".byte[") || possibleRefLC.includes(".word[") || possibleRefLC.includes(".long[");
const refFoundStatus: boolean = !possibleRef.startsWith(".") && !isPartialVariableAccess && (hasSymbolDOtIndexedSymbol || hasSymbolDotSymbol || hasSymbolHashSymbol);
const refFoundStatus: boolean = !possibleRef.startsWith(".") && !isPartialVariableAccess && (hasSymbolDOtIndexedSymbol || hasSymbolDotSymbol || hasSymbolHashSymbol || hasPercentHashSymbol);
this._logMessage(` -- isObjRef() possibleRef=[${possibleRef}] -> (${refFoundStatus})`);
return refFoundStatus;
}
Expand Down

0 comments on commit ea3d41b

Please sign in to comment.