prettier-plugin-solidity 1.1.1 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/standalone.js +1 -1
- package/dist/standalone.js.map +1 -1
- package/package.json +4 -4
- package/src/common/printer-helpers.js +116 -0
- package/src/nodes/AssemblyBlock.js +5 -3
- package/src/nodes/AssemblyCall.js +1 -1
- package/src/nodes/AssemblyFunctionDefinition.js +4 -2
- package/src/nodes/AssemblyLocalDefinition.js +1 -1
- package/src/nodes/Block.js +4 -2
- package/src/nodes/CatchClause.js +1 -1
- package/src/nodes/ContractDefinition.js +6 -4
- package/src/nodes/CustomErrorDefinition.js +1 -1
- package/src/nodes/DoWhileStatement.js +1 -1
- package/src/nodes/EnumDefinition.js +1 -1
- package/src/nodes/EventDefinition.js +1 -1
- package/src/nodes/ExpressionStatement.js +1 -1
- package/src/nodes/ForStatement.js +1 -1
- package/src/nodes/FunctionCall.js +1 -1
- package/src/nodes/FunctionDefinition.js +6 -6
- package/src/nodes/FunctionTypeName.js +1 -1
- package/src/nodes/IfStatement.js +4 -2
- package/src/nodes/ImportDirective.js +1 -1
- package/src/nodes/InheritanceSpecifier.js +1 -1
- package/src/nodes/InlineAssemblyStatement.js +1 -1
- package/src/nodes/Mapping.js +15 -7
- package/src/nodes/ModifierDefinition.js +1 -1
- package/src/nodes/ModifierInvocation.js +4 -2
- package/src/nodes/NameValueList.js +1 -1
- package/src/nodes/SourceUnit.js +1 -1
- package/src/nodes/StructDefinition.js +1 -1
- package/src/nodes/TryStatement.js +4 -2
- package/src/nodes/TupleExpression.js +1 -1
- package/src/nodes/UsingForDeclaration.js +1 -1
- package/src/nodes/VariableDeclaration.js +1 -1
- package/src/nodes/VariableDeclarationStatement.js +1 -1
- package/src/nodes/WhileStatement.js +1 -1
- package/src/nodes/print-comments.js +0 -37
- package/src/nodes/print-preserving-empty-lines.js +0 -53
- package/src/nodes/print-separated-item.js +0 -21
- package/src/nodes/print-separated-list.js +0 -23
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
const {
|
|
2
|
-
doc: {
|
|
3
|
-
builders: { group, indent, join, line, softline }
|
|
4
|
-
}
|
|
5
|
-
} = require('prettier');
|
|
6
|
-
|
|
7
|
-
// This function will add an indentation to the `list` and separate it from the
|
|
8
|
-
// rest of the `doc` in most cases by a `softline`.
|
|
9
|
-
// the list itself will be printed with a separator that in most cases is a
|
|
10
|
-
// comma (,) and a `line`
|
|
11
|
-
const printSeparatedList = (
|
|
12
|
-
list,
|
|
13
|
-
{
|
|
14
|
-
firstSeparator = softline,
|
|
15
|
-
separator = [',', line],
|
|
16
|
-
lastSeparator = firstSeparator,
|
|
17
|
-
grouped = true
|
|
18
|
-
} = {}
|
|
19
|
-
) => {
|
|
20
|
-
const doc = [indent([firstSeparator, join(separator, list)]), lastSeparator];
|
|
21
|
-
return grouped ? group(doc) : doc;
|
|
22
|
-
};
|
|
23
|
-
module.exports = printSeparatedList;
|