Jbuilder Visual AlignVisually align English instructions are followed by 简体中文 below. Source:
Editor display:
UsageInstall Jbuilder Visual Align and open a Consecutive fields with the same indentation form a group. Blank lines, comments, control flow and structure calls split groups. Nested fields and tab indentation are supported. Settings
Use a monospaced font. Text selection follows the original source; dragging across virtual padding can feel different, so toggle alignment off when needed. Performance and limitationsModels are prepared when documents open and cached for editor navigation. Ordinary value edits scan changed lines without rereading or regrouping the entire document, and do not resend identical decorations. Replacing an anchor range, including whole-document replacement and undo, restores decorations. Editor decorations arrive asynchronously: a cold start or first open may briefly show the original spacing. The extension cannot guarantee alignment before the editor's first frame. This is a lightweight lexical guard, not a full Ruby or Crystal parser. Parenthesized calls and dynamic field names are not expanded, multiple statements are not split, and unusual literal syntax or macros may require disabling alignment for that file type. Tested in Qoder CN; designed for Visual Studio Code 1.90 or later and compatible desktop editors. PrivacyNo network requests, telemetry, external commands or runtime dependencies. The extension reads open documents to calculate display decorations; it does not edit or save them. It works in untrusted and virtual workspaces. DevelopmentRun Licensed under the MIT license; see the included LICENSE file. Jbuilder Visual Align在 Visual Studio Code(微软代码编辑器)及兼容编辑器中,将 实际文件:
显示效果:
打开模板后自动生效,编辑时自动更新。点击状态栏的“Jbuilder 对齐开/关”,或从命令面板运行“Jbuilder: 切换视觉对齐”。开关按工作区保存。 0.2.0 提前启动并在文档打开时预计算,切换文件复用缓存。普通值编辑只重新扫描受影响的行,不重新读取整个文件、不重复提交相同装饰;视觉间距固定在字段后的空白上,减少输入时的位置跳动。字段名、行数或多行字面量发生变化时才重新计算受影响的布局。 原生编辑器通过异步消息接收扩展装饰,没有供普通扩展在首次绘制前阻塞画面的入口,因此冷启动或首次打开文件仍不能保证绝对无闪动。这里不会通过隐藏文本或临时改写文档掩盖这个限制。 连续、同缩进的普通字段调用构成一组。空行、注释、控制语句、结构调用会切断分组。支持制表符缩进和嵌套字段;跳过 设置:
以等宽字体使用。视觉空白由编辑器装饰绘制,鼠标拖选经过补齐位置时可能不如原始文本直观,可暂时关闭对齐;键盘选择与文件内容不受影响。这里的词法保护并非完整语言解析器,复杂宏和罕见多行字面量不保证识别。 扩展不注册格式化器,不执行外部命令、不联网、不收集遥测,也不调用文档编辑或保存方法。 开发验证: |