✨ Language-Aware Automatic Indentation
還沒有人認領這個 Issue。
評估
研究方向
檢視 issue 中描述的目前編輯器縮排行為,然後比較 TextMate 對語言文法的處理方式與所引用的 VSCode 行為。完成條件是:自動縮排與反縮排遵循作用中語言文法、可依語言設定、可以停用,並保留手動縮排控制。
由索引模型根據 Issue 內容生成。
描述
Description
It would be great if CodeEdit, given instructions from the language grammar in use for the open file, were able to automatically indent and outdent lines as you type based on accepted style standards. For example, an "if" statement, "for" loop, etc. in most languages would cause the following lines to be indented once, then the closing bracket or statement would be outdented to line up with the original "if" or "for" statement. This functionality should be adjustable by editing settings for the language and able to be disabled entirely for those that prefer manual indentation.
TextMate is a good example to look at for reasonable behavior. The language grammars it uses to handle this functionality are also plist files and very easy to read to see how it's being done. Some plugins also enable this behavior in VSCode, though it's implemented inconsistently there.
Alternatives Considered
Most editors use manual indentation, which I assume CodeEdit will eventually support. Right now it only supports tabbing in (and does at least maintain that indent), but you cannot shift+tab out or use command+[ or command+] to outdent/indent (respectively) lines or selected blocks. Manual indentation works, and should be an option for those who wish to indent in ways inconsistent with language standards, but is far slower than automatic indentation.
Additional Context
No response
Screenshots
Here's an example of TextMate auto-indenting and outdenting a for loop in a shell script (bash). The second line is automatically indented to my configured tab stop, then once I finish typing "done" it outdents it to match for. This also works correctly if "do" is placed on its own line.
https://github.com/user-attachments/assets/76d5a013-7428-4764-8357-e5bdb6b179c8
- 主要語言
- Swift
- 星號
- 23.1k
- 分支
- 1.2k
- PR 合併指標
- 30 天內沒有已合併 PR
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
CodeEditApp/CodeEdit 的其他 Issue
-
Product icons are missing from the Xcode project可能已有人在做 關聯的 PR 仍在進行中或已合併。 未關閉
難度 2/5 1-3 小時 新手友好度 78/100
CodeEditApp/CodeEdit#2190 ·
-
難度 1/5 1 小時以內 新手友好度 15/100
CodeEditApp/CodeEdit#2195 · 15 個 reaction ·
-
enhancement
難度 4/5 3-5 天 新手友好度 35/100
CodeEditApp/CodeEdit#2185 ·
-
Native GitHub Copilot inline completions可能已有人在做 @anxkhn 於 98 天前認領。 未關閉
難度 5/5 一週以上 新手友好度 25/100
CodeEditApp/CodeEdit#2181 ·
-
bug
難度 4/5 3-5 天 新手友好度 35/100
CodeEditApp/CodeEdit#2180 ·
查看 CodeEditApp/CodeEdit 的全部 Issue
相似的 Issue
-
#️⃣ REX and feebacks 🔍 triage 🧑💻 Developer eXperience 🧰 library
難度 2/5 1-3 小時 新手友好度 68/100
Orange-OpenSource/ouds-ios#1795 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 62/100
RodnaPamet/agrent-ios#172 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆
-
bug iOS 🍎 ui/ux
難度 2/5 1-3 小時 新手友好度 72/100
MerginMaps/mobile#4744 ·
維護者通常 1 天內回覆
-
bug milestone-qa mobile
難度 2/5 1-3 小時 新手友好度 88/100
lognorman20/monaco#3519 ·