From 55f6d4f90dd2bc2acc0ae957e8ace0d053d0e556 Mon Sep 17 00:00:00 2001 From: Vladimir Matveev Date: Mon, 19 Sep 2016 16:57:19 -0700 Subject: [PATCH] do not adjust location being passed to the managed side (#10999) do not adjust location being passed to the managed side * remove redundant code --- src/server/session.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/server/session.ts b/src/server/session.ts index 7b086f014fe..6c13e3a5e78 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -248,11 +248,6 @@ namespace ts.server { this.send(res); } - private getLocation(position: number, scriptInfo: ScriptInfo): protocol.Location { - const { line, offset } = scriptInfo.positionToLineOffset(position); - return { line, offset: offset + 1 }; - } - private semanticCheck(file: NormalizedPath, project: Project) { try { const diags = project.getLanguageService().getSemanticDiagnostics(file); @@ -366,8 +361,8 @@ namespace ts.server { length: d.length, category: DiagnosticCategory[d.category].toLowerCase(), code: d.code, - startLocation: scriptInfo && this.getLocation(d.start, scriptInfo), - endLocation: scriptInfo && this.getLocation(d.start + d.length, scriptInfo) + startLocation: scriptInfo && scriptInfo.positionToLineOffset(d.start), + endLocation: scriptInfo && scriptInfo.positionToLineOffset(d.start + d.length) }); }