prettier-plugin-solidity
Version:
A Prettier Plugin for automatically formatting your Solidity code.
18 lines • 1.01 kB
JavaScript
import { NonterminalKind } from '@nomicfoundation/slang/cst';
import addCollectionNodeFirstComment from './add-collection-node-first-comment.js';
import addCollectionNodeLastComment from './add-collection-node-last-comment.js';
export default function handleBlockComments({ precedingNode, enclosingNode, followingNode, comment }) {
if ((enclosingNode === null || enclosingNode === void 0 ? void 0 : enclosingNode.kind) !== NonterminalKind.ParametersDeclaration) {
return false;
}
if ((precedingNode === null || precedingNode === void 0 ? void 0 : precedingNode.kind) === NonterminalKind.Parameters) {
addCollectionNodeLastComment(precedingNode, comment);
return true;
}
if ((followingNode === null || followingNode === void 0 ? void 0 : followingNode.kind) === NonterminalKind.Parameters) {
addCollectionNodeFirstComment(followingNode, comment);
return true;
}
return false;
}
//# sourceMappingURL=handle-parameters-declaration-comments.js.map