🐛 fix(vscode): Rust 连着写的行注释合成一块注释,和别的语言走同一套拆块

This commit is contained in:
cruldra committed 2026-10-08 07:17:25 +08:00
1 parent 51da724e68
commit 2f610e9cb8
11 files changed
+233 -121

No files matched your search

+2 -1
View File
@@ -41,12 +41,13 @@ const SIMPLE_STATEMENTS = new Set(['command', 'redirected_statement', 'variable_
const EXPANSIONS = new Set(['simple_expansion', 'expansion', 'command_substitution', 'arithmetic_expansion', 'process_substitution'])
const COMMENTS: CommentRules = {
isLine: () => true,
lineStyle: () => '#',
// 紧贴在函数上面一行的注释是函数的说明
isDoc: (comment) => {
const next = comment.nextSibling
return next?.type === 'function_definition' && next.startPosition.row === comment.endPosition.row + 1
},
documents: new Set(['function']),
}
function statements(items: Node[], afterRow: number, top: boolean): CodeBlock[] {