Skip to content

Commit fff218f

Browse files
committed
only break import deconstruction if the list of items is longer than 1
1 parent 7cbd4a8 commit fff218f

2 files changed

Lines changed: 5 additions & 13 deletions

File tree

src/slang-nodes/ImportDeconstructionSymbols.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export class ImportDeconstructionSymbols implements SlangNode {
4343
const compiler = coerce(options.compiler);
4444
return printSeparatedList(
4545
path.map(print, 'items'),
46-
compiler && satisfies(compiler, '>=0.7.4')
46+
compiler && satisfies(compiler, '>=0.7.4') && this.items.length > 1
4747
? {
4848
// if the compiler exists and is greater than or equal to 0.7.4 we will
4949
// split the ImportDirective.

tests/format/ImportDirective/__snapshots__/format.test.js.snap

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,8 @@ import {
3939
symbol3 as alias3,
4040
symbol4
4141
} from "File2.sol";
42-
import {
43-
GovernorVotesSuperQuorumFraction
44-
} from "../../../contracts/governance/extensions/GovernorVotesSuperQuorumFraction.sol";
45-
import {
46-
IAccessControl
47-
} from "@openzeppelin/contracts/access/IAccessControl.sol";
42+
import { GovernorVotesSuperQuorumFraction } from "../../../contracts/governance/extensions/GovernorVotesSuperQuorumFraction.sol";
43+
import { IAccessControl } from "@openzeppelin/contracts/access/IAccessControl.sol";
4844
import {
4945
IERC7579Module,
5046
IERC7579Validator,
@@ -138,12 +134,8 @@ import {
138134
symbol3 as alias3,
139135
symbol4
140136
} from "File2.sol";
141-
import {
142-
GovernorVotesSuperQuorumFraction
143-
} from "../../../contracts/governance/extensions/GovernorVotesSuperQuorumFraction.sol";
144-
import {
145-
IAccessControl
146-
} from "@openzeppelin/contracts/access/IAccessControl.sol";
137+
import {GovernorVotesSuperQuorumFraction} from "../../../contracts/governance/extensions/GovernorVotesSuperQuorumFraction.sol";
138+
import {IAccessControl} from "@openzeppelin/contracts/access/IAccessControl.sol";
147139
import {
148140
IERC7579Module,
149141
IERC7579Validator,

0 commit comments

Comments
 (0)