File: c-ts-common.el.html
This file contains functions that can be shared by C-like language major modes, like indenting and filling "/* */" block comments.
For indenting and filling comments:
- Use c-ts-common-comment-setup to setup comment variables and
filling.
- Use simple-indent matcher c-ts-common-looking-at-star and
anchor c-ts-common-comment-start-after-first-star for indenting
block comments. See c-ts-mode--indent-styles for example.
For indenting statements:
- Set c-ts-common-indent-offset. Use
c-ts-common-baseline-indent-rule as the fallback indent rule, and
add override rules to tweak the behavior.
- There's also a node-level-based indentation algorithm, it's not as
good as c-ts-common-baseline-indent-rule, but if you want to play
with it, set c-ts-common-indent-type-regexp-alist and use
c-ts-common-statement-offset.
Defined variables (5)
c-ts-common--comment-regexp | Regexp pattern that matches a comment in C-like languages. |
c-ts-common-indent-offset | Indent offset used by ‘c-ts-common’ indent functions. |
c-ts-common-indent-type-regexp-alist | An alist of node type regexps. |
c-ts-common-list-indent-style | Instructs ‘c-ts-common-baseline-indent-rule’ how to indent lists. |
c-ts-mode-doxygen-comment-font-lock-settings | Tree-sitter font lock rules for doxygen like comment styles. |
Defined functions (17)
c-ts-common--adaptive-fill-prefix | () |
c-ts-common--fill-block-comment | (&optional ARG) |
c-ts-common--fill-paragraph | (&optional ARG) |
c-ts-common--line-comment-p | (NODE) |
c-ts-common--node-is | (NODE &rest TYPES) |
c-ts-common--prev-standalone-sibling | (NODE) |
c-ts-common--standalone-parent | (PARENT) |
c-ts-common--standalone-predicate | (NODE) |
c-ts-common-baseline-indent-rule | (NODE PARENT BOL &rest _) |
c-ts-common-comment-2nd-line-anchor | (N P BOL &rest _) |
c-ts-common-comment-2nd-line-matcher | (N PARENT &rest _) |
c-ts-common-comment-indent-new-line | (&optional SOFT) |
c-ts-common-comment-setup | () |
c-ts-common-comment-start-after-first-star | (N PARENT &rest _) |
c-ts-common-looking-at-star | (N P BOL &rest _) |
c-ts-common-parent-ignore-preproc | (NODE) |
c-ts-common-statement-offset | (NODE PARENT &rest _) |