Removed unused declarations in 'editorServices.ts'.

This commit is contained in:
Daniel Rosenwasser 2015-12-17 15:07:37 -08:00
parent 125f0a1a23
commit 7fd6aa4318

View file

@ -263,13 +263,11 @@ namespace ts.server {
}
resolvePath(path: string): string {
const start = new Date().getTime();
const result = this.host.resolvePath(path);
return result;
}
fileExists(path: string): boolean {
const start = new Date().getTime();
const result = this.host.fileExists(path);
return result;
}
@ -325,32 +323,6 @@ namespace ts.server {
}
}
// assumes normalized paths
function getAbsolutePath(filename: string, directory: string) {
const rootLength = ts.getRootLength(filename);
if (rootLength > 0) {
return filename;
}
else {
const splitFilename = filename.split("/");
const splitDir = directory.split("/");
let i = 0;
let dirTail = 0;
const sflen = splitFilename.length;
while ((i < sflen) && (splitFilename[i].charAt(0) == ".")) {
const dots = splitFilename[i];
if (dots == "..") {
dirTail++;
}
else if (dots != ".") {
return undefined;
}
i++;
}
return splitDir.slice(0, splitDir.length - dirTail).concat(splitFilename.slice(i)).join("/");
}
}
export interface ProjectOptions {
// these fields can be present in the project file
files?: string[];
@ -583,7 +555,9 @@ namespace ts.server {
}
handleProjectFilelistChanges(project: Project) {
const { succeeded, projectOptions, error } = this.configFileToProjectOptions(project.projectFilename);
// TODO: Ignoring potentially returned 'error' and 'succeeded' condition
const { projectOptions } = this.configFileToProjectOptions(project.projectFilename);
const newRootFiles = projectOptions.files.map((f => this.getCanonicalFileName(f)));
const currentRootFiles = project.getRootFiles().map((f => this.getCanonicalFileName(f)));
@ -611,7 +585,9 @@ namespace ts.server {
this.log("Detected newly added tsconfig file: " + fileName);
const { succeeded, projectOptions, error } = this.configFileToProjectOptions(fileName);
// TODO: Ignoring potentially returned 'error' and 'succeeded' condition
const { projectOptions } = this.configFileToProjectOptions(fileName);
const rootFilesInTsconfig = projectOptions.files.map(f => this.getCanonicalFileName(f));
const openFileRoots = this.openFileRoots.map(s => this.getCanonicalFileName(s.fileName));