Lapce is an [[Apache v2]] licensed [[Code Editor]] written in [[Rust]].
- [Website](https://lapce.dev/)
- [Source](https://github.com/lapce/lapce)
- [Documentation](https://docs.lapce.dev/)
> Lightning-fast and Powerful Code Editor written in Rust
# Notability
Noted on the [[Xi]] repo's readme as being its spiritual successor.
Doesn't use Electron.js - a [[Native App]]!
A rare example of a [[Modal Editor]] in [[GUI]] mode.
# Thoughts
I *really* want to like this and recommend it but the official builds are so busted on my system that I just can't even use the damned thing for 5 minutes without it crashing or running into some new weird bug.
# Philosophy
> Lapce (IPA: /læps/) is written in pure Rust with a UI in [Floem](https://github.com/lapce/floem). It is designed with [Rope Science](https://xi-editor.io/docs/rope_science_00.html) from the [Xi-Editor](https://github.com/xi-editor/xi-editor) which makes for lightning-fast computation, and leverages [Wgpu](https://github.com/gfx-rs/wgpu) for rendering. More information about the features of Lapce can be found on the [main website](https://lapce.dev) and user documentation can be found on [GitBook](https://docs.lapce.dev/).
# Platform Support
- Linux
# Features
- Built-in LSP ([Language Server Protocol](https://microsoft.github.io/language-server-protocol/)) support to give you intelligent code features such as: completion, diagnostics and code actions
- Modal editing support as first class citizen (Vim-like, and toggleable)
- Built-in remote development support inspired by [VSCode Remote Development](https://code.visualstudio.com/docs/remote/remote-overview). Enjoy the benefits of a "local" experience, and seamlessly gain the full power of a remote system.
- Plugins can be written in programming languages that can compile to the [WASI](https://wasi.dev/) format (C, Rust, [AssemblyScript](https://www.assemblyscript.org/))
- Built-in terminal, so you can execute commands in your workspace, without leaving Lapce.
- Built-in [[git]] integration similar to [[VS Code]]'s with a really nice diff view
## Issues
### Too Many Files Crash
I know I do a lot of things on my computer but it's pretty rare that I have an app which refuses to start because of "too many open files". Lapce did this to me until I killed a couple of other processes. Then I restarted the other apps without incident. So it seems like a problem with the way Lapce is checking file limits?
Looks like I'm not the only person to have encountered this problem because I've found other people making similar comments.
### Diff Lockup
Also, when looking through some diffs in a small git repo it randomly locked up. Shame, it's really looking nice. If they can make it stable I'd love to use it more.
### Syntax Highlighting Broken
For whatever reason, Lapce tries and fails to download [[Treesitter]] grammars itself, and printed these errors to `stdout`:
```
2026-05-04T21:22:02.311274Z ERROR main lapce_app::app: 3809: Connection refused (os error 111)
2026-05-04T21:22:02.472156Z ERROR FindGrammar lapce_app::app: 3945: failed to obtain release info: Couldn't find any release
2026-05-04T21:26:46.250364Z ERROR main lapce_core::language: 1792: Go Error("grammar not found")
2026-05-04T21:28:01.499296Z ERROR main lapce_core::language: 1792: Bash Error("grammar not found")
2026-05-04T21:28:03.171287Z ERROR main lapce_core::language: 1792: Sql Error("grammar not found")
```
So I manually download them from their repo, which fixes the "grammar not found" message, but still no syntax highlighting.
I look at the log and see this mess:
```
2026-05-04T21:32:07.526608Z DEBUG lapce_core::language: Loading grammar from user grammar dir
2026-05-04T21:32:07.526729Z DEBUG lapce_core::language: Loading grammar with address: 'tree_sitter_sql'
2026-05-04T21:32:07.526753Z WARN lapce_core::language: Failed to read queries at: "/home/user/.config/lapce-stable/queries/sql/highlights.scm", No such file or directory (os error 2)
2026-05-04T21:32:07.526763Z WARN lapce_core::language: Failed to read queries at: "/home/user/.config/lapce-stable/queries/sql/injections.scm", No such file or directory (os error 2)
2026-05-04T21:32:10.014478Z DEBUG lapce_core::language: Loading grammar from user grammar dir
2026-05-04T21:32:10.014606Z DEBUG lapce_core::language: Loading grammar with address: 'tree_sitter_bash'
2026-05-04T21:32:10.014636Z WARN lapce_core::language: Failed to read queries at: "/home/user/.config/lapce-stable/queries/bash/highlights.scm", No such file or directory (os error 2)
2026-05-04T21:32:10.014647Z WARN lapce_core::language: Failed to read queries at: "/home/user/.config/lapce-stable/queries/bash/injections.scm", No such file or directory (os error 2)
2026-05-04T21:40:11.719022Z DEBUG lapce_core::language: Loading grammar from user grammar dir
2026-05-04T21:40:11.719152Z DEBUG lapce_core::language: Loading grammar with address: 'tree_sitter_log'
2026-05-04T21:40:11.719184Z WARN lapce_core::language: Failed to read queries at: "/home/user/.config/lapce-stable/queries/log/highlights.scm", No such file or directory (os error 2)
2026-05-04T21:40:11.719194Z WARN lapce_core::language: Failed to read queries at: "/home/user/.config/lapce-stable/queries/log/injections.scm", No such file or directory (os error 2)
```
Treesitter is literally a psyop. Syntax highlighting has been a reasonably solved problem for *decades*. 20 year old [[Vimscript|VimL]] files work flawlessly. Some editors still support [[Sublime Text]] syntax files. But anything using [[Treesitter]] always hits bizarre snags. Getting treesitter working on [[NeoVim]] is also a nightmare.
There are *dozens* of bug reports[^3] of broken syntax highlighting, one user[^2] is even convinced that Lapce doesn't support it at all. Most of these issues have no replies. Closed issues on the topic will have a "fixed" comment with no explanation or linked commit so I have no idea what the cause is.
### Too Many Files Redux: Undefined State
I tried to use the `reload window` command and was greeted with a panic message on `stdout`:
```
thread 'ProxyRpcHandler' (809070) panicked at lapce-proxy/src/watcher.rs:64:51:
watcher should spawn: Error { kind: Io(Os { code: 24, kind: Uncategorized, message: "Too many open files" }), paths: [] }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```
Everything about the UI got weird too. Every editor pane was empty, only a few random widgets still had info. Great.
Tried to restart the app and got only this a bunch:
```
2026-05-04T21:45:06.390672Z ERROR ThreadId(22) lapce_core::syntax: 966: Cancelled
```
App is totally dead. Will not show GUI anymore.
I found a file at `~/.local/share/lapce-stable/local.sock` and when I deleted it the app restarted but crashed with this output:
```
2026-05-04T21:49:43.029383Z ERROR main lapce_app::app: 3809: No such file or directory (os error 2)
thread 'main' (810869) panicked at lapce-app/src/app.rs:3840:75:
called `Result::unwrap()` on an `Err` value: Error { kind: Io(Os { code: 24, kind: Uncategorized, message: "Too many open files" }), paths: [] }
stack backtrace:
0: 0x55cd326aac12 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h718e2d17a1928e63
1: 0x55cd30ef2dbf - core::fmt::write::h1d2246b072ea91eb
2: 0x55cd326aa69f - std::io::Write::write_fmt::haf55272405c09d9b
3: 0x55cd326aaa73 - std::sys::backtrace::BacktraceLock::print::h61c3bd81a9458a03
4: 0x55cd326aa0ca - std::panicking::panic_with_hook::h43adc00fd0e494cb
5: 0x55cd326d3008 - std::panicking::panic_handler::{{closure}}::h44391079756da3e7
6: 0x55cd326d2f69 - std::sys::backtrace::__rust_end_short_backtrace::h934e1568393e5b8f
7: 0x55cd326d2f5c - __rustc[d9b87f19e823c0ef]::rust_begin_unwind
8: 0x55cd30ef3ddf - core::panicking::panic_fmt::h62031895f6e012da
9: 0x55cd30f00ed5 - core::result::unwrap_failed::h8e46864fd8bf13c6
10: 0x55cd319b0fb2 - lapce_app::app::launch::h7e088c337e007ba3
11: 0x55cd30ded523 - std::sys::backtrace::__rust_begin_short_backtrace::hc67b20bb4c620757
12: 0x55cd30deda03 - main
13: 0x7f032c42b5ac - <unknown>
14: 0x7f032c42b6ca - __libc_start_main
15: 0x55cd30ded02e - _start
16: 0x0 - <unknown>
```
Truly bizarre behavior. I have no idea what to do with this thing.
I went looking through `/proc` to see if there were any processes with huge numbers of open files, the one with the most was of course my web browser. Nothing else looked out of place.
#### Update: Open Files a Red Herring?
Several days later I was poking around something else that had been bothering me: Separate from this, I sometimes have been getting a notification from KDE to increase my inotify limit, so I dug into it a bit more.
The tool `kde-inotify-survey` dumps JSON that shows info on applications that are using inotify. It looks like the number of `instances` was the value near the limit, there were still ~10 available when I checked. Of the applications using `instances`, the main users are [[Jellyfin]] and ironically [[VS Code|vscode]], with 12 and 14 respectively.
So I increased the limit by 4x like this:[^1]
```sh
sudo sh -c "echo fs.inotify.max_user_instances=512 >> /etc/sysctl.conf" && sudo sysctl -p
```
Re-running `kde-inotify-survey` showed that the new limit had properly taken affect.
However, upon reboot, the value was reset to 128. I re-ran `sudo sysctl -p` and my settings were restored, so Solus must not be reading the `sysctl.conf` file on startup.
Running `lapce` and it came up fine, zero issues.
Might this be the actual reason for why it was crashing? Running out of inotify instances shouldn't be a fatal error in any case, and most other applications are able to run just fine, except I think for another [[Rust]]-based editor. So I consider this a bug - probably in a supporting [[Rust]] library or just a mishandled or mis-configured exception.
# Tips
## See Editor Backtraces
Run the program like this from a terminal window:
```sh
RUST_BACKTRACE=full lapce -w
```
This will actually report errors and show you what is going on when it crashes or freezes.
# References
[^1]: https://discussion.fedoraproject.org/t/what-is-inotify-instance-capacity-low-notification/85308/4
[^2]: https://github.com/lapce/lapce/discussions/3893
[^3]: https://github.com/search?q=repo%3Alapce%2Flapce+syntax+highlighting&type=issues