Skip to content

Commit 4136f7d

Browse files
authored
Remove long-time deprecated properties (#1991)
1 parent 9f4729b commit 4136f7d

File tree

5 files changed

+3
-40
lines changed

5 files changed

+3
-40
lines changed

packages/langium/src/lsp/semantic-token-provider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export const AllSemanticTokenModifiers: Record<string, number> = {
5858
};
5959

6060
/**
61-
* @deprecated `SemanticTokenProvider` now supplies its own options.
61+
* @deprecated Since 3.2.0. `SemanticTokenProvider` now supplies its own options.
6262
*/
6363
export const DefaultSemanticTokenOptions: SemanticTokensOptions = {
6464
legend: {

packages/langium/src/parser/cst-node-builder.ts

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -115,16 +115,6 @@ export abstract class AbstractCstNode implements CstNode {
115115
root: RootCstNode;
116116
private _astNode?: AstNode;
117117

118-
/** @deprecated use `container` instead. */
119-
get parent(): CompositeCstNode | undefined {
120-
return this.container;
121-
}
122-
123-
/** @deprecated use `grammarSource` instead. */
124-
get feature(): AbstractElement | undefined {
125-
return this.grammarSource;
126-
}
127-
128118
get hidden(): boolean {
129119
return false;
130120
}
@@ -141,11 +131,6 @@ export abstract class AbstractCstNode implements CstNode {
141131
this._astNode = value;
142132
}
143133

144-
/** @deprecated use `astNode` instead. */
145-
get element(): AstNode {
146-
return this.astNode;
147-
}
148-
149134
get text(): string {
150135
return this.root.fullText.substring(this.offset, this.end);
151136
}
@@ -196,11 +181,6 @@ export class CompositeCstNodeImpl extends AbstractCstNode implements CompositeCs
196181
readonly content: CstNode[] = new CstNodeContainer(this);
197182
private _rangeCache?: Range;
198183

199-
/** @deprecated use `content` instead. */
200-
get children(): CstNode[] {
201-
return this.content;
202-
}
203-
204184
get offset(): number {
205185
return this.firstNonHiddenNode?.offset ?? 0;
206186
}

packages/langium/src/service-registry.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export class DefaultServiceRegistry implements ServiceRegistry {
4646
protected readonly fileNameMap = new Map<string, LangiumCoreServices>();
4747

4848
/**
49-
* @deprecated Use the new `fileExtensionMap` (or `languageIdMap`) property instead.
49+
* @deprecated Since 3.1.0. Use the new `fileExtensionMap` (or `languageIdMap`) property instead.
5050
*/
5151
protected get map(): Map<string, LangiumCoreServices> | undefined {
5252
return this.fileExtensionMap;

packages/langium/src/syntax-tree.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -303,20 +303,14 @@ export type PropertyType = number | string | boolean | PropertyType[];
303303
export interface CstNode extends DocumentSegment {
304304
/** The container node in the CST */
305305
readonly container?: CompositeCstNode;
306-
/** @deprecated use `container` instead. */
307-
readonly parent?: CompositeCstNode;
308306
/** The actual text */
309307
readonly text: string;
310308
/** The root CST node */
311309
readonly root: RootCstNode;
312310
/** The grammar element from which this node was parsed */
313311
readonly grammarSource?: AbstractElement;
314-
/** @deprecated use `grammarSource` instead. */
315-
readonly feature?: AbstractElement;
316312
/** The AST node created from this CST node */
317313
readonly astNode: AstNode;
318-
/** @deprecated use `astNode` instead. */
319-
readonly element: AstNode;
320314
/** Whether the token is hidden, i.e. not explicitly part of the containing grammar rule */
321315
readonly hidden: boolean;
322316
}
@@ -326,8 +320,6 @@ export interface CstNode extends DocumentSegment {
326320
*/
327321
export interface CompositeCstNode extends CstNode {
328322
readonly content: CstNode[];
329-
/** @deprecated use `content` instead. */
330-
readonly children: CstNode[];
331323
}
332324

333325
export function isCompositeCstNode(node: unknown): node is CompositeCstNode {

packages/langium/src/test/langium-test.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,19 +49,10 @@ export function parseHelper<T extends AstNode = AstNode>(services: LangiumCoreSe
4949

5050
export type ExpectFunction = (actual: unknown, expected: unknown, message?: string) => void;
5151

52-
let expectedFunction: ExpectFunction = (actual, expected, message) => {
52+
const expectedFunction: ExpectFunction = (actual, expected, message) => {
5353
assert.deepStrictEqual(actual, expected, message);
5454
};
5555

56-
/**
57-
* Overrides the assertion function used by tests. Uses `assert.deepStrictEqual` by default
58-
*
59-
* @deprecated Since 1.2.0. Do not override the assertion functionality.
60-
*/
61-
export function expectFunction(functions: ExpectFunction): void {
62-
expectedFunction = functions;
63-
}
64-
6556
export interface ExpectedBase {
6657
/**
6758
* Document content.

0 commit comments

Comments
 (0)