Skip to content

Commit

Permalink
Finish Release-0.6.4
Browse files Browse the repository at this point in the history
  • Loading branch information
EliotVU committed Feb 16, 2023
2 parents 42f5902 + b9c4765 commit 9352221
Show file tree
Hide file tree
Showing 46 changed files with 1,272 additions and 802 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"@typescript-eslint/no-unused-vars": 0,
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/explicit-module-boundary-types": 0,
"@typescript-eslint/no-non-null-assertion": 0
"@typescript-eslint/no-non-null-assertion": 0,
"no-inner-declarations": "off"
}
}
16 changes: 13 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# UnrealScript Language Service

## 0.6.4 (Feb 16, 2023)

- Fixed [Class-function field hint](https://github.com/EliotVU/UnrealScript-Language-Service/issues/161).
- Fixed [Type checking error when passing an Enum object to a function as argument](https://github.com/EliotVU/UnrealScript-Language-Service/issues/166).
- Fixed [Enum tag reference in a condition expression produces an error when type checking is enabled](https://github.com/EliotVU/UnrealScript-Language-Service/issues/167).
- Fixed [Request textDocument/documentSymbol failed](https://github.com/EliotVU/UnrealScript-Language-Service/issues/169).
- [Add a new diagnostic for UC3 enum based element dimensions; and fix the misplaced range for array dimension diagnostics.](https://github.com/EliotVU/UnrealScript-Language-Service/commit/97e7b1ec9dbd62ae98c81f473a79f20826f18ac5).
- [Fail auto detection when no Object.uc document is present](https://github.com/EliotVU/UnrealScript-Language-Service/commit/1d64bc3771c5e23fa34f9624962e6567d197e879).

## 0.6.3 (Feb 10, 2023)

- Fixed an issue with skipLine() failing on UnrealScript directives i.e. "#exec obj load ..."

## 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.
Expand All @@ -11,9 +24,6 @@
- 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.
Expand Down
8 changes: 7 additions & 1 deletion grammars/UCParser.g4
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,13 @@ options {
let token;
do {
token = this._input.get(i++);
} while (token.type !== UCParser.NEWLINE && token.type !== UCParser.EOF)
// We cannot consume an EOF token.
if (token.type === UCParser.EOF) {
break;
}
// We need to consume, incase the stream is not filled yet.
this._input.consume();
} while (token.type !== UCParser.NEWLINE)
this._input.seek(i);
}

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

#exec obj load package=filepath

const C1 = 0;

enum E1 {
Expand Down
182 changes: 91 additions & 91 deletions package-lock.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "uc",
"description": "UnrealScript Language support",
"displayName": "UnrealScript",
"version": "0.6.2",
"version": "0.6.4",
"author": {
"name": "Eliot van Uytfanghe",
"url": "https://EliotVU.com"
Expand Down Expand Up @@ -50,11 +50,11 @@
"devDependencies": {
"@tsconfig/recommended": "^1.0.2",
"@types/node": "^18.13.0",
"@typescript-eslint/eslint-plugin": "^5.51.0",
"@typescript-eslint/parser": "^5.51.0",
"@typescript-eslint/eslint-plugin": "^5.52.0",
"@typescript-eslint/parser": "^5.52.0",
"antlr4ts-cli": "0.5.0-alpha.4",
"copy-webpack-plugin": "^11.0.0",
"eslint": "^8.33.0",
"eslint": "^8.34.0",
"gulp": "^4.0.2",
"js-yaml": "^4.1.0",
"merge-options": "^3.0.4",
Expand Down
66 changes: 33 additions & 33 deletions server/package-lock.json

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

4 changes: 2 additions & 2 deletions server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"author": "Eliot van Uytfanghe",
"publisher": "EliotVU",
"license": "MIT",
"version": "0.6.2",
"version": "0.6.4",
"repository": {
"type": "git",
"url": "https://github.com/EliotVU/UnrealScript-Language-Service"
Expand All @@ -22,7 +22,7 @@
"crc-32": "^1.2.2",
"glob": "^8.1.0",
"rxjs": "^7.8.0",
"vscode-languageserver": "^8.0.2",
"vscode-languageserver": "^8.1.0",
"vscode-languageserver-textdocument": "^1.0.8"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions server/src/UC/Parser/Parser.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function parseText(text: string): UCParser {
const inputStream = UCInputStream.fromString(text);
const lexer = new UCLexer(inputStream);
const tokens = new UCTokenStream(lexer);
tokens.fill();
// tokens.fill();

const parser = new UCParser(tokens);
return parser;
Expand Down Expand Up @@ -51,7 +51,7 @@ function parseExec(parser: UCParser): { errors: string[] } {

describe('Grammar', () => {
it('should have no syntax errors', () => {
const tests = ['parser.constDecl.uc', 'parser.defaultPropertiesBlock.uc'];
const tests = ['Grammar.uc', 'parser.constDecl.uc', 'parser.defaultPropertiesBlock.uc'];
for (const testFileName of tests) {
const text = getText(resolveExampleFileName(testFileName));
const p = parseText(text);
Expand Down
24 changes: 12 additions & 12 deletions server/src/UC/Symbols/ArrayOperations.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import { toName } from '../name';
import { NAME_ARRAY } from '../names';
import {
DEFAULT_RANGE, ModifierFlags, StaticIntType, StaticMetaType, UCMethodLikeSymbol, UCParamSymbol,
UCStructSymbol
DEFAULT_RANGE,
ModifierFlags,
StaticIntType,
StaticMetaType,
UCMethodLikeSymbol,
UCParamSymbol,
UCStructSymbol,
} from './';

/** (defaultproperties) Acts as a template for array operations such as MyArray.Replace(item1, item2) etc. */
Expand All @@ -15,34 +20,29 @@ DefaultArray.addSymbol(EmptyOperation);

const AddOperation = new UCMethodLikeSymbol(toName('Add'));
AddOperation.modifiers |= ModifierFlags.Intrinsic | ModifierFlags.Keyword;
const AddElementParam = new UCParamSymbol({ name: toName('Element'), range: DEFAULT_RANGE });
AddElementParam.type = StaticMetaType;
const AddElementParam = new UCParamSymbol({ name: toName('Element'), range: DEFAULT_RANGE }, DEFAULT_RANGE, StaticMetaType);
AddOperation.addSymbol(AddElementParam);
AddOperation.params = [AddElementParam];
DefaultArray.addSymbol(AddOperation);

const RemoveOperation = new UCMethodLikeSymbol(toName('Remove'));
RemoveOperation.modifiers |= ModifierFlags.Intrinsic | ModifierFlags.Keyword;
const RemoveElementParam = new UCParamSymbol({ name: toName('Element'), range: DEFAULT_RANGE });
RemoveElementParam.type = StaticMetaType;
const RemoveElementParam = new UCParamSymbol({ name: toName('Element'), range: DEFAULT_RANGE }, DEFAULT_RANGE, StaticMetaType);
RemoveOperation.addSymbol(RemoveElementParam);
RemoveOperation.params = [RemoveElementParam];
DefaultArray.addSymbol(RemoveOperation);

const RemoveIndexOperation = new UCMethodLikeSymbol(toName('RemoveIndex'));
RemoveIndexOperation.modifiers |= ModifierFlags.Intrinsic | ModifierFlags.Keyword;
const RemoveIndexParam = new UCParamSymbol({ name: toName('Index'), range: DEFAULT_RANGE });
RemoveIndexParam.type = StaticIntType;
const RemoveIndexParam = new UCParamSymbol({ name: toName('Index'), range: DEFAULT_RANGE }, DEFAULT_RANGE, StaticIntType);
RemoveIndexOperation.addSymbol(RemoveIndexParam);
RemoveIndexOperation.params = [RemoveIndexParam];
DefaultArray.addSymbol(RemoveIndexOperation);

const ReplaceOperation = new UCMethodLikeSymbol(toName('Replace'));
ReplaceOperation.modifiers |= ModifierFlags.Intrinsic | ModifierFlags.Keyword;
const ReplaceElement1Param = new UCParamSymbol({ name: toName('Element1'), range: DEFAULT_RANGE });
ReplaceElement1Param.type = StaticMetaType;
const ReplaceElement2Param = new UCParamSymbol({ name: toName('Element2'), range: DEFAULT_RANGE });
ReplaceElement2Param.type = StaticMetaType;
const ReplaceElement1Param = new UCParamSymbol({ name: toName('Element1'), range: DEFAULT_RANGE }, DEFAULT_RANGE, StaticMetaType);
const ReplaceElement2Param = new UCParamSymbol({ name: toName('Element2'), range: DEFAULT_RANGE }, DEFAULT_RANGE, StaticMetaType);
ReplaceOperation.addSymbol(ReplaceElement1Param);
ReplaceOperation.addSymbol(ReplaceElement2Param);
ReplaceOperation.params = [ReplaceElement1Param, ReplaceElement2Param];
Expand Down
4 changes: 3 additions & 1 deletion server/src/UC/Symbols/ClassSymbol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ export class UCClassSymbol extends UCStructSymbol {
| 1 << UCSymbolKind.Enum
| 1 << UCSymbolKind.ScriptStruct
| 1 << UCSymbolKind.Property
| 1 << UCSymbolKind.Function;
| 1 << UCSymbolKind.Function
| 1 << UCSymbolKind.Event
| 1 << UCSymbolKind.Delegate;

declare outer: UCPackage;
declare super?: UCClassSymbol;
Expand Down
27 changes: 21 additions & 6 deletions server/src/UC/Symbols/CoreSymbols.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,14 @@ import {
NAME_PACKAGE,
NAME_POINTERPROPERTY,
NAME_PROPERTY,
NAME_ROTATOR,
NAME_SCRIPTSTRUCT,
NAME_STATE,
NAME_STRINGPROPERTY,
NAME_STRPROPERTY,
NAME_STRUCT,
NAME_STRUCTPROPERTY,
NAME_VECTOR,
} from '../names';
import {
addHashedSymbol,
Expand All @@ -40,6 +42,7 @@ import {
UCClassSymbol,
UCPackage,
UCPropertySymbol,
UCScriptStructSymbol,
} from './';

export const CORE_PACKAGE = new UCPackage(NAME_CORE);
Expand All @@ -49,20 +52,32 @@ export const IntrinsicObject = new UCClassSymbol({ name: NAME_OBJECT, range: DEF
IntrinsicObject.modifiers |= ModifierFlags.Native | ModifierFlags.Abstract;
IntrinsicObject.outer = CORE_PACKAGE;

export const Object_OuterProperty = new UCPropertySymbol({ name: NAME_OUTER, range: DEFAULT_RANGE });
export const IntrinsicVector = new UCScriptStructSymbol({ name: NAME_VECTOR, range: DEFAULT_RANGE });
IntrinsicVector.outer = IntrinsicObject;

export const IntrinsicRotator = new UCScriptStructSymbol({ name: NAME_ROTATOR, range: DEFAULT_RANGE });
IntrinsicRotator.outer = IntrinsicObject;

export const Object_OuterProperty = new UCPropertySymbol(
{ name: NAME_OUTER, range: DEFAULT_RANGE },
DEFAULT_RANGE, StaticObjectType);
Object_OuterProperty.modifiers |= ModifierFlags.Native;
Object_OuterProperty.type = StaticObjectType;
Object_OuterProperty.outer = IntrinsicObject;
IntrinsicObject.addSymbol(Object_OuterProperty);

export const Object_NameProperty = new UCPropertySymbol({ name: NAME_NAME, range: DEFAULT_RANGE });
export const Object_NameProperty = new UCPropertySymbol(
{ name: NAME_NAME, range: DEFAULT_RANGE },
DEFAULT_RANGE, StaticNameType);
Object_NameProperty.modifiers |= ModifierFlags.Native;
Object_NameProperty.type = StaticNameType;
Object_NameProperty.outer = IntrinsicObject;
IntrinsicObject.addSymbol(Object_NameProperty);

export const Object_ClassProperty = new UCPropertySymbol({ name: NAME_CLASS, range: DEFAULT_RANGE });
export const Object_ClassProperty = new UCPropertySymbol(
{ name: NAME_CLASS, range: DEFAULT_RANGE },
DEFAULT_RANGE, StaticObjectType);
Object_ClassProperty.modifiers |= ModifierFlags.Native;
Object_ClassProperty.type = StaticObjectType;
Object_ClassProperty.outer = IntrinsicObject;
IntrinsicObject.addSymbol(Object_ClassProperty);

export const IntrinsicField = new UCClassSymbol({ name: NAME_FIELD, range: DEFAULT_RANGE });
IntrinsicField.modifiers |= ModifierFlags.Intrinsic;
Expand Down
Loading

0 comments on commit 9352221

Please sign in to comment.