Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0424333

Browse filesBrowse files
🤖 Pick PR #62423 (Revert PR 61928) into release-5.9 (#62425)
Co-authored-by: Jake Bailey <5341706+jakebailey@users.noreply.github.com>
1 parent bdb641a commit 0424333
Copy full SHA for 0424333

File tree

Expand file treeCollapse file tree

7 files changed

+16
-21
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

7 files changed

+16
-21
lines changed
Open diff view settings
Collapse file

‎src/compiler/types.ts‎

Copy file name to clipboardExpand all lines: src/compiler/types.ts
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4288,7 +4288,6 @@ export interface SourceFileLike {
42884288
lineMap?: readonly number[];
42894289
/** @internal */
42904290
getPositionOfLineAndCharacter?(line: number, character: number, allowEdits?: true): number;
4291-
languageVariant?: LanguageVariant;
42924291
}
42934292

42944293
/** @internal */
Collapse file

‎src/services/completions.ts‎

Copy file name to clipboardExpand all lines: src/services/completions.ts
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1595,7 +1595,7 @@ function getJsxClosingTagCompletion(location: Node | undefined, sourceFile: Sour
15951595
switch (node.kind) {
15961596
case SyntaxKind.JsxClosingElement:
15971597
return true;
1598-
case SyntaxKind.LessThanSlashToken:
1598+
case SyntaxKind.SlashToken:
15991599
case SyntaxKind.GreaterThanToken:
16001600
case SyntaxKind.Identifier:
16011601
case SyntaxKind.PropertyAccessExpression:
@@ -3508,7 +3508,7 @@ function getCompletionData(
35083508
}
35093509
break;
35103510

3511-
case SyntaxKind.LessThanSlashToken:
3511+
case SyntaxKind.SlashToken:
35123512
if (currentToken.parent.kind === SyntaxKind.JsxSelfClosingElement) {
35133513
location = currentToken;
35143514
}
@@ -3518,7 +3518,7 @@ function getCompletionData(
35183518

35193519
switch (parent.kind) {
35203520
case SyntaxKind.JsxClosingElement:
3521-
if (contextToken.kind === SyntaxKind.LessThanSlashToken) {
3521+
if (contextToken.kind === SyntaxKind.SlashToken) {
35223522
isStartingCloseTag = true;
35233523
location = contextToken;
35243524
}
@@ -5809,7 +5809,7 @@ function isValidTrigger(sourceFile: SourceFile, triggerCharacter: CompletionsTri
58095809
case "/":
58105810
return !!contextToken && (isStringLiteralLike(contextToken)
58115811
? !!tryGetImportFromModuleSpecifier(contextToken)
5812-
: contextToken.kind === SyntaxKind.LessThanSlashToken && isJsxClosingElement(contextToken.parent));
5812+
: contextToken.kind === SyntaxKind.SlashToken && isJsxClosingElement(contextToken.parent));
58135813
case " ":
58145814
return !!contextToken && isImportKeyword(contextToken) && contextToken.parent.kind === SyntaxKind.SourceFile;
58155815
default:
Collapse file

‎src/services/services.ts‎

Copy file name to clipboardExpand all lines: src/services/services.ts
+1-3Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -504,9 +504,8 @@ function createChildren(node: Node, sourceFile: SourceFileLike | undefined): rea
504504
});
505505
return children;
506506
}
507-
const languageVariant = sourceFile?.languageVariant ?? LanguageVariant.Standard;
507+
508508
scanner.setText((sourceFile || node.getSourceFile()).text);
509-
scanner.setLanguageVariant(languageVariant);
510509
let pos = node.pos;
511510
const processNode = (child: Node) => {
512511
addSyntheticNodes(children, pos, child.pos, node);
@@ -527,7 +526,6 @@ function createChildren(node: Node, sourceFile: SourceFileLike | undefined): rea
527526
node.forEachChild(processNode, processNodes);
528527
addSyntheticNodes(children, pos, node.end, node);
529528
scanner.setText(undefined);
530-
scanner.setLanguageVariant(LanguageVariant.Standard);
531529
return children;
532530
}
533531

Collapse file

‎src/services/utilities.ts‎

Copy file name to clipboardExpand all lines: src/services/utilities.ts
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1889,7 +1889,7 @@ export function isInsideJsxElementOrAttribute(sourceFile: SourceFile, position:
18891889
}
18901890

18911891
// <div>|</div>
1892-
if (token.kind === SyntaxKind.LessThanSlashToken && token.parent.kind === SyntaxKind.JsxClosingElement) {
1892+
if (token.kind === SyntaxKind.LessThanToken && token.parent.kind === SyntaxKind.JsxClosingElement) {
18931893
return true;
18941894
}
18951895

@@ -1934,7 +1934,6 @@ export function isInsideJsxElement(sourceFile: SourceFile, position: number): bo
19341934
|| node.kind === SyntaxKind.CloseBraceToken
19351935
|| node.kind === SyntaxKind.OpenBraceToken
19361936
|| node.kind === SyntaxKind.SlashToken
1937-
|| node.kind === SyntaxKind.LessThanSlashToken
19381937
) {
19391938
node = node.parent;
19401939
}
Collapse file

‎tests/baselines/reference/api/typescript.d.ts‎

Copy file name to clipboardExpand all lines: tests/baselines/reference/api/typescript.d.ts
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5907,7 +5907,6 @@ declare namespace ts {
59075907
*/
59085908
interface SourceFileLike {
59095909
readonly text: string;
5910-
languageVariant?: LanguageVariant;
59115910
}
59125911
interface SourceFileLike {
59135912
getLineAndCharacterOfPosition(pos: number): LineAndCharacter;
Collapse file

‎tests/cases/fourslash/syntacticClassificationsJsx1.ts‎

Copy file name to clipboardExpand all lines: tests/cases/fourslash/syntacticClassificationsJsx1.ts
+5-5Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@ verify.syntacticClassificationsAre(
1818
c.jsxText(`
1919
some jsx text
2020
`),
21-
c.punctuation("</"), c.jsxCloseTagName("div"), c.punctuation(">"), c.punctuation(";"),
21+
c.punctuation("<"), c.punctuation("/"), c.jsxCloseTagName("div"), c.punctuation(">"), c.punctuation(";"),
2222
c.keyword("let"), c.identifier("y"), c.operator("="),
2323
c.punctuation("<"),
2424
c.jsxSelfClosingTagName("element"),
2525
c.jsxAttribute("attr"), c.operator("="), c.jsxAttributeStringLiteralValue(`"123"`),
2626
c.punctuation("/"), c.punctuation(">")
2727
)
2828

29-
const c2 = classification("2020");
30-
verify.semanticClassificationsAre("2020",
31-
c2.semanticToken("variable.declaration", "x"),
32-
c2.semanticToken("variable.declaration", "y"),
29+
const c2 = classification("2020");
30+
verify.semanticClassificationsAre("2020",
31+
c2.semanticToken("variable.declaration", "x"),
32+
c2.semanticToken("variable.declaration", "y"),
3333
);
Collapse file

‎tests/cases/fourslash/syntacticClassificationsJsx2.ts‎

Copy file name to clipboardExpand all lines: tests/cases/fourslash/syntacticClassificationsJsx2.ts
+5-5Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@ verify.syntacticClassificationsAre(
1818
c.jsxText(`
1919
some jsx text
2020
`),
21-
c.punctuation("</"), c.jsxCloseTagName("div.name"), c.punctuation(">"), c.punctuation(";"),
21+
c.punctuation("<"), c.punctuation("/"), c.jsxCloseTagName("div.name"), c.punctuation(">"), c.punctuation(";"),
2222
c.keyword("let"), c.identifier("y"), c.operator("="),
2323
c.punctuation("<"),
2424
c.jsxSelfClosingTagName("element.name"),
2525
c.jsxAttribute("attr"), c.operator("="), c.jsxAttributeStringLiteralValue(`"123"`),
2626
c.punctuation("/"), c.punctuation(">")
2727
)
2828

29-
const c2 = classification("2020");
30-
verify.semanticClassificationsAre("2020",
31-
c2.semanticToken("variable.declaration", "x"),
32-
c2.semanticToken("variable.declaration", "y"),
29+
const c2 = classification("2020");
30+
verify.semanticClassificationsAre("2020",
31+
c2.semanticToken("variable.declaration", "x"),
32+
c2.semanticToken("variable.declaration", "y"),
3333
);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.