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:
parent
286a12edd1
commit
55f6d4f90d
1 changed files with 2 additions and 7 deletions
|
@ -248,11 +248,6 @@ namespace ts.server {
|
||||||
this.send(res);
|
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) {
|
private semanticCheck(file: NormalizedPath, project: Project) {
|
||||||
try {
|
try {
|
||||||
const diags = project.getLanguageService().getSemanticDiagnostics(file);
|
const diags = project.getLanguageService().getSemanticDiagnostics(file);
|
||||||
|
@ -366,8 +361,8 @@ namespace ts.server {
|
||||||
length: d.length,
|
length: d.length,
|
||||||
category: DiagnosticCategory[d.category].toLowerCase(),
|
category: DiagnosticCategory[d.category].toLowerCase(),
|
||||||
code: d.code,
|
code: d.code,
|
||||||
startLocation: scriptInfo && this.getLocation(d.start, scriptInfo),
|
startLocation: scriptInfo && scriptInfo.positionToLineOffset(d.start),
|
||||||
endLocation: scriptInfo && this.getLocation(d.start + d.length, scriptInfo)
|
endLocation: scriptInfo && scriptInfo.positionToLineOffset(d.start + d.length)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue