Skip to content

Commit 403d665

Browse files
committed
Finish Hotfix-0.8.2
2 parents 1212ee3 + 4f83ac2 commit 403d665

File tree

100 files changed

+4510
-1947
lines changed

Some content is hidden

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

100 files changed

+4510
-1947
lines changed

.editorconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ indent_size = 4
99
[*.{js,ts}]
1010
charset = utf-8
1111

12+
[*.YAML-tmLanguage]
13+
indent_style = space
14+
indent_size = 2
15+
1216
[{.travis.yml}]
1317
indent_style = space
1418
indent_size = 2

.vscode/extensions.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"redhat.vscode-yaml",
44
"mike-lischke.vscode-antlr4",
55
"eliotvu.uc",
6-
"pedro-w.tmlanguage",
76
"amodio.tsl-problem-matcher",
87
"rbbit.typescript-hero",
98
"nicoespeon.abracadabra",

.vscode/settings.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,10 @@
3535
"unrealscript.checkTypes": true,
3636
"unrealscript.analyzeDocuments": "None",
3737
"unrealscript.generation": "3",
38+
"files.associations": {
39+
"*.YAML-tmLanguage": "yaml",
40+
},
41+
"yaml.schemas": {
42+
"https://json.schemastore.org/tmlanguage.json": "*.YAML-tmLanguage"
43+
}
3844
}

.vscode/tasks.json

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"type": "npm",
77
"script": "build",
88
"group": "build",
9-
"problemMatcher": "$esbuild",
9+
"problemMatcher": "$esbuild"
1010
},
1111
{
1212
"label": "npm: watch",
@@ -23,6 +23,40 @@
2323
"reveal": "never",
2424
"group": "watchers"
2525
}
26+
},
27+
{
28+
"label": "npm: test /syntaxes/",
29+
"type": "shell",
30+
"command": "npm test",
31+
"group": "test",
32+
"presentation": {
33+
"reveal": "always",
34+
"panel": "new"
35+
},
36+
"problemMatcher": {
37+
"owner": "vscode-tmgrammar-test",
38+
"fileLocation": [
39+
"relative",
40+
"${workspaceRoot}/syntaxes"
41+
],
42+
"pattern": [
43+
{
44+
"regexp": "^(ERROR)\\s([^:]+):(\\d+):(\\d+):(\\d+)\\s(.*)$",
45+
"severity": 1,
46+
"file": 2,
47+
"line": 3,
48+
"column": 4,
49+
"endColumn": 5,
50+
"message": 6
51+
}
52+
]
53+
},
54+
"runOptions": {
55+
"runOn": "folderOpen",
56+
},
57+
"options": {
58+
"cwd": "${workspaceRoot}/syntaxes"
59+
}
2660
}
2761
]
2862
}

CHANGELOG.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,29 @@
11
# UnrealScript Language Service
22

