do not adjust location being passed to the managed side (#10999)

do not adjust location being passed to the managed side

* remove redundant code
This commit is contained in:
Vladimir Matveev 2016-09-19 16:57:19 -07:00 committed by GitHub
parent 286a12edd1
commit 55f6d4f90d

View file

@ -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)
});
}