Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/services/formatting/formatting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,7 @@ function formatSpanWorker(
isFirstListItem?: boolean): number {
Debug.assert(!nodeIsSynthesized(child));

if (nodeIsMissing(child)) {
if (nodeIsMissing(child) || isGrammarError(parent, child)) {
return inheritedIndentation;
}

Expand Down Expand Up @@ -864,7 +864,7 @@ function formatSpanWorker(
// if child node is a token, it does not impact indentation, proceed it using parent indentation scope rules
const tokenInfo = formattingScanner.readTokenInfo(child);
// JSX text shouldn't affect indenting
if (child.kind !== SyntaxKind.JsxText && !isGrammarError(parent, child)) {
if (child.kind !== SyntaxKind.JsxText) {
Debug.assert(tokenInfo.token.end === child.end, "Token end is child end");
consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation, child);
return inheritedIndentation;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/// <reference path='fourslash.ts' />

// @jsx: react-jsxdev
// @Filename: /a.tsx
////[|<div abc={{ foo = 10 }}></div><div abc={{ foo = 10 }}></div>|]

verify.rangeAfterCodeFix(`<><div abc={{ foo = 10 }}></div><div abc={{ foo = 10 }}></div></>`, /*includeWhiteSpace*/false, /*errorCode*/ undefined, /*index*/ 0);
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ edit.applyRefactor({
newContent:
`type /*RENAME*/NewType = {
x: string;
};
};

type Foo<T extends NewType> = T`,
});