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
Original file line number Diff line number Diff line change
Expand Up @@ -287,12 +287,14 @@ export class SvelteDocumentSnapshot implements DocumentSnapshot {
private async getMapper(uri: string) {
const scriptInfo = this.parent.scriptInfo || this.parent.moduleScriptInfo;

if (!scriptInfo) {
return new IdentityMapper(uri);
}
if (!this.tsxMap) {
if (!scriptInfo) {
return new IdentityMapper(uri);
}

return new FragmentMapper(this.parent.getText(), scriptInfo, uri);
}

return new ConsumerDocumentMapper(
await new SourceMapConsumer(this.tsxMap),
uri,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[
{
"code": 2304,
"message": "Cannot find name 'hi'.",
"range": {
"end": {
"character": 7,
"line": 1
},
"start": {
"character": 5,
"line": 1
}
},
"severity": 1,
"source": "js",
"tags": []
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<div>
{hi}
</div>