Open
Conversation
Implement EditorConfig support using the ec4rs crate. This allows Lapce to automatically detect and apply editor settings from .editorconfig files on a per-file basis. Supported properties: - indent_style (spaces/tabs) - indent_size - tab_width - end_of_line (lf/crlf) - insert_final_newline - trim_trailing_whitespace Closes lapce#95 Signed-off-by: majiayu000 <[email protected]>
panekj
reviewed
Dec 27, 2025
Cargo.toml
Outdated
| toml_edit = { version = "0.20.2", features = ["serde"] } | ||
| url = { version = "2.5.0" } | ||
| zstd = { version = "0.11.2" } # follow same version wasmtime-cache in lockfile | ||
| ec4rs = { version = "1.2" } |
Collaborator
There was a problem hiding this comment.
Remove it from workspace, it is not needed in other crates
ec4rs is only used in lapce-app, so it should be a direct dependency rather than a workspace dependency. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
ytimenkov
reviewed
Dec 31, 2025
| let ec_props = self | ||
| .content | ||
| .with_untracked(|c| c.path().cloned()) | ||
| .map(|path| editorconfig::get_properties(&path)); |
There was a problem hiding this comment.
As I understand this runs in the GUI part of lapce, which means that you can't access path - it may not be there (in case of running remote proxy). I suspect you need to punch few more holes in RPC.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ec4rscrate.editorconfigfilesSupported Properties
indent_styleindent_sizetab_widthend_of_lineinsert_final_newlinetrim_trailing_whitespaceTest Plan
cargo fmtandcargo clippypassCloses #95