Skip to content

Commit

Permalink
Finish pre-release-0.6.2
Browse files Browse the repository at this point in the history
  • Loading branch information
EliotVU committed Feb 9, 2023
2 parents 525e14e + f6e5f29 commit 42f5902
Show file tree
Hide file tree
Showing 66 changed files with 2,294 additions and 1,284 deletions.
3 changes: 2 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"eliotvu.uc",
"pedro-w.tmlanguage",
"amodio.tsl-problem-matcher",
"rbbit.typescript-hero"
"rbbit.typescript-hero",
"nicoespeon.abracadabra"
]
}
15 changes: 12 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,31 @@
{
"typescript.preferences.quoteStyle": "single",
"typescriptHero.imports.organizeOnSave": true,
"antlr4.generation": {
"language": "TypeScript",
"outputDir": "grammars"
},
"mochaExplorer.nodePath": null,
"mochaExplorer.cwd": "server",
"mochaExplorer.mochaPath": "server/node_modules/mocha",
"mochaExplorer.require": "ts-node/register",
"mochaExplorer.files": "**/*.test.ts",
"mochaExplorer.require": "node_modules/ts-node/register",
"mochaExplorer.files": "server/**/*.test.ts",
"mochaExplorer.ignore": "server/node_modules/**/*.test.ts",
// "mochaExplorer.launcherScript": "node_modules/mocha-explorer-launcher-scripts/vscode-test",
"mochaExplorer.autoload": false,
"mochaExplorer.esmLoader": false,
// "mochaExplorer.ipcRole": "server",
"mochaExplorer.env": {
"TS_NODE_COMPILER_OPTIONS": "{\"module\":\"commonjs\",\"strict\":false}",
// "VSCODE_VERSION": "insiders",
"ELECTRON_RUN_AS_NODE": null
},
"mochaExplorer.globImplementation": "vscode",
// "mochaExplorer.logpanel": true,
"cSpell.words": [
"antlr",
"diagnoser",
"Intrinsics",
"Vect"
],
"typescriptHero.imports.organizeOnSave": true,
}
58 changes: 40 additions & 18 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
# UnrealScript Language Service

## 0.6.2 (Feb 9, 2023)

- Implemented an option to enable auto-detection of the UnrealScript language generation that's being used by the workspace.
- Implemented a new code-action to inline a constant's evaluated value.

