Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions packages/compiler/src/expression_parser/ast.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export class Chain extends AST {
constructor(
span: ParseSpan,
sourceSpan: AbsoluteSourceSpan,
public expressions: any[],
public expressions: AST[],
) {
super(span, sourceSpan);
}
Expand Down Expand Up @@ -181,7 +181,7 @@ export class BindingPipe extends ASTWithName {
sourceSpan: AbsoluteSourceSpan,
public exp: AST,
public name: string,
public args: any[],
public args: AST[],
readonly type: BindingPipeType,
nameSpan: AbsoluteSourceSpan,
) {
Expand All @@ -196,7 +196,7 @@ export class LiteralPrimitive extends AST {
constructor(
span: ParseSpan,
sourceSpan: AbsoluteSourceSpan,
public value: any,
public value: string | number | boolean | null | undefined,
) {
super(span, sourceSpan);
}
Expand All @@ -209,7 +209,7 @@ export class LiteralArray extends AST {
constructor(
span: ParseSpan,
sourceSpan: AbsoluteSourceSpan,
public expressions: any[],
public expressions: AST[],
) {
super(span, sourceSpan);
}
Expand All @@ -229,7 +229,7 @@ export class LiteralMap extends AST {
span: ParseSpan,
sourceSpan: AbsoluteSourceSpan,
public keys: LiteralMapKey[],
public values: any[],
public values: AST[],
) {
super(span, sourceSpan);
}
Expand Down
5 changes: 2 additions & 3 deletions packages/language-service/src/references_and_rename_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -387,13 +387,12 @@ export function getRenameTextAndSpanAtPosition(
return getRenameTextAndSpanAtPosition(node.left, position);
} else if (node instanceof LiteralPrimitive) {
const span = toTextSpan(node.sourceSpan);
const text = node.value;
if (typeof text === 'string') {
if (typeof node.value === 'string') {
// The span of a string literal includes the quotes but they should be removed for renaming.
span.start += 1;
span.length -= 2;
}
return {text, span};
return {text: `${node.value}`, span};
} else if (node instanceof TmplAstElement || node instanceof TmplAstDirective) {
return {text: node.name, span: toTextSpan(node.startSourceSpan)};
} else if (node instanceof TmplAstComponent) {
Expand Down