3+
## 0.8.2 (July 24, 2024)
4+
5+
This hotfix mostly addresses problems with type checking (when 'check types' is enabled) and other minor issues:
6+
7+
- Fixed [#190](https://github.com/EliotVU/UnrealScript-Language-Service/issues/190)
8+
- Fixed [#189](https://github.com/EliotVU/UnrealScript-Language-Service/issues/189)
9+
- Fixed [#188](https://github.com/EliotVU/UnrealScript-Language-Service/issues/188)
10+
- Fixed [#187](https://github.com/EliotVU/UnrealScript-Language-Service/issues/187)
11+
12+
In order to fix all of the listed issues above, the type checking had to be expanded to validate and consider 'variables' modifiers, and as a result more incompatible types should be reported; but this may also cause more false-positives to be reported in cases where the data is incomplete (i.e. macros)
13+
14+
- Fixed [#182; "Declaring static array size from variable fails in some cases"](https://github.com/EliotVU/UnrealScript-Language-Service/issues/182)
15+
16+
## 0.8.1 (Juni 16, 2024)
17+
18+
- (check types) Fixed false-positive `Type 'Object' and 'None' are incompatible with operator '!='`
19+
this occurred due a false 'same-cost' operator match for `Interface` types; furthermore supported type checking for `Interface` types.
20+
- (check types) Fixed false-positive `Type 'Struct' and 'Struct' are incompatible with operator '=='` this occurred when comparing structs that have no overloaded '=='
21+
- Fixed minor issues with completion suggestions, e.g. when writing `begin object name=<carret>` etc.
22+
- Fixed minor syntax highlighting issues, and added unit tests.
23+
- Fixed error popup 'names cannot be falsy' when writing multiple variables.
24+
- Fixed parenthesis `()` are no longer required for an `assert` statement.
25+
- Restricted grammar parsing of multiline assignments and parameter assignments to UE3 (set `generation` to 3 to enable)
26+
327
## 0.8.0 (Juni 7, 2024)
428

529
- Improvements made to type checking
@@ -19,7 +43,7 @@
1943
- Report if a deprecated `field` is referenced.
2044
- Report if an operator cannot be found.
2145
- (check types) Report if the operator is found, but no overload can be matched.
22-
- Report if a class type cannot be cast or assigned to an unrelated class type, also report if the cast is redundant.
46+
- (check types) Report if a class type cannot be cast or assigned to an unrelated class type, also report if the cast is redundant.
2347
- Quality of Life
2448
- General improvements made to parsing and indexing as to better align with the UnrealScript compiler's way of things.
2549
- If a `.uc` document has no `classes` in its path, then the containing directory's name will be used instead to represent the package name.

grammars/UCParser.g4

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -753,7 +753,7 @@ functionSpecifier
753753
functionName: identifier | operatorName;
754754

755755
parameters: paramDecl (COMMA paramDecl)*;
756-
paramDecl: paramModifier* typeDecl variable (ASSIGNMENT expr=expression)?;
756+
paramDecl: paramModifier* typeDecl variable ({ this.generation === 3 }? ASSIGNMENT expr=expression)?;
757757

758758
returnTypeModifier
759759
: 'coerce' // UC3+
@@ -888,8 +888,11 @@ breakStatement: 'break' SEMICOLON;
888888
continueStatement: 'continue' SEMICOLON;
889889
stopStatement: 'stop' SEMICOLON;
890890
labeledStatement: identifier COLON;
891+
// expr is not optional, but we need to ensure we match this statement for every 'goto' identifier.
892+
// expr=identifier? if generation pre-UC3.
891893
gotoStatement: 'goto' expr=expression? SEMICOLON;
892-
assertStatement: 'assert' (OPEN_PARENS expr=expression? CLOSE_PARENS) SEMICOLON;
894+
// expr is not optional, but we need to ensure we match this statement for every 'assert' identifier.
895+
assertStatement: 'assert' expr=expression? SEMICOLON;
893896

894897
// All valid operator names (for declarations)
895898
operatorName
@@ -959,8 +962,10 @@ primaryExpression
959962
| primaryExpression (OPEN_PARENS arguments? CLOSE_PARENS) #callExpression
960963
| primaryExpression (OPEN_BRACKET arg=expression? CLOSE_BRACKET) #elementAccessExpression
961964

962-
| 'new' (OPEN_PARENS arguments? CLOSE_PARENS)? expr=primaryExpression
963-
(OPEN_PARENS templateExpr=primaryExpression CLOSE_PARENS)? #newExpression
965+
| 'new' (OPEN_PARENS arguments CLOSE_PARENS)? expr=primaryExpression
966+
({ this.generation === 3 }?
967+
OPEN_PARENS templateExpr=primaryExpression CLOSE_PARENS
968+
)? #newExpression
964969
| 'class' (LT identifier GT) (OPEN_PARENS expr=expression CLOSE_PARENS) #metaClassExpression
965970
| 'arraycount' (OPEN_PARENS expr=primaryExpression CLOSE_PARENS) #arrayCountExpression
966971
| 'super' (OPEN_PARENS identifier CLOSE_PARENS)? #superExpression
@@ -1108,7 +1113,11 @@ defaultConstantArgument
11081113
;
11091114

11101115
defaultAssignmentExpression
1111-
: defaultExpression ASSIGNMENT ((OPEN_BRACE defaultValue? CLOSE_BRACE) | defaultValue)
1116+
: defaultExpression ASSIGNMENT
1117+
(
1118+
({ this.generation === 3 }? (OPEN_BRACE defaultValue? CLOSE_BRACE))
1119+
| defaultValue
1120+
)
11121121
;
11131122

11141123
defaultMemberCallExpression

grammars/examples/Classes/AmbiguousCallTest.uc

Lines changed: 0 additions & 7 deletions
This file was deleted.

grammars/examples/Classes/AmbiguousCastTest.uc

Lines changed: 0 additions & 13 deletions
This file was deleted.

grammars/examples/Classes/DelegateTest.uc

Lines changed: 0 additions & 131 deletions
This file was deleted.

0 commit comments

Comments
 (0)