Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
b3bc682
1.4.5
SSlinky Sep 28, 2024
28e6fe3
Fixed #17
SSlinky Sep 29, 2024
13e7bf6
update packages
SSlinky Oct 4, 2024
4e96023
Reimagine scope
SSlinky Oct 7, 2024
703ade6
Update node packages
SSlinky Oct 7, 2024
8458f26
Merge branch 'master' into dev
SSlinky Oct 8, 2024
8568d78
Merge branch 'dev' into Scopes
SSlinky Oct 8, 2024
b6115fd
Ignore tsbuildinfo
SSlinky Oct 8, 2024
abd2b06
Set up local testing
SSlinky Oct 8, 2024
767e6d0
Added antlr preparser for compiler directives
SSlinky Oct 8, 2024
6e3373c
Removed cached
SSlinky Oct 8, 2024
981237a
Ignore tsbuildinfo
SSlinky Oct 8, 2024
0a752d6
Cancellation already handled
SSlinky Oct 8, 2024
e80b0b4
Merge branch 'master' into dev
SSlinky Oct 9, 2024
e79d648
Merge branch 'dev' into Scopes
SSlinky Oct 9, 2024
bcdc4fc
remove tsbuildinfo
SSlinky Oct 9, 2024
d3d0565
Add environment settings
SSlinky Oct 19, 2024
f11b135
Refactor parsing and add preparser
SSlinky Oct 19, 2024
b35d626
All the things
SSlinky Nov 19, 2024
e1b8aa0
Bug fixes
SSlinky Nov 20, 2024
0155ef7
Added functionality to subtract text so it is not considered during m…
SSlinky Nov 20, 2024
537a064
Update packages
SSlinky Nov 20, 2024
88fe07b
Corrected class copyright name.
SSlinky Nov 20, 2024
39e813e
operators now recognised in header
SSlinky Nov 20, 2024
1e6105f
Reorganise scripts
SSlinky Nov 20, 2024
c70cce0
New snapshot tests
SSlinky Nov 20, 2024
18b7376
New textMate tests
SSlinky Nov 20, 2024
58e4179
Update packages
SSlinky Nov 22, 2024
6b40961
Configure test fixtures
SSlinky Nov 22, 2024
29557aa
Configure test environment
SSlinky Nov 22, 2024
0716044
Initial unit tests
SSlinky Nov 22, 2024
3e70015
Parse duplicate operators
SSlinky Nov 22, 2024
9c63ef0
Enable module element listening
SSlinky Nov 22, 2024
2cc5307
Enable class element listening
SSlinky Nov 22, 2024
5e77ca0
Listen for any operator (multiples)
SSlinky Nov 22, 2024
e5dfa97
Update imports
SSlinky Nov 22, 2024
78bb64a
add DuplicateOperatorElement class
SSlinky Nov 22, 2024
d479691
Refactor and tidy
SSlinky Nov 22, 2024
7d60164
evaluateDiagnostics now returns the diagnostics for cleaner resolution
SSlinky Nov 22, 2024
50437fc
Bug fix causing preparser to redact entire document
SSlinky Nov 22, 2024
7929e66
Enable unit testing in workflow
SSlinky Nov 22, 2024
76982ca
Added missing attribute diagnostic tests
SSlinky Nov 22, 2024
e021675
Bug fixed unit tests
SSlinky Nov 22, 2024
beabb85
Refactor unknown attributes and move ctxToRange to helpers
SSlinky Nov 23, 2024
3c2ceb0
Supports duplicate attribute diagnostics
SSlinky Nov 24, 2024
991ae87
Added enum diagnostic test and wrote class general tests
SSlinky Nov 24, 2024
276046d
New getOrCreate extension for Map
SSlinky Nov 25, 2024
ff80eb6
Fix extensions
SSlinky Nov 29, 2024
a20cf56
Refactor simplified scope
SSlinky Nov 29, 2024
3f7301e
Add equality check for elements
SSlinky Dec 1, 2024
a08131e
Implement new property elements
SSlinky Dec 1, 2024
b8aa49d
Fix Global accessor and add type hints
SSlinky Dec 16, 2024
867b273
Typos and bug fixes
SSlinky Dec 17, 2024
41d4cf5
Set up path aliases
SSlinky Dec 17, 2024
8a36bb0
Not ready for testing
SSlinky Jan 14, 2025
92c3ba5
Roll back path aliases
SSlinky Jan 14, 2025
93a271e
reimplement precompiler
SSlinky Jan 14, 2025
93ce0b9
Composition over inheritence redesign
SSlinky Jan 14, 2025
9267568
Package updates and fixes
SSlinky Jan 14, 2025
6a7a872
Fixed CI workflow
SSlinky Jan 14, 2025
f75eba3
Added run compile textMate
SSlinky Jan 14, 2025
dfffd12
Fix testing in headless linux
SSlinky Jan 14, 2025
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
8 changes: 6 additions & 2 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ jobs:
- run: npm ci
# For some reason, antlr4ng writes to a different location on the VM
# than it does locally, preventing compile. Command added to move the generated files.
- run: npm run textMate
- name: npm run antlr4ng
run: npm run antlr4ng && mv ./server/src/antlr/out/server/src/antlr/* ./server/src/antlr/out
run: npm run antlr4ng && npm run antlr4ngPre && mv ./server/src/antlr/out/server/src/antlr/* ./server/src/antlr/out
- run: npm run compile
# - run: npm test
- run: xvfb-run -a npm test
if: runner.os == 'Linux'
- run: npm test
if: runner.os != 'Linux'
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ node_modules
client/server
.vscode-test
sample*/**
*.vsix
*.vsix
*.tsbuildinfo
10 changes: 10 additions & 0 deletions .vscode-test.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// .vscode-test.mjs
import { defineConfig } from '@vscode/test-cli';

export default defineConfig({
files: 'client/out/test/**/*.test.js',
mocha: {
ui: 'tdd',
timeout: 4000
}
});
21 changes: 21 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,27 @@
"startRule": "startRule",
"printParseTree": true,
"visualParseTree": true
},
{
"name": "Debug ANTLR4 Pre grammar",
"type": "antlr-debug",
"request": "launch",
"input": "${file}",
"grammar": "server/src/antlr/vbapre.g4",
"startRule": "startRule",
"printParseTree": true,
"visualParseTree": true
},
{
"name": "Extension Tests",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/client/out/test/index"
],
"outFiles": ["${workspaceFolder}/client/out/test/**/*.test.js"]
}
],
"compounds": [
Expand Down
1 change: 1 addition & 0 deletions .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ contributing.md
*.interp
*.tokens
*.vsix
*.tsbuildinfo

# Samples and testing
sample*/**
Expand Down
37 changes: 17 additions & 20 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"vscode-languageclient": "^9.0.1"
},
"devDependencies": {
"@types/vscode": "^1.94.0",
"@types/vscode": "^1.96.0",
"@vscode/test-electron": "^2.4.1"
}
}
23 changes: 15 additions & 8 deletions client/src/syntaxes/vba.tmLanguage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ repository:
repository:
argsVariable:
name: meta.arguments.argsVariable.vba
match: (?i),?\s*((?:Optional\s+)?(?:(?:ByVal|ByRef)\s+)?)?([a-z][a-z0-9_]*)(?:\s+(as\s+[a-z][a-z0-9_]*))?(\s*=\s*[^,)]+)?
match: (?i),?\s*((?:Optional\s+)?(?:(?:ByVal|ByRef)\s+)?)?([a-z][a-z0-9_]*)(\(\))?(?:\s+(as\s+[a-z][a-z0-9_]*))?(\s*=\s*[^,)]+)?
# Attempted replacing \s with (?:\s+|\s*_\s*\n) to consume a space or a line ending but it refuses to play the game.
# match: ~~ doesn't work (?i),?(?:\s+|\s*_\s*\n)*((?:Optional(?:\s+|\s*_\s*\n)+)?(?:(?:ByVal|ByRef)(?:\s+|\s*_\s*\n)+)?)?([a-z][a-z0-9_]*)(?:(?:\s+|\s*_\s*\n)+(as(?:\s+|\s*_\s*\n)+[a-z][a-z0-9_]*))?((?:\s+|\s*_\s*\n)*=(?:\s+|\s*_\s*\n)*[^,\n)]+)?
# match: ~~ all broken (?i),?(?:\s*_\s*\n)*((?:Optional(?:\s+(?:\s*_\s*\n)*))?(?:(?:ByVal|ByRef)(?:\s+(?:\s*_\s*\n)*))?)?([a-z][a-z0-9_]*)(?:(?:\s+(?:\s*_\s*\n)*)(as\(?:\s+(?:\s*_\s*\n)*)[a-z][a-z0-9_]*))?((?:\s*_\s*\n)*=(?:\s*_\s*\n)*[^,)]+)?
Expand Down Expand Up @@ -428,7 +428,7 @@ repository:
patterns:
- include: "#lineContinuation"
apostropheComments:
name: comment.line.apostropheXX.vba
name: comment.line.apostrophe.vba
match: (?i)\s*'.*
remarkComments:
name: comment.line.remark.vba
Expand Down Expand Up @@ -460,6 +460,7 @@ repository:
patterns:
- include: "#comments"
- include: "#literals"
- include: "#operators"

moduleOption:
name: keyword.control.vba
Expand Down Expand Up @@ -673,7 +674,7 @@ repository:
repository:
variableDeclaration:
name: storage.var-declaration.vba
match: (?i)^\s*(Dim|Public|Private)\s+([a-z][a-z0-9_]*)(\(.*\))?(\s+As(?:\s+New)?\s+[A-Z][A-Z0-9_]*)?
match: (?i)^\s*(Dim|Public|Private|Global)\s+([a-z][a-z0-9_]*)([&%#!@$^])?(\(.*\))?(\s+As(?:\s+New)?\s+[A-Z][A-Z0-9_]*)?
captures:
1:
# Dim|Private
Expand All @@ -682,28 +683,34 @@ repository:
# varName
name: variable.other.readwrite.vba
3:
# Type hint?
name: support.type.primitive.vba
4:
# Array bounds?
patterns:
- include: "#language"
4:
5:
# As Type
patterns:
- include: "#types"
constDeclaration:
name: storage.const-declaration.vba
match: "^\\s*((?i)(?:(?:Public|Private)\\s+)?Const)\\s+([A-Z][A-Z0-9_]*)((?i)\\s+As\\s+[A-Z][A-Z0-9_]*)?(.*)"
match: ^\s*((?i)(?:(?:Public|Private)\s+)?Const)\s+([A-Z][A-Z0-9_]*)([&%#!@$^])?((?i)\s+As\s+[A-Z][A-Z0-9_]*)?(.*)
captures:
1:
# Public|Private Const
name: constant.language.vba
name: storage.type.vba
2:
# CONSTNAME
name: variable.other.constant.property
name: variable.other.constant.vba
3:
# Type hint?
name: support.type.primitive.vba
4:
# As Type
patterns:
- include: "#types"
4:
5:
# = "some value"
patterns:
- include: "#language"
Expand Down
74 changes: 37 additions & 37 deletions client/src/test/completion.test.ts
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
/* --------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
// /* --------------------------------------------------------------------------------------------
// * Copyright (c) Microsoft Corporation. All rights reserved.
// * Licensed under the MIT License. See License.txt in the project root for license information.
// * ------------------------------------------------------------------------------------------ */

import * as vscode from 'vscode';
import * as assert from 'assert';
import { getDocUri, activate } from './helper';
// import * as vscode from 'vscode';
// import * as assert from 'assert';
// import { getDocUri, activate } from './helper';

suite('Should do completion', () => {
const docUri = getDocUri('completion.txt');
// suite('Should do completion', () => {
// const docUri = getDocUri('completion.txt');

test('Completes JS/TS in txt file', async () => {
await testCompletion(docUri, new vscode.Position(0, 0), {
items: [
{ label: 'JavaScript', kind: vscode.CompletionItemKind.Text },
{ label: 'TypeScript', kind: vscode.CompletionItemKind.Text }
]
});
});
});
// test('Completes JS/TS in txt file', async () => {
// await testCompletion(docUri, new vscode.Position(0, 0), {
// items: [
// { label: 'JavaScript', kind: vscode.CompletionItemKind.Text },
// { label: 'TypeScript', kind: vscode.CompletionItemKind.Text }
// ]
// });
// });
// });

async function testCompletion(
docUri: vscode.Uri,
position: vscode.Position,
expectedCompletionList: vscode.CompletionList
) {
await activate(docUri);
// async function testCompletion(
// docUri: vscode.Uri,
// position: vscode.Position,
// expectedCompletionList: vscode.CompletionList
// ) {
// await activate(docUri);

// Executing the command `vscode.executeCompletionItemProvider` to simulate triggering completion
const actualCompletionList = (await vscode.commands.executeCommand(
'vscode.executeCompletionItemProvider',
docUri,
position
)) as vscode.CompletionList;
// // Executing the command `vscode.executeCompletionItemProvider` to simulate triggering completion
// const actualCompletionList = (await vscode.commands.executeCommand(
// 'vscode.executeCompletionItemProvider',
// docUri,
// position
// )) as vscode.CompletionList;

assert.ok(actualCompletionList.items.length >= 2);
expectedCompletionList.items.forEach((expectedItem, i) => {
const actualItem = actualCompletionList.items[i];
assert.equal(actualItem.label, expectedItem.label);
assert.equal(actualItem.kind, expectedItem.kind);
});
}
// assert.ok(actualCompletionList.items.length >= 2);
// expectedCompletionList.items.forEach((expectedItem, i) => {
// const actualItem = actualCompletionList.items[i];
// assert.equal(actualItem.label, expectedItem.label);
// assert.equal(actualItem.kind, expectedItem.kind);
// });
// }
Loading
Loading