Skip to content

Commit 525e14e

Browse files
committed
Finish pre-release-0.6.1
2 parents 7a5988e + 04d21ca commit 525e14e

File tree

15 files changed

+355
-141
lines changed

15 files changed

+355
-141
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
on:
22
push:
33
tags:
4-
- '*'
4+
- 'release-*'
55

66
name: Deploy Extension
77
jobs:
@@ -11,7 +11,7 @@ jobs:
1111
- uses: actions/checkout@v2
1212
- uses: actions/setup-node@v1
1313
with:
14-
node-version: 12
14+
node-version: 16
1515
- run: npm ci
1616
- name: Publish to Visual Studio Marketplace
1717
uses: HaaLeo/publish-vscode-extension@v0

docs/CHANGELOG.md renamed to CHANGELOG.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# UnrealScript Language Service
22

3-
## 0.6.0
3+
## 0.6.0 (Jan 26, 2023)
44

55
- Implemented [LSP Semantic-Tokens #137](https://github.com/EliotVU/UnrealScript-Language-Service/issues/137) (References to a class will now be highlighted as such even where the tmLanguage cannot determine the identifier's type)
66
- ![image](https://user-images.githubusercontent.com/808593/211020346-38724ace-2fbe-4d92-b68c-69640ded824f.png)
77

88
- Implemented [LSP Workspace Symbols #148](https://github.com/EliotVU/UnrealScript-Language-Service/issues/148)
9-
- ![image](./media/workspaceSymbols.png)
9+
- ![image](./docs/media/workspaceSymbols.png)
1010

1111
- Added [UnrealScript snippets #149](https://github.com/EliotVU/UnrealScript-Language-Service/issues/149)
1212

@@ -23,7 +23,7 @@
2323
- Fixed LSP/documentSymbol [VSCode's Sticky scroll feature](https://github.com/EliotVU/UnrealScript-Language-Service/issues/148)
2424
- Fixed an issue that caused the document transformer to abort when trying to build a property with bad type-grammar (actually usually triggered by use of macros).
2525

26-
## 0.5.0
26+
## 0.5.0 (Nov 8, 2021)
2727

2828
- Autocomplete and IntelliSense
2929
- Has been displaced with the help of a third-party library [c3](https://github.com/mike-lischke/antlr4-c3)

client/src/extension.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import * as path from 'path';
22
import { ExtensionContext, workspace } from 'vscode';
3-
import {
4-
LanguageClient, LanguageClientOptions, ServerOptions, TransportKind
5-
} from 'vscode-languageclient/node';
3+
import { LanguageClient, LanguageClientOptions, ServerOptions, TransportKind } from 'vscode-languageclient/node';
64

75
let client: LanguageClient;
86

@@ -34,7 +32,11 @@ export function activate(context: ExtensionContext) {
3432
documentSelector: [{ scheme: 'file', language: 'unrealscript' }],
3533
synchronize: {
3634
configurationSection: 'unrealscript',
37-
fileEvents: workspace.createFileSystemWatcher('**/*.{uc,uci}')
35+
fileEvents: [
36+
workspace.createFileSystemWatcher('**/*.{uc,uci}'),
37+
// Let's not watch for upk changes, just u files because those are expected to change often.
38+
workspace.createFileSystemWatcher('**/*.{u}')
39+
]
3840
},
3941
diagnosticCollectionName: 'UnrealScript',
4042
outputChannelName: 'UnrealScript',

grammars/UCLexer.g4

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ lexer grammar UCLexer;
22

33
channels { MACRO, COMMENTS_CHANNEL }
44

5+
@lexer::header {
6+
// TODO: Create a map of keyword tokens?
7+
}
8+
59
@lexer::members {
610
parensLevel: number = 0;
711
braceLevel: number = 0;

grammars/UCParser.g4

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@ options {
2121
const token = this._input.get(i);
2222
return token.type === UCParser.NEWLINE;
2323
}
24+
25+
isKeywordToken(token: Token): boolean {
26+
return token.type >= UCParser.KW_DEFAULT && token.type < UCParser.ID;
27+
}
2428
}
2529

2630
// Class modifier keywords have been commented out, because we are not using them for parsing.
2731
identifier
2832
: ID
29-
| keyword
30-
;
31-
32-
keyword
33-
: 'default'
33+
| { this.isKeywordToken(this.currentToken) }? ('default'
3434
| 'self'
3535
| 'super'
3636
| 'global'
@@ -202,8 +202,8 @@ keyword
202202
| 'rng'
203203
| 'arraycount'
204204
| 'enumcount'
205-
| 'sizeof'
206-
;
205+
| 'sizeof')
206+
;
207207

208208
// Parses the following possiblities.
209209
// Package.Class
@@ -594,6 +594,7 @@ structCppText
594594
;
595595

596596
// UnrealScriptBug: Anything WHATSOEVER can be written after this closing brace as long as it's on the same line!
597+
// Skips a C++ block of text: "{ ... | { ... }* }
597598
exportBlockText
598599
: OPEN_BRACE (~(OPEN_BRACE | CLOSE_BRACE)+ | exportBlockText)* CLOSE_BRACE
599600
;

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.

package.json

Lines changed: 38 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "uc",
33
"description": "UnrealScript Language support",
44
"displayName": "UnrealScript",
5-
"version": "0.6.0",
5+
"version": "0.6.1",
66
"author": {
77
"name": "Eliot van Uytfanghe",
88
"url": "https://EliotVU.com"
@@ -13,12 +13,10 @@
1313
"type": "git",
1414
"url": "https://github.com/EliotVU/UnrealScript-Language-Service"
1515
},
16-
"license": "MIT",
17-
"capabilities": {
18-
"virtualWorkspaces": {
19-
"supported": false
20-
}
16+
"bugs": {
17+
"url": "https://github.com/EliotVU/UnrealScript-Language-Service/issues"
2118
},
19+
"license": "MIT",
2220
"categories": [
2321
"Programming Languages",
2422
"Linters"
@@ -28,10 +26,23 @@
2826
"UnrealScript",
2927
"IntelliSense"
3028
],
29+
"pricing": "Free",
30+
"sponsor": {
31+
"url": "https://github.com/sponsors/eliotvu"
32+
},
33+
"icon": "Icon.png",
34+
"galleryBanner": {
35+
"color": "#1c1a42",
36+
"theme": "dark"
37+
},
3138
"engines": {
3239
"vscode": "^1.74.0"
3340
},
34-
"icon": "Icon.png",
41+
"capabilities": {
42+
"virtualWorkspaces": {
43+
"supported": false
44+
}
45+
},
3546
"dependencies": {
3647
"antlr4ts": "0.5.0-alpha.4",
3748
"syntaxes": "file:syntaxes"
@@ -137,7 +148,7 @@
137148
"unrealscript.checkTypes": {
138149
"scope": "window",
139150
"type": "boolean",
140-
"description": "Checks and reports if an expression's type is a valid one. e.g. assignments and passed arguments.",
151+
"description": "(Experimental) Checks and reports if an expression's type is a valid one. e.g. assignments and passed arguments. Recommended for laboratory mice.",
141152
"default": false
142153
},
143154
"unrealscript.macroSymbols": {
@@ -210,6 +221,24 @@
210221
"extends": "Object"
211222
}
212223
}
224+
},
225+
"unrealscript.indexPackageExtensions": {
226+
"scope": "resource",
227+
"type": "array",
228+
"description": "A list of package (uc,upk) extensions to index.",
229+
"default": [
230+
"u",
231+
"upk"
232+
]
233+
},
234+
"unrealscript.indexDocumentExtensions": {
235+
"scope": "resource",
236+
"type": "array",
237+
"description": "A list of document (uc) extensions to index.",
238+
"default": [
239+
"uc",
240+
"uci"
241+
]
213242
}
214243
}
215244
},
@@ -307,4 +336,4 @@
307336
}
308337
]
309338
}
310-
}
339+
}

