Skip to content

Commit 501aa98

Browse files
Updated to Langium 3.5 for the upcoming v0.2.2 (#88)
# Conflicts: # examples/lox/package.json # examples/ox/package.json # package-lock.json # packages/typir-langium/package.json
1 parent 1a73bd2 commit 501aa98

File tree

7 files changed

+46
-57
lines changed

7 files changed

+46
-57
lines changed

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ We roughly follow the ideas of [semantic versioning](https://semver.org/).
44
Note that the versions "0.x.0" probably will include breaking changes.
55

66

7+
## v0.2.2 (2025-07-??)
8+
9+
- Fixed wrong imports of `assertUnreachable` (#86)
10+
- Copy instead of reuse arrays with language keys to prevent side effects (#87)
11+
- Updated Typir-Langium to Langium v3.5 (#88)
12+
13+
714
## v0.2.1 (2025-04-09)
815

916
- Export `test-utils.ts` which are using `vitest` via the new namespace `'typir/test'` in order to not pollute production code with vitest dependencies (#68)
@@ -27,7 +34,7 @@ Note that the versions "0.x.0" probably will include breaking changes.
2734
- Thanks to the new chaining API for defining types (see corresponding breaking changes below), they can be annotated in TypeScript-type-safe way with multiple inference rules, e.g. multiple inference rules for class literals with `typir.factory.Classes.create({...}).inferenceRuleForClassLiterals({...}).inferenceRuleForClassLiterals({...}).finish();` (#64).
2835
- Provide new `expectValidationIssues*(...)` utilities for developers to ease the writing of test cases for Typir-based type systems (#64).
2936
- Create the predefined validations using the factory API, e.g. `typir.factory.Functions.createUniqueFunctionValidation()` and `typir.factory.Classes.createNoSuperClassCyclesValidation()`, see LOX for examples. Benefits of this design decision: the returned rule is easier to exchange, users can use the known factory API with auto-completion (no need to remember the names of the validations) (#64)
30-
- Updated Langium-Typir to Langium v3.4 (#65)
37+
- Updated Typir-Langium to Langium v3.4 (#65)
3138

3239
### Breaking changes
3340

examples/lox/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@
2929
},
3030
"dependencies": {
3131
"commander": "~12.1.0",
32-
"langium": "~3.4.0",
32+
"langium": "~3.5.0",
3333
"typir-langium": "~0.2.1",
3434
"vscode-languageclient": "~9.0.1",
3535
"vscode-languageserver": "~9.0.1"
3636
},
3737
"devDependencies": {
3838
"@types/vscode": "~1.94.0",
39-
"langium-cli": "~3.4.0"
39+
"langium-cli": "~3.5.2"
4040
},
4141
"files": [
4242
"bin",

examples/ox/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@
2929
},
3030
"dependencies": {
3131
"commander": "~12.1.0",
32-
"langium": "~3.4.0",
32+
"langium": "~3.5.0",
3333
"typir-langium": "~0.2.1",
3434
"vscode-languageclient": "~9.0.1",
3535
"vscode-languageserver": "~9.0.1"
3636
},
3737
"devDependencies": {
3838
"@types/vscode": "~1.94.0",
39-
"langium-cli": "~3.4.0"
39+
"langium-cli": "~3.5.2"
4040
},
4141
"files": [
4242
"bin",

package-lock.json

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

packages/typir-langium/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
},
5050
"bugs": "https://github.com/TypeFox/typir/issues",
5151
"dependencies": {
52-
"langium": "~3.4.0",
52+
"langium": "~3.5.0",
5353
"typir": "~0.2.1"
5454
}
5555
}

packages/typir/src/services/inference.ts

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -146,24 +146,6 @@ export class DefaultTypeInferenceCollector<LanguageType> implements TypeInferenc
146146
this.ruleRegistry.addListener(this);
147147
}
148148

149-
protected getTypeInferenceRuleOptions(options?: Partial<TypeInferenceRuleOptions>): TypeInferenceRuleOptions {
150-
return {
151-
// default values ...
152-
languageKey: undefined,
153-
boundToType: undefined,
154-
// ... overridden by the actual options:
155-
...options,
156-
};
157-
}
158-
159-
protected getLanguageKeys(options?: Partial<TypeInferenceRuleOptions>): Array<string|undefined> {
160-
if (options === undefined || options.languageKey === undefined) {
161-
return [undefined];
162-
} else {
163-
return toArray(options.languageKey);
164-
}
165-
}
166-
167149
addInferenceRule<InputType extends LanguageType = LanguageType>(rule: TypeInferenceRule<LanguageType, InputType>, givenOptions?: Partial<TypeInferenceRuleOptions>): void {
168150
this.ruleRegistry.addRule(rule as unknown as TypeInferenceRule<LanguageType>, givenOptions);
169151
}

packages/typir/src/services/operator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ function toSignatureArray<T>(values: {
322322
signature?: T;
323323
signatures?: T[];
324324
}): T[] {
325-
const result = [...toArray(values.signatures)]; // create a new array in order to prevent side-effects in the given array
325+
const result = toArray(values.signatures, { newArray: true }); // create a new array in order to prevent side-effects in the given array
326326
if (values.signature) {
327327
result.push(values.signature);
328328
}

0 commit comments

Comments
 (0)