【问题标题】:SQL autoformatting in codeMirrorcodeMirror 中的 SQL 自动格式化
【发布时间】:2018-08-09 06:00:19
【问题描述】:

我正在尝试“美化”codeMirror 中的 sql 代码。

codeMirror 自 v2 起不支持自动格式化(当前版本为 v4)

我尝试使用带有 autoFormatRange 函数 ( the previous question on StackOverflow here) 的旧模块formatting.js。它似乎不适用于 SQL。它使缩进没有任何换行符

有没有人想出如何让这个功能在带有 SQL 的 codeMirror v4 上运行?

【问题讨论】:

    标签: javascript sql codemirror


    【解决方案1】:

    我已经使用这个 js 自动格式化程序解决了这个问题:https://github.com/zeroturnaround/sql-formatter

    它在格式化 SQL (demo here) 方面做得很好

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-11-02
      • 1970-01-01
      • 2023-04-03
      • 2023-04-02
      • 1970-01-01
      • 2021-05-16
      相关资源
      最近更新 更多