- Quality of Life
- General improvements to how indexing of documents is handled.
- Fixed parser support for string types that have a fixed size e.g. ```String[255]``` (UE1).
- Fixed type ```Pointer``` will be no longer recognized if the language is set to generation 3 (this has been displaced by the Core.Object.Pointer struct).
- Fixed [No symbols found](https://github.com/EliotVU/UnrealScript-Language-Service/issues/157)

- Known Issues:
-

## 0.6.1 (Jan 29, 2023)

- The service will now register .u/.upk (the extensions are configurable) files as known package symbols, this means such packages will be included in the auto-completion and indexing of references.
- Note: The contents of the packages are not yet indexed.

- Implemented [Auto-insert when overriding a function](https://github.com/EliotVU/UnrealScript-Language-Service/issues/153).
- Further improvements have been made to the auto-completion suggestions.

## 0.6.0 (Jan 26, 2023)

- 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)
Expand All @@ -8,26 +30,26 @@
- Implemented [LSP Workspace Symbols #148](https://github.com/EliotVU/UnrealScript-Language-Service/issues/148)
- ![image](./docs/media/workspaceSymbols.png)

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

- Typing, major improvements have been made to the type-checking system, there are almost no false-positive errors anymore!
- Archetypes, overall better support for "begin object" constructions
- Better and more responsive auto-completion suggestions
- Archetypes, overall better support for "begin object" constructions.
- Better and more responsive auto-completion suggestions.

- Quality of Life
- Overall improvements have been made to UnrealScript parsing
- Overall improvements to UnrealScript syntax highlighting
- Fixed [(DefaultProperties) Issue with structs written on multiple lines](https://github.com/EliotVU/UnrealScript-Language-Service/issues/138)
- Fixed an issue where a Function call in a member context ```Outer.SomeIdentifier(...)``` could mismatch a Class's name
- Partially fixed an issue (in some cases) where a Function/Class invocation could be mistaken for one another
- Fixed LSP/documentSymbol [VSCode's Sticky scroll feature](https://github.com/EliotVU/UnrealScript-Language-Service/issues/148)
- Overall improvements have been made to UnrealScript parsing.
- Overall improvements to UnrealScript syntax highlighting.
- Fixed [(DefaultProperties) Issue with structs written on multiple lines](https://github.com/EliotVU/UnrealScript-Language-Service/issues/138).
- Fixed an issue where a Function call in a member context ```Outer.SomeIdentifier(...)``` could mismatch a Class's name.
- Partially fixed an issue (in some cases) where a Function/Class invocation could be mistaken for one another.
- Fixed LSP/documentSymbol [VSCode's Sticky scroll feature](https://github.com/EliotVU/UnrealScript-Language-Service/issues/148).
- 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).

## 0.5.0 (Nov 8, 2021)

- Autocomplete and IntelliSense
- Has been displaced with the help of a third-party library [c3](https://github.com/mike-lischke/antlr4-c3)
- This switch has made it much easier to implement context-aware autocompletes, but more work will be needed to bring it the quality that we all take for granted in popular languages :)
- Has been displaced with the help of a third-party library [c3](https://github.com/mike-lischke/antlr4-c3).
- This switch has made it much easier to implement context-aware autocompletes, but more work will be needed to bring it the quality that we all take for granted in popular languages.

- Added the first CodeAction
- If a type is missing where a class type is expected, the service will now suggest to generate the class for you.
Expand Down Expand Up @@ -63,10 +85,10 @@
This option tells the service which UnrealScript edition it should optimize for.

- Quality of Life
- Fixed [Closing unopened comment](https://github.com/EliotVU/UnrealScript-Language-Service/issues/28)
- Fixed ["default:" is not highlighted](https://github.com/EliotVU/UnrealScript-Language-Service/issues/22)
- Fixed ["Spawn" return type is not coerced to its first parameter's type. #21](https://github.com/EliotVU/UnrealScript-Language-Service/issues/21)
- Fixed ["no viable alternative at input 'return A -='"](https://github.com/EliotVU/UnrealScript-Language-Service/issues/20)
- Fixed [Highlighting issue regarding a comment if on the same line as a struct declaration #19](https://github.com/EliotVU/UnrealScript-Language-Service/issues/19)
- Fixed [Class and package name confusion](https://github.com/EliotVU/UnrealScript-Language-Service/issues/15)
- Fixed ["const ref" argument confusing the parser](https://github.com/EliotVU/UnrealScript-Language-Service/issues/14)
- Fixed [Closing unopened comment](https://github.com/EliotVU/UnrealScript-Language-Service/issues/28).
- Fixed ["default:" is not highlighted](https://github.com/EliotVU/UnrealScript-Language-Service/issues/22).
- Fixed ["Spawn" return type is not coerced to its first parameter's type. #21](https://github.com/EliotVU/UnrealScript-Language-Service/issues/21).
- Fixed ["no viable alternative at input 'return A -='"](https://github.com/EliotVU/UnrealScript-Language-Service/issues/20).
- Fixed [Highlighting issue regarding a comment if on the same line as a struct declaration #19](https://github.com/EliotVU/UnrealScript-Language-Service/issues/19).
- Fixed [Class and package name confusion](https://github.com/EliotVU/UnrealScript-Language-Service/issues/15).
- Fixed ["const ref" argument confusing the parser](https://github.com/EliotVU/UnrealScript-Language-Service/issues/14).
30 changes: 18 additions & 12 deletions grammars/UCParser.g4
Original file line number Diff line number Diff line change
Expand Up @@ -542,19 +542,13 @@ variableModifier
| ('privatewrite' exportBlockText?)
;

primitiveType
: 'byte'
| 'int'
| 'float'
| 'bool'
| 'string'
| 'name'
| 'pointer'
| 'button' // alias for a string with an input modifier
varType
: variableModifier* typeDecl
;

typeDecl
: primitiveType
| stringType
| classType
| arrayType
| delegateType
Expand All @@ -564,10 +558,20 @@ typeDecl
| qualifiedIdentifier
;

varType
: variableModifier* typeDecl
primitiveType
: 'byte'
| 'int'
| 'float'
| 'bool'
| 'name'
| 'pointer'
| 'button' // alias for a string with an input modifier
;

stringType
: 'string' (OPEN_BRACKET INTEGER_LITERAL CLOSE_BRACKET)?
;

// Note: inlinedDeclTypes includes another arrayGeneric!
arrayType
: 'array' (LT varType GT)
Expand Down Expand Up @@ -738,7 +742,7 @@ codeBlockOptional
;

statement
: SEMICOLON
: emptyStatement
| ifStatement
| forStatement
| foreachStatement
Expand All @@ -762,6 +766,8 @@ statement
| directive
;

emptyStatement: SEMICOLON;

assignmentStatement: expr=assignmentExpression SEMICOLON;
expressionStatement: expr=primaryExpression SEMICOLON;

Expand Down
41 changes: 41 additions & 0 deletions grammars/test/Grammar.uc
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
class Grammar;

const C1 = 0;

enum E1 {
E1_1,
E1_2,
};

struct S1 {
struct S2 {
var int V1;
};

var enum E2 {
E2_1
} V2;

var int V3;
};

var int V4;

delegate D1();

function F1();

state ST1
{
ignores F1;

function F2();

begin:
F2();
}

defaultproperties
{
V4=1
}
File renamed without changes.
Loading

3 comments on commit 42f5902

@Shtoyan
Copy link
Contributor

@Shtoyan Shtoyan commented on 42f5902 Feb 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@EliotVU something is very wrong with this version.

I'm opening kf1 sources without any mods and what i get:

image

And you can not click-open on Actors parent Object class.

@EliotVU
Copy link
Owner Author

@EliotVU EliotVU commented on 42f5902 Feb 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. It seemed to work fine on UDK's source.

I have tried the KF1 source that you linked and can indeed confirm that it's broken, apparently it halts as soon as it tries to lexer an #exec directive:

Processing pending document "file:///c%3A/Projecten/KF1/KillingFloor/Engine/Classes/Actor.uc":4, source:change.
Invalidating document "Actor".
building document Actor
PredictionMode SLL has failed, rolling back to LL.
An error was thrown while parsing document: "file:///c%3A/Projecten/KF1/KillingFloor/Engine/Classes/Actor.uc" RangeError: token index 64 out of range 0..63
    at UCTokenStream.get (c:\Projecten\UnrealScriptLang\out\server.js:28929:19)
    at UCParser.skipLine (c:\Projecten\UnrealScriptLang\out\server.js:5396:33)
    at UCParser.directive (c:\Projecten\UnrealScriptLang\out\server.js:5523:22)
    at UCParser.member (c:\Projecten\UnrealScriptLang\out\server.js:5690:30)
    at UCParser.program (c:\Projecten\UnrealScriptLang\out\server.js:5560:42)
    at UCDocument.build (c:\Projecten\UnrealScriptLang\out\server.js:20637:34)
    at indexDocument (c:\Projecten\UnrealScriptLang\out\server.js:24216:18)
    at Object.next (c:\Projecten\UnrealScriptLang\out\server.js:26635:41)

Odd given that I hadn't changed anything in relation to that 🤣 Anyway, I'll try to fix it tomorrow.

@Shtoyan
Copy link
Contributor

@Shtoyan Shtoyan commented on 42f5902 Feb 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Classic moment, when you fix stuff and something very different breaks 😅

Please sign in to comment.