Skip to content

Commit 55f6d4f

Browse files
authored
do not adjust location being passed to the managed side (#10999)
do not adjust location being passed to the managed side * remove redundant code
1 parent 286a12e commit 55f6d4f

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/server/session.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -248,11 +248,6 @@ namespace ts.server {
248248
this.send(res);
249249
}
250250

251-
private getLocation(position: number, scriptInfo: ScriptInfo): protocol.Location {
252-
const { line, offset } = scriptInfo.positionToLineOffset(position);
253-
return { line, offset: offset + 1 };
254-
}
255-
256251
private semanticCheck(file: NormalizedPath, project: Project) {
257252
try {
258253
const diags = project.getLanguageService().getSemanticDiagnostics(file);
@@ -366,8 +361,8 @@ namespace ts.server {
366361
length: d.length,
367362
category: DiagnosticCategory[d.category].toLowerCase(),
368363
code: d.code,
369-
startLocation: scriptInfo && this.getLocation(d.start, scriptInfo),
370-
endLocation: scriptInfo && this.getLocation(d.start + d.length, scriptInfo)
364+
startLocation: scriptInfo && scriptInfo.positionToLineOffset(d.start),
365+
endLocation: scriptInfo && scriptInfo.positionToLineOffset(d.start + d.length)
371366
});
372367
}
373368

0 commit comments

Comments
 (0)