Skip to content

Commit

Permalink
fix(type_tracing): range for default decl should be the decl range (#301
Browse files Browse the repository at this point in the history
)
  • Loading branch information
dsherret authored Oct 9, 2023
1 parent 9b71ac2 commit 5ccfa34
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion src/type_tracer/analyzer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1074,7 +1074,7 @@ impl<'a, THandler: TypeTraceHandler> SymbolFiller<'a, THandler> {
id.clone(),
SymbolDecl {
kind: SymbolDeclKind::Definition,
range: ident.range(),
range: default_decl.decl.range(),
},
);
file_module
Expand Down
4 changes: 2 additions & 2 deletions tests/specs/type_tracing/Basic.txt
Original file line number Diff line number Diff line change
Expand Up @@ -404,10 +404,10 @@ file:///a.ts: EsmModuleSymbol {
SymbolDecl {
range: SourceRange {
start: SourcePos(
165,
159,
),
end: SourcePos(
166,
170,
),
},
kind: Definition,
Expand Down
16 changes: 8 additions & 8 deletions tests/specs/type_tracing/ExportDefault01.txt
Original file line number Diff line number Diff line change
Expand Up @@ -435,10 +435,10 @@ file:///a.ts: EsmModuleSymbol {
SymbolDecl {
range: SourceRange {
start: SourcePos(
161,
155,
),
end: SourcePos(
165,
182,
),
},
kind: Definition,
Expand Down Expand Up @@ -582,10 +582,10 @@ file:///interface.ts: EsmModuleSymbol {
SymbolDecl {
range: SourceRange {
start: SourcePos(
25,
15,
),
end: SourcePos(
29,
33,
),
},
kind: Definition,
Expand Down Expand Up @@ -662,10 +662,10 @@ file:///function.ts: EsmModuleSymbol {
SymbolDecl {
range: SourceRange {
start: SourcePos(
24,
15,
),
end: SourcePos(
28,
34,
),
},
kind: Definition,
Expand Down Expand Up @@ -735,10 +735,10 @@ file:///class.ts: EsmModuleSymbol {
SymbolDecl {
range: SourceRange {
start: SourcePos(
21,
15,
),
end: SourcePos(
25,
29,
),
},
kind: Definition,
Expand Down
16 changes: 8 additions & 8 deletions tests/specs/type_tracing/ExportStar01.txt
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,10 @@ file:///a.ts: EsmModuleSymbol {
SymbolDecl {
range: SourceRange {
start: SourcePos(
161,
155,
),
end: SourcePos(
165,
182,
),
},
kind: Definition,
Expand Down Expand Up @@ -357,10 +357,10 @@ file:///class.ts: EsmModuleSymbol {
SymbolDecl {
range: SourceRange {
start: SourcePos(
21,
15,
),
end: SourcePos(
25,
29,
),
},
kind: Definition,
Expand Down Expand Up @@ -430,10 +430,10 @@ file:///function.ts: EsmModuleSymbol {
SymbolDecl {
range: SourceRange {
start: SourcePos(
24,
15,
),
end: SourcePos(
28,
34,
),
},
kind: Definition,
Expand Down Expand Up @@ -503,10 +503,10 @@ file:///interface.ts: EsmModuleSymbol {
SymbolDecl {
range: SourceRange {
start: SourcePos(
25,
15,
),
end: SourcePos(
29,
33,
),
},
kind: Definition,
Expand Down
4 changes: 2 additions & 2 deletions tests/specs/type_tracing/ImportType02.txt
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,10 @@ file:///a.ts: EsmModuleSymbol {
SymbolDecl {
range: SourceRange {
start: SourcePos(
141,
132,
),
end: SourcePos(
145,
151,
),
},
kind: Definition,
Expand Down

0 comments on commit 5ccfa34

Please sign in to comment.