server/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.

server/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"author": "Eliot van Uytfanghe",
66
"publisher": "EliotVU",
77
"license": "MIT",
8-
"version": "0.6.0",
8+
"version": "0.6.1",
99
"repository": {
1010
"type": "git",
1111
"url": "https://github.com/EliotVU/UnrealScript-Language-Service"
Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1-
import { ParserRuleContext, Token } from 'antlr4ts';
1+
import { Parser, ParserRuleContext, Token } from 'antlr4ts';
22

3-
export function getTokenDebugInfo(token?: Token): string {
3+
export function getTokenDebugInfo(token: Token | undefined, parser?: Parser): string {
44
if (typeof token === 'undefined') {
5-
return '';
5+
return 'null';
66
}
7-
return `(${token.line}:${token.charPositionInLine}) "${token.text}"`;
7+
const typeTree = parser ? parser.vocabulary.getSymbolicName(token.type) : token.type;
8+
return `(${token.line}:${token.charPositionInLine}) [${typeTree}] ${JSON.stringify(token.text)}`;
89
}
910

10-
export function getCtxDebugInfo(ctx?: ParserRuleContext): string {
11+
export function getCtxDebugInfo(ctx: ParserRuleContext | undefined, parser?: Parser): string {
1112
if (typeof ctx === 'undefined') {
12-
return '';
13+
return 'null';
1314
}
14-
return `(${ctx.start.line}:${ctx.start.charPositionInLine}) "${ctx.text}"`;
15+
const typeTree = parser ? parser.ruleNames[ctx.ruleIndex] : ctx.ruleIndex;
16+
return `(${ctx.start.line}:${ctx.start.charPositionInLine}) [${typeTree}]`;
1517
}

0 commit comments

Comments
 (0)