Skip to content

Commit 171c664

Browse files
committed
Update LKG
1 parent 20da159 commit 171c664

File tree

4 files changed

+28
-32
lines changed

4 files changed

+28
-32
lines changed

lib/tsserver.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64887,11 +64887,10 @@ var ts;
6488764887
var bucket = getBucketForCompilationSettings(key, true);
6488864888
var entry = bucket.get(path);
6488964889
if (!entry) {
64890-
ts.Debug.assert(acquiring, "How could we be trying to update a document that the registry doesn't have?");
6489164890
var sourceFile = ts.createLanguageServiceSourceFile(fileName, scriptSnapshot, compilationSettings.target, version, false, scriptKind);
6489264891
entry = {
6489364892
sourceFile: sourceFile,
64894-
languageServiceRefCount: 0,
64893+
languageServiceRefCount: 1,
6489564894
owners: []
6489664895
};
6489764896
bucket.set(path, entry);
@@ -64900,9 +64899,9 @@ var ts;
6490064899
if (entry.sourceFile.version !== version) {
6490164900
entry.sourceFile = ts.updateLanguageServiceSourceFile(entry.sourceFile, scriptSnapshot, version, scriptSnapshot.getChangeRange(entry.sourceFile.scriptSnapshot));
6490264901
}
64903-
}
64904-
if (acquiring) {
64905-
entry.languageServiceRefCount++;
64902+
if (acquiring) {
64903+
entry.languageServiceRefCount++;
64904+
}
6490664905
}
6490764906
return entry.sourceFile;
6490864907
}
@@ -80823,7 +80822,7 @@ var ts;
8082380822
for (var _i = 0, openFiles_1 = openFiles; _i < openFiles_1.length; _i++) {
8082480823
var file = openFiles_1[_i];
8082580824
var scriptInfo = this.getScriptInfo(file.fileName);
80826-
ts.Debug.assert(!scriptInfo || !scriptInfo.isScriptOpen());
80825+
ts.Debug.assert(!scriptInfo || !scriptInfo.isScriptOpen(), "Script should not exist and not be open already");
8082780826
var normalizedPath = scriptInfo ? scriptInfo.fileName : server.toNormalizedPath(file.fileName);
8082880827
this.openClientFileWithNormalizedPath(normalizedPath, file.content, tryConvertScriptKindName(file.scriptKind), file.hasMixedContent);
8082980828
}

lib/tsserverlibrary.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64887,11 +64887,10 @@ var ts;
6488764887
var bucket = getBucketForCompilationSettings(key, true);
6488864888
var entry = bucket.get(path);
6488964889
if (!entry) {
64890-
ts.Debug.assert(acquiring, "How could we be trying to update a document that the registry doesn't have?");
6489164890
var sourceFile = ts.createLanguageServiceSourceFile(fileName, scriptSnapshot, compilationSettings.target, version, false, scriptKind);
6489264891
entry = {
6489364892
sourceFile: sourceFile,
64894-
languageServiceRefCount: 0,
64893+
languageServiceRefCount: 1,
6489564894
owners: []
6489664895
};
6489764896
bucket.set(path, entry);
@@ -64900,9 +64899,9 @@ var ts;
6490064899
if (entry.sourceFile.version !== version) {
6490164900
entry.sourceFile = ts.updateLanguageServiceSourceFile(entry.sourceFile, scriptSnapshot, version, scriptSnapshot.getChangeRange(entry.sourceFile.scriptSnapshot));
6490264901
}
64903-
}
64904-
if (acquiring) {
64905-
entry.languageServiceRefCount++;
64902+
if (acquiring) {
64903+
entry.languageServiceRefCount++;
64904+
}
6490664905
}
6490764906
return entry.sourceFile;
6490864907
}
@@ -82561,7 +82560,7 @@ var ts;
8256182560
for (var _i = 0, openFiles_1 = openFiles; _i < openFiles_1.length; _i++) {
8256282561
var file = openFiles_1[_i];
8256382562
var scriptInfo = this.getScriptInfo(file.fileName);
82564-
ts.Debug.assert(!scriptInfo || !scriptInfo.isScriptOpen());
82563+
ts.Debug.assert(!scriptInfo || !scriptInfo.isScriptOpen(), "Script should not exist and not be open already");
8256582564
var normalizedPath = scriptInfo ? scriptInfo.fileName : server.toNormalizedPath(file.fileName);
8256682565
this.openClientFileWithNormalizedPath(normalizedPath, file.content, tryConvertScriptKindName(file.scriptKind), file.hasMixedContent);
8256782566
}

