diff options
author | vitya-smirnov <[email protected]> | 2025-08-01 13:53:31 +0300 |
---|---|---|
committer | vitya-smirnov <[email protected]> | 2025-08-01 14:16:56 +0300 |
commit | 3b47f6e69ae8534f4595086c40faf14fb3a2661a (patch) | |
tree | 60414a19794fcfd2f168ffe44e5278c1d03dd671 /yql/essentials/tools/yql_highlight/generator_vim.cpp | |
parent | 0e455c45d67077af33f521df4382c3ca80be4e1b (diff) |
YQL-19616: Generate YQLs syntax highlighting
- Support `Before` at core `TRegexPattern` and `IGenericLexer`.
- Added `Name` and `Extension` to core `THighlighting`.
- Added `Tighlighting` for `YQLs` factory method.
- Added `--language` option to `yql_highlight`.
- Added `artifact` targets for `YQLs`.
Yes, using the `NSQLTranslation::THighlighting` for
`YQLs` is not correct, but much simplier than generalize
this infrastructure just for a `YQLs`. So here is a
trade-off between development time and a clean code.
Results:
- JetBrains: https://nda.ya.ru/t/PXkZVE8m7H5wHS.
- Vim: https://nda.ya.ru/t/Am-6ZHQa7H5wJi.
- TextMate: https://nda.ya.ru/t/wH0YggAf7H5wKw.
- yql_highlight: https://nda.ya.ru/t/3FaCm57q7H7QSF.
commit_hash:f0e1abb8e7f1b083df531d761b357330bd514cb0
Diffstat (limited to 'yql/essentials/tools/yql_highlight/generator_vim.cpp')
-rw-r--r-- | yql/essentials/tools/yql_highlight/generator_vim.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/yql/essentials/tools/yql_highlight/generator_vim.cpp b/yql/essentials/tools/yql_highlight/generator_vim.cpp index bb33157ce2e..9804b818ead 100644 --- a/yql/essentials/tools/yql_highlight/generator_vim.cpp +++ b/yql/essentials/tools/yql_highlight/generator_vim.cpp @@ -41,6 +41,10 @@ namespace NSQLHighlight { vim << R"(\c)"; } + if (!pattern.Before.empty()) { + vim << "(" << ToVim(pattern.Before) << ")@<="; + } + vim << "(" << ToVim(pattern.Body) << ")"; if (!pattern.After.empty()) { @@ -161,7 +165,7 @@ namespace NSQLHighlight { out << '\n'; - out << "let b:current_syntax = \"yql\"" << '\n'; + out << "let b:current_syntax = \"" << highlighting.Extension << "\"" << '\n'; out.Flush(); } |