Skip to content

Commit 75678de

Browse files
Removed unused declarations from 'services.ts'.
1 parent 19b44e0 commit 75678de

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/services/services.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2987,7 +2987,6 @@ namespace ts {
29872987

29882988
function getCompletionData(fileName: string, position: number) {
29892989
const typeChecker = program.getTypeChecker();
2990-
const syntacticStart = new Date().getTime();
29912990
const sourceFile = getValidSourceFile(fileName);
29922991
const isJavaScriptFile = isSourceFileJavaScript(sourceFile);
29932992

@@ -6166,10 +6165,6 @@ namespace ts {
61666165
return ts.NavigateTo.getNavigateToItems(program, cancellationToken, searchValue, maxResultCount);
61676166
}
61686167

6169-
function containErrors(diagnostics: Diagnostic[]): boolean {
6170-
return forEach(diagnostics, diagnostic => diagnostic.category === DiagnosticCategory.Error);
6171-
}
6172-
61736168
function getEmitOutput(fileName: string): EmitOutput {
61746169
synchronizeHostData();
61756170

@@ -7045,7 +7040,6 @@ namespace ts {
70457040
* be performed.
70467041
*/
70477042
function getDocCommentTemplateAtPosition(fileName: string, position: number): TextInsertion {
7048-
const start = new Date().getTime();
70497043
const sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName);
70507044

70517045
// Check if in a context where we don't want to perform any insertion
@@ -7339,11 +7333,17 @@ namespace ts {
73397333
if (declarations && declarations.length > 0) {
73407334
// Disallow rename for elements that are defined in the standard TypeScript library.
73417335
const defaultLibFileName = host.getDefaultLibFileName(host.getCompilationSettings());
7336+
const canonicalDefaultLibName = getCanonicalFileName(ts.normalizePath(defaultLibFileName));
73427337
if (defaultLibFileName) {
73437338
for (const current of declarations) {
73447339
const sourceFile = current.getSourceFile();
7340+
// TODO (drosen): When is there no source file?
7341+
if (!sourceFile) {
7342+
continue;
7343+
}
7344+
73457345
const canonicalName = getCanonicalFileName(ts.normalizePath(sourceFile.fileName));
7346-
if (sourceFile && getCanonicalFileName(ts.normalizePath(sourceFile.fileName)) === getCanonicalFileName(ts.normalizePath(defaultLibFileName))) {
7346+
if (canonicalName === canonicalDefaultLibName) {
73477347
return getRenameInfoError(getLocaleSpecificMessage(Diagnostics.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library));
73487348
}
73497349
}

0 commit comments

Comments
 (0)