mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-09 20:51:43 -06:00
JsxText has no leading comments
This commit is contained in:
parent
ad9c29b928
commit
153b94aeb4
@ -635,7 +635,7 @@ namespace ts {
|
||||
}
|
||||
|
||||
export function getLeadingCommentRangesOfNode(node: Node, sourceFileOfNode: SourceFile) {
|
||||
return getLeadingCommentRanges(sourceFileOfNode.text, node.pos);
|
||||
return node.kind !== SyntaxKind.JsxText ? getLeadingCommentRanges(sourceFileOfNode.text, node.pos) : undefined;
|
||||
}
|
||||
|
||||
export function getLeadingCommentRangesOfNodeFromText(node: Node, text: string) {
|
||||
|
||||
27
tests/cases/fourslash/isInMultiLineCommentJsxText.ts
Normal file
27
tests/cases/fourslash/isInMultiLineCommentJsxText.ts
Normal file
@ -0,0 +1,27 @@
|
||||
/// <reference path="fourslash.ts" />
|
||||
|
||||
// @Filename: file.jsx
|
||||
//// <div>
|
||||
//// // /*0*/
|
||||
//// /* /*1*/ */
|
||||
//// /**
|
||||
//// * /*2*/
|
||||
//// */
|
||||
//// foo() /* /*3*/ */
|
||||
//// // /*4*/
|
||||
//// /* /*5*/ */
|
||||
//// /**
|
||||
//// * /*6*/
|
||||
//// */
|
||||
//// </div>
|
||||
//// <div>
|
||||
//// // /*7*/
|
||||
//// /* /*8*/ */
|
||||
//// /**
|
||||
//// * /*9*/
|
||||
//// */
|
||||
|
||||
for (let i = 0; i < 10; ++i) {
|
||||
goTo.marker(i.toString());
|
||||
verify.not.isInCommentAtPosition(/*onlyMultiLine*/ false);
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user