stuff for sublime#2144
Conversation
Greptile SummaryThis PR adds Sublime Text editor support for Civet: a build system,
Confidence Score: 3/5The grammar fix and static asset files are safe, but the build script will throw on Linux due to a directory-name case mismatch, meaning Snippets and Preferences would never be copied to dist. The case-sensitivity mismatch in build.civet will cause cpSync to throw ENOENT on any case-sensitive filesystem, so the Sublime package produced on Linux would be missing those assets entirely. The static files and grammar fix are otherwise clean. lsp/sublime/build.civet (case-sensitive directory names) and lsp/sublime/indentation-rules.civet (module-level side effect on import) Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[build.civet] -->|import| B[indentation-rules.civet\nmodule level: makeIndentationRules runs]
A --> C[build function]
C --> D[rmSync dist/]
D --> E[mkdirSync dist/]
E --> F[Parse + normalize grammar\nwrite Civet.tmLanguage]
F --> G[makeIndentationRules\ncreates dist/Preferences/]
G --> H[copyFileSync Civet.sublime-build]
H --> I[copyFileSync Default.sublime-keymap]
I --> J["cpSync 'Snippets' → dist/Snippets ⚠️ case mismatch"]
J --> K["cpSync 'Preferences' → dist/Preferences ⚠️ case mismatch"]
Reviews (1): Last reviewed commit: "stuff for sublime" | Re-trigger Greptile |
| <key>decreaseIndentPattern</key> | ||
| <string>${rules.decreaseIndentPattern}</string> | ||
| <key>increaseIndentPattern</key> | ||
| <string>${rules.increaseIndentPattern}</string> |
There was a problem hiding this comment.
The regex patterns are interpolated directly into the XML string without any escaping. The current patterns in
civet-configuration.json happen to be safe, but <, >, and & in future patterns would produce malformed plist XML. The sibling build.civet already has an escapeXml helper for exactly this purpose.
| <key>decreaseIndentPattern</key> | |
| <string>${rules.decreaseIndentPattern}</string> | |
| <key>increaseIndentPattern</key> | |
| <string>${rules.increaseIndentPattern}</string> | |
| <key>decreaseIndentPattern</key> | |
| <string>${rules.decreaseIndentPattern.replace /[&<>]/g, (c) => c is "&" ? "&" : c is "<" ? "<" : ">"}</string> | |
| <key>increaseIndentPattern</key> | |
| <string>${rules.increaseIndentPattern.replace /[&<>]/g, (c) => c is "&" ? "&" : c is "<" ? "<" : ">"}</string> |
There was a problem hiding this comment.
doesn't matter in sublime
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2144 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 57 57
Lines 27764 27764
Branches 5220 5219 -1
=========================================
Hits 27764 27764 🚀 New features to boost your workflow:
|
$inside backticks it becomes${}civet-configuration.jsonfilesource.js.regexp->source.regexp.jsin syntax file generation