Skip to content

Commit 2a1bf80

Browse files
authored
Merge pull request #1 from SSlinky/reprise
Project Restart
2 parents 5853c32 + 396c42e commit 2a1bf80

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+1562
-3270
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ out
33
node_modules
44
client/server
55
.vscode-test
6-
test*/**
6+
sample*/**
7+
*.vsix

.vscode/launch.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@
77
"request": "launch",
88
"name": "Launch Client",
99
"runtimeExecutable": "${execPath}",
10-
"args": ["--extensionDevelopmentPath=${workspaceRoot}"],
10+
"args": [
11+
"--extensionDevelopmentPath=${workspaceRoot}",
12+
"${workspaceFolder}/sample"
13+
],
1114
"outFiles": ["${workspaceRoot}/client/out/**/*.js"],
1215
"preLaunchTask": {
1316
"type": "npm",

.vscode/settings.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,9 @@
55
"editor.codeActionsOnSave": {
66
"source.fixAll.eslint": "explicit"
77
},
8-
"vbaLanguageServer.trace.server": "verbose"
8+
"vbaLanguageServer.trace.server": "verbose",
9+
"files.watcherExclude": {
10+
"**/.git/objects/**": true,
11+
"**/node_modules/**": true
12+
}
913
}

.vscodeignore

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,36 @@
1-
.vscode/**
2-
**/*.ts
3-
**/*.map
1+
# Project
42
.gitignore
3+
.eslintignore
4+
.vscode/**
5+
.travis.yml
56
**/tsconfig.json
67
**/tsconfig.base.json
78
contributing.md
8-
.travis.yml
9+
10+
# Development
11+
**/src
12+
13+
# # Typescript
14+
**/*.ts
15+
**/*.map
16+
17+
# Generated
18+
.antlr
19+
*.java
20+
*.interp
21+
*.tokens
22+
*.vsix
23+
24+
# Samples and testing
25+
sample*/**
26+
**/test/**
27+
**/testFixture/**
28+
29+
# Client node modules
930
client/node_modules/**
1031
!client/node_modules/vscode-jsonrpc/**
1132
!client/node_modules/vscode-languageclient/**
1233
!client/node_modules/vscode-languageserver-protocol/**
1334
!client/node_modules/vscode-languageserver-types/**
1435
!client/node_modules/{minimatch,brace-expansion,concat-map,balanced-match}/**
15-
!client/node_modules/{semver,lru-cache,yallist}/**
36+
!client/node_modules/{semver,lru-cache,yallist}/**

README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,26 @@
22

33
Adds VBA language support to VSCode via LSP compliant Language Server.
44

5+
![VBA LSP](images/vba-lsp.png)
6+
57
## Features
8+
69
* Syntax highlighting (resolved on client)
710
* Semantic highlighting
811
* Folding ranges
912
* Document symbols
10-
* Diagnostics
1113

14+
## Coming Soon
15+
16+
* Hovers
17+
* Diagnostics (info, warnings, and errors)
1218

1319
## Installation
1420

21+
* Through the VBA Marketplace,
22+
* VSCode command palette `ext install sslinky.vba-lsp`, or;
23+
* Download the [visx](/releases/latest).
24+
1525
## Contributing
1626

17-
Contributors welcome! Please see [contributing.md](tbc).
27+
Contributors welcome! Please see [contributing.md](/contributing.md).

client/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"publisher": "SSlinky",
88
"repository": {
99
"type": "git",
10-
"url": "https://github.com/SSlinky/tbc"
10+
"url": "https://github.com/SSlinky/VB-LanguageServer"
1111
},
1212
"engines": {
1313
"vscode": "^1.63.0"

client/src/syntaxes/vba.tmLanguage.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ repository:
1919
- include: "#mthdSig"
2020
- include: "#variableDeclarations"
2121
- include: "#block"
22-
- include: "#testing"
22+
- include: "#testing"
2323
repository:
2424
moduleLines:
25-
match: "(.*):"
25+
match: '([^\n:]*)?:(?=([^"]*"[^"]*")*[^"]*$)'
2626
captures:
2727
1:
2828
patterns:
@@ -52,8 +52,7 @@ repository:
5252
repository:
5353
string:
5454
name: string.quoted.double.vba
55-
begin: "\""
56-
end: "\""
55+
match: '"[^\r\n]*"'
5756
boolean:
5857
name: constant.language.boolean.vba
5958
match: "(?i)(true|false)"

contributing.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Contributing
2+
3+
## Setup
4+
5+
1. Clone repo
6+
2. Install Java >= 11
7+
3. Install NPM
8+
4. `npm install` to install dependencies.
9+
5. `npm run textMate` first time and every time grammar is changed.
10+
6. `npm run antlr4ts` first time and every time grammar is changed.
11+
7. (Optional) Install [ANTLR4 grammar syntax support](https://marketplace.visualstudio.com/items?itemName=mike-lischke.vscode-antlr4) VSCode extension.
12+
13+
## Debugging Language Server
14+
15+
* Use the Client + Server launch configuration.
16+
17+
## Debugging Antlr Grammar
18+
19+
Requires the ANTLR4 grammar syntax support extension installed. Each time you open the workspace, you'll need to open a grammar file to activate the extension.
20+
21+
Note the grammar file for this project can be found at /server/src/antlr/vba.g4
22+
23+
### Show Parse Tree
24+
25+
* Open the VBA file you want to debug.
26+
* Run `Debug ANTLR4 grammar` from launch configurations.
27+
28+
### Debug Rule
29+
30+
* Open the grammar file.
31+
* Right click a rule and choose an option from the context menu.
32+
* Show Railroad Diagram for Rule
33+
* Show ATN Graph for Rule
34+
35+
The grammar call graph is interesting, but not particularly useful. Generating "valid" input generates garbage.

images/vba-lsp-icon.png

15.3 KB
Loading

0 commit comments

Comments
 (0)