lib/typescript.js

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -78177,12 +78177,11 @@ var ts;
7817778177
var bucket = getBucketForCompilationSettings(key, /*createIfMissing*/ true);
7817878178
var entry = bucket.get(path);
7817978179
if (!entry) {
78180-
ts.Debug.assert(acquiring, "How could we be trying to update a document that the registry doesn't have?");
7818178180
// Have never seen this file with these settings. Create a new source file for it.
7818278181
var sourceFile = ts.createLanguageServiceSourceFile(fileName, scriptSnapshot, compilationSettings.target, version, /*setNodeParents*/ false, scriptKind);
7818378182
entry = {
7818478183
sourceFile: sourceFile,
78185-
languageServiceRefCount: 0,
78184+
languageServiceRefCount: 1,
7818678185
owners: []
7818778186
};
7818878187
bucket.set(path, entry);
@@ -78194,14 +78193,14 @@ var ts;
7819478193
if (entry.sourceFile.version !== version) {
7819578194
entry.sourceFile = ts.updateLanguageServiceSourceFile(entry.sourceFile, scriptSnapshot, version, scriptSnapshot.getChangeRange(entry.sourceFile.scriptSnapshot));
7819678195
}
78197-
}
78198-
// If we're acquiring, then this is the first time this LS is asking for this document.
78199-
// Increase our ref count so we know there's another LS using the document. If we're
78200-
// not acquiring, then that means the LS is 'updating' the file instead, and that means
78201-
// it has already acquired the document previously. As such, we do not need to increase
78202-
// the ref count.
78203-
if (acquiring) {
78204-
entry.languageServiceRefCount++;
78196+
// If we're acquiring, then this is the first time this LS is asking for this document.
78197+
// Increase our ref count so we know there's another LS using the document. If we're
78198+
// not acquiring, then that means the LS is 'updating' the file instead, and that means
78199+
// it has already acquired the document previously. As such, we do not need to increase
78200+
// the ref count.
78201+
if (acquiring) {
78202+
entry.languageServiceRefCount++;
78203+
}
7820578204
}
7820678205
return entry.sourceFile;
7820778206
}

lib/typescriptServices.js

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -78177,12 +78177,11 @@ var ts;
7817778177
var bucket = getBucketForCompilationSettings(key, /*createIfMissing*/ true);
7817878178
var entry = bucket.get(path);
7817978179
if (!entry) {
78180-
ts.Debug.assert(acquiring, "How could we be trying to update a document that the registry doesn't have?");
7818178180
// Have never seen this file with these settings. Create a new source file for it.
7818278181
var sourceFile = ts.createLanguageServiceSourceFile(fileName, scriptSnapshot, compilationSettings.target, version, /*setNodeParents*/ false, scriptKind);
7818378182
entry = {
7818478183
sourceFile: sourceFile,
78185-
languageServiceRefCount: 0,
78184+
languageServiceRefCount: 1,
7818678185
owners: []
7818778186
};
7818878187
bucket.set(path, entry);
@@ -78194,14 +78193,14 @@ var ts;
7819478193
if (entry.sourceFile.version !== version) {
7819578194
entry.sourceFile = ts.updateLanguageServiceSourceFile(entry.sourceFile, scriptSnapshot, version, scriptSnapshot.getChangeRange(entry.sourceFile.scriptSnapshot));
7819678195
}
78197-
}
78198-
// If we're acquiring, then this is the first time this LS is asking for this document.
78199-
// Increase our ref count so we know there's another LS using the document. If we're
78200-
// not acquiring, then that means the LS is 'updating' the file instead, and that means
78201-
// it has already acquired the document previously. As such, we do not need to increase
78202-
// the ref count.
78203-
if (acquiring) {
78204-
entry.languageServiceRefCount++;
78196+
// If we're acquiring, then this is the first time this LS is asking for this document.
78197+
// Increase our ref count so we know there's another LS using the document. If we're
78198+
// not acquiring, then that means the LS is 'updating' the file instead, and that means
78199+
// it has already acquired the document previously. As such, we do not need to increase
78200+
// the ref count.
78201+
if (acquiring) {
78202+
entry.languageServiceRefCount++;
78203+
}
7820578204
}
7820678205
return entry.sourceFile;
7820778206
}

0 commit comments

Comments
 (0)