import { isAstNodeWithComment } from "./lib-serializer-json-serializer.js";
import { findCommentNode } from "./lib-utils-cst-utils.js";
class DefaultCommentProvider {
  constructor(services) {
    this.grammarConfig = () => services.parser.GrammarConfig;
  }
  getComment(node) {
    var _a;
    if (isAstNodeWithComment(node)) {
      return node.$comment;
    }
    return (_a = findCommentNode(node.$cstNode, this.grammarConfig().multilineCommentRules)) === null || _a === void 0 ? void 0 : _a.text;
  }
}
export {
  DefaultCommentProvider
};
//# sourceMappingURL=lib-documentation-comment-provider.js.map
