UNPKG

prettier-plugin-awk

Version:

[![tests](https://github.com/Beaglefoot/prettier-plugin-awk/actions/workflows/tests.yml/badge.svg)](https://github.com/Beaglefoot/prettier-plugin-awk/actions/workflows/tests.yml) [![npm](https://img.shields.io/npm/v/prettier-plugin-awk)](https://www.npmjs

11 lines (8 loc) 352 B
import { SyntaxNode } from 'tree-sitter' export function doesCommentBelongToNode(node: SyntaxNode): boolean { if (!node.previousNamedSibling || node.type !== 'comment') return false return ( node.previousNamedSibling.startPosition.row <= node.startPosition.row && node.previousNamedSibling.endPosition.row >= node.startPosition.row ) }