Lightning-fast and Powerful Code Editor written in Rust

Related tags

Text editors lapce
Overview


Lapce

Lightning-fast and Powerful Code Editor written in Rust

About

Lapce is written in pure Rust, with UI in Druid. It's using Xi-Editor's Rope Science for text editing, and using Wgpu for rendering.

Features

  • Modal Editing (Vim like) support as first class citizen (can be turned off as well)
  • Built in LSP support
  • Built in remote development support (inspired by VSCode Remote Development)
  • Plugin can be written in programming languages that can compile to WASI (C, Rust, AssemblyScript)
  • Built in terminal
Comments
  • Plugin Support

    Plugin Support

    The next major thing for Lapce is plugin support. The plugin system is a critical part of a good code editor. We'd like Lapce's plugin API to be as flexible as possible.

    To start with, it would be helpful to know, what plugin you desperately need as a user, or what plugin API you would like as a potential Lapce plugin author, so that we can start to implement something that's immediately useful.

    Feel free to leave comments below for plugins(/APIs) you'd like. A link to a plugin in a different code editor would be fine.

    A-plugins 
    opened by dzhou121 28
  • DPI/display scaling

    DPI/display scaling

    Seems like Lapce isn't handling a different display scale than 1.0 very well (at least on macOS):

    1. Resizing the window leaves only a small viewport in the corner, the rest of the window does not get redrawn at all.
    2. Line spacing is off, especially noticeable with box drawing characters like what nushell uses to draw its tables.
    C-bug A-ui 
    opened by jansol 22
  • Lapce is not Opening Macbook Air M1

    Lapce is not Opening Macbook Air M1

    Lapce Version

    V 0.2.0

    The Lapce version you are using, which can be found in "About Lapce" at the top right settings icon.

    System information

    Macbook Air M1

    the operating system used, including its version, e.g. Windows 10, Ubuntu 18.04

    Describe the bug

    i'm using Lapce many hours to in my project after i close and tried to run again it's not opening, i don't know, and system doesn't give any response.

    P-macos A-ui C-crash 💥 
    opened by abdorizak 21
  • [Linux] Failing to start with

    [Linux] Failing to start with "thread 'main' panicked"

    OS: Arch Linux

    Rust version:

    $ rustc -V
    rustc 1.57.0 (f1edd0429 2021-11-29)
    

    Toolchain:

    $ rustup toolchain list
    stable-x86_64-unknown-linux-gnu (default)
    

    Commit:

    5059101 - (HEAD -> master, tag: v0.0.1, origin/master, origin/HEAD) undo redo jump improvement (2021-12-01 11:43:38) <Dongdong Zhou>
    

    Output:

    $ RUST_BACKTRACE=1 target/release/lapce
    start to watch path "/home/<name>/.config/lapce/settings.toml"
    2021-12-14T11:12:57.482224Z DEBUG druid::localization: available locales [], current en-US
    2021-12-14T11:12:57.482276Z DEBUG druid::localization: resolved: [en-US]
    thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: NotSupported', /home/<name>/.cargo/git/checkouts/druid-f6980810fb848923/c42de0b/druid/src/window.rs:88:55
    stack backtrace:
       0: rust_begin_unwind
                 at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panicking.rs:517:5
       1: core::panicking::panic_fmt
                 at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/core/src/panicking.rs:100:14
       2: core::result::unwrap_failed
                 at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/core/src/result.rs:1616:5
       3: druid::window::Window<T>::new
       4: druid::win_handler::AppState<T>::build_native_window
       5: druid::app::AppLauncher<T>::launch
       6: lapce_core::app::lanuch
    note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
    palette update process stopped
    buffer update process stopped
    
    opened by channelbeta 21
  • Golang Support

    Golang Support

    This is a new version of the Golang support PR, up to date and cleaner than the old #385, as discussed with @dzhou121. Here is a paste of the previous PR message:

    Introduction

    This PR pushes the LSP client to a state where the Golang LSP server (gopls) is usable. While lapce might be missing plenty of capabilities (some of which might already be implemented and wirable), the goal of this PR is not to fill this gap but to make sure the base client is robust enough for any LSP server to run without any primary issues.

    This PR should allow starting proper work on #365 and #374, and any other LSP server support.

    Note: A very basic and hacky gopls plugin can be found here for the time being.

    closes #365

    Work

    • [X] Implement response on window/workDoneProgress/create request (Blocking "handshake" for gopls)
    • [X] Fix EditDocument error on gopls edit suggestion following a textDocument/completion request
    • [X] Fix lowercased suggestion on ui
    • [X] Implement env passing for wasi runtime
    • [x] Fix misplaced error marker

    How to test

      # link the plugin folder to lapce plugin directory
      ln -s $PWD ~/.lapce/plugins/lapce-go
      #  build the actual wasm binary
      cargo wasi build && cp target/wasm32-wasi/debug/lapce-go.rustc.wasm lapce-go.wasm 
    
    
    • Lapce should be able to launch the plugin without any issue. To confirm, look for the output of lapce. if "Starting lapce-go plugin!" appears, the plugin is working.
    C-feature A-lsp 
    opened by nheuillet 19
  • Drawing text only paints bounding boxes

    Drawing text only paints bounding boxes

    Since this commit 4abb0faf0a0b8eae1919d8f34ac92643f3de35bc that switched to opengl backend.

    Tested the debug build. Didn't have time for release build.

    It compiles but almost all text become "blocks" in the UI, like below:

    Screen Shot 2022-04-22 at 15 23 23

    The machine info:

    Screen Shot 2022-04-22 at 15 26 47 C-bug A-ui 
    opened by zhaojiangbin 19
  • App failed on start

    App failed on start

    Error:

    Running `target/debug/lapce`
    start to watch path "/home/balrog/.config/lapce/settings.toml"
    palette update process stopped
    buffer update process stopped
    thread 'main' panicked at 'launch failed: WindowDropped', core/src/app.rs:35:10
    

    OS: ArchLinux WM: Sway Lapce: build from source, commit a61d3b2966f4634ebad6b639692cffd0536d99c0

    C-bug P-linux A-ui Dependency 
    opened by balroggg 17
  • Binaries don't work for Linux

    Binaries don't work for Linux

    Tested it on Fedora Linux 35

    Tried both the pre-built ones and install from source Ran it with RUST_BACKTRACE=full ./lapce in the directory containing lapce and lapce-proxy

    2022-01-05T00:05:23.574145Z DEBUG hyper::client::connect::http: connecting to [2606:50c0:8001::153]:443
    primitives buffer size 80000
    thread 'main' panicked at 'Error in Surface::configure: requested format Bgra8UnormSrgb is not in list of supported formats: [Bgra8Unorm]', /home/username/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-0.11.1/src/backend/direct.rs:204:9
    stack backtrace:
       0:     0x5612e0b561bc - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h3264ad1edb4a78ca
       1:     0x5612e0b7e5ac - core::fmt::write::h85b247e856e081ad
       2:     0x5612e0b4dad5 - std::io::Write::write_fmt::he3b80a66fc2ba5d3
       3:     0x5612e0b58200 - std::panicking::default_hook::{{closure}}::hf2bcdea8e51c0c13
       4:     0x5612e0b57db5 - std::panicking::default_hook::h8864cfaaed08e53a
       5:     0x5612e0b588b4 - std::panicking::rust_panic_with_hook::hb272975096b9f3ce
       6:     0x5612e0b58390 - std::panicking::begin_panic_handler::{{closure}}::hbbd6c4e11858ba52
       7:     0x5612e0b56684 - std::sys_common::backtrace::__rust_end_short_backtrace::hdd56e8729123abc5
       8:     0x5612e0b582f9 - rust_begin_unwind
       9:     0x5612dfcc41bb - std::panicking::begin_panic_fmt::hd76138c622de6537
      10:     0x5612e089b0c9 - wgpu::backend::direct::Context::handle_error_fatal::h2b53a5b30cfcf08d
      11:     0x5612e089b9c2 - <wgpu::backend::direct::Context as wgpu::Context>::surface_configure::he20a1e8a34e24cbb
      12:     0x5612e0796415 - piet_wgpu::WgpuRenderer::set_size::h95f62aa4f100231d
      13:     0x5612dfcf5b25 - druid::window::Window<T>::new::hcdf5f948b0d20ab3
      14:     0x5612dff0f91c - druid::win_handler::AppState<T>::build_native_window::h08bf5a7f5c7457b6
      15:     0x5612dfe35540 - druid::app::AppLauncher<T>::launch::hdae140a75a25f2d6
      16:     0x5612dfcfff6d - lapce_core::app::lanuch::h63fdae4aff85c239
      17:     0x5612dfcc5753 - std::sys_common::backtrace::__rust_begin_short_backtrace::hf9f3ecc31df8f70d
      18:     0x5612dfcc57a9 - std::rt::lang_start::{{closure}}::h9436d6b2c5c2d0a3
      19:     0x5612e0b55e9b - std::rt::lang_start_internal::hcbc5d1079a591413
      20:     0x5612dfcc5792 - main
      21:     0x7fdf26fa6560 - __libc_start_call_main
      22:     0x7fdf26fa660c - [email protected]@GLIBC_2.34
      23:     0x5612dfcc5685 - _start
      24:                0x0 - <unknown>
    2022-01-05T00:05:23.822030Z DEBUG hyper::client::connect::http: connected to [2606:50c0:8001::153]:443
    palette update process stopped
    buffer update process stopped
    
    C-bug A-ui Dependency 
    opened by VarLad 15
  • Auto Assign C-feature or C-bug when new issues are created

    Auto Assign C-feature or C-bug when new issues are created

    This feature is a good way to auto assign labels making it easy to filter when new suggestions or bugs are coming through just with a filter selection on GitHub. You will not have to add them your selfs it will automatically add it.

    Here is a video describing what it does.

    https://user-images.githubusercontent.com/83801755/190030171-32dcdb7f-0ab7-4d49-83e0-696b69e9a938.mp4

    opened by TwoThreeTwo 14
  • Some components is missing

    Some components is missing

    Environment: M1Pro, macos 12.4 I have tried building from source or download .dmg directly.

    When I open Lapce and try to install plugin(rust LSP), nothing is there.. image

    C-bug P-macos A-ui 
    opened by LimingFang 14
  • Adding Setting to control palette preview editor's width

    Adding Setting to control palette preview editor's width

    Closes #872

    • The preview_editor_width an its respective getter function were added to the UIConfig struct on lapce-data/config.rs.
    • A default value preview_editor_width was added to defaults/settings.toml.
    • The variable input_width was added to the layout method on pallete.rs, it's value will be the difference between the input_size.width and width, if the value of data.config.ui.preview_editor_width is greater than the value contained on width, or zero. Such variable is used as helper to center the input bar appropriately based on the preview_editor_width.
    • The width of the different elements defined on the layout function is now computed using f64::max in order to keep consistency on the UI.
    A-ui 
    opened by jmj0502 13
  • Fix auto-completion crash

    Fix auto-completion crash

    When a suggestion by the auto-completion is accepted, lapce crashes. Let's imagine a scenario that we type in 3 letters ("com" of "compile") and accept a suggestion with the following delta, which is neither a simple insert nor a simple delete.

    Copy(0, 1230), # Insertion position is 1230
    Insert("compile_only(exercise)"), # Accepted suggestion of length 22
    Copy(1233, 6140). # The 3-letter hint for the auto-completion
    

    When we factor this delta into insertions and deletions we get the following insert-only delta

    Copy(0, 1230),
    Insert("compile_only(exercise)"),
    Copy(1230, 6140),
    

    and segments representing the deletions

    {len: 1230, count: 0},
    {len: 3, count: 1},
    {len: 4907, count: 0}.
    

    In this scenario shift is 22 and CountMatcher::Zero matches the zero counts of deletion segments yielding (0, 1230) for (start, end) in the first iteration, which leads to an overflow crash in

    shift -= end - start.
    

    Here, we should use CountMatcher::NonZero so that the iterator yields (1230, 1233) and the overflow is avoided since one can expect suggestions have more characters than the hints we type in for the suggestions.

    opened by gokhanettin 1
  • Add `portable` feature (windows)

    Add `portable` feature (windows)

    This is the first step in #1351 The feature is necessary because the self-update algorithm is different between the portable and installed versions.

    Unfortunately, I don't think target.'cfg(windows)'.features] exists (at least it didn't work for me) so the portable feature exists (but is ineffective) outside of Windows builds, as well.

    opened by bugadani 0
  • Inactive code should not be flagged as warning

    Inactive code should not be flagged as warning

    Lapce Version

    26/9 nightly

    System information

    Windows 11

    Describe the bug

    Inactive code is underlined as if it were generating warnings. Instead, it should be dimmed.

    image

    C-bug A-lsp A-editor 
    opened by bugadani 0
  • Wrong cursor position after applying postfix completion

    Wrong cursor position after applying postfix completion

    Lapce Version

    0.2.0

    Describe the bug

    After applying postfix completion (for instance let or letm` with rust-analyzer), tab-location are not shown and the cursor is re-positioned at the end of the current line. Cursor should be placed at the correct edit location after applying postfix completion.

    screenshot-2022-09-26T10:38:21 screenshot-2022-09-26T10:38:32

    Edit: this is also true for other kind of completion ( for instance RA -> "Implement missing members"), The tab-locations seems to work only for snippet (like RA macro_rule).

    C-bug A-lsp 
    opened by oknozor 0
  • feat(editor): add autosave configuration

    feat(editor): add autosave configuration

    This add an autosave-interval key to editor config, allowing to set up autosave. The config setting default to zero, which disable auto-saving.

    Closes #248

    opened by oknozor 3
Releases(nightly)
Owner
Lapce
Lapce
TIF is a terminal_image_format. (theres no TIF editor, so i made TIF images through a hex editor lol)

Colors these are the colors you can use when displaying images on the terminal BYTES: 5A = BLUE 5B = BLACK 5C = RED 5D = GREEN 5E = PURPLE 5F = WHITE

buzz 4 Jun 21, 2022
A text editor in ≤1024 lines of code, written in Rust

Kibi: A text editor in ≤1024 lines of code, written in Rust A configurable text editor with UTF-8 support, incremental search, syntax highlighting, li

Ilaï Deutel 839 Sep 24, 2022
Rustpad is an efficient and minimal collaborative code editor, self-hosted, no database required

Rustpad is an efficient and minimal open-source collaborative text editor based on the operational transformation algorithm

Eric Zhang 2.4k Sep 25, 2022
My own personal code editor built with Rust + OpenGL

Glyph This is my personal code editor that I am building for fun and to get more familiar with OpenGL. Glyph currently supports Vim keybinds, syntax h

Zack Radisic 72 Sep 26, 2022
An opinionated modal editor to simplify code editing from the terminal

(I'm currently refactoring the platform layer. So we have to first finish this cleanup before we're able to continue adding features) An opinionated m

Matheus Lessa Rodrigues 271 Sep 24, 2022
A package manager for the Lite-XL code editor

Lite-XL Package Manager (lpm) (Under Development) lpm is an attempt to create a package manager for the Lite-XL code editor. It's primary goal is to p

Debarchito Nath 9 Aug 29, 2022
A pathtracer written in rust - runs in the web and includes an editor

Webtracer A pathtracer written in rust - runs in the web and includes an editor Rendering is parallelized and utilizes all cpu cores You can easily ed

Shapur 2 Aug 29, 2022
A terminal-based text editor written in Rust

Iota Iota is a terminal-based text-editor written in Rust. Here's what it looks like right now, editing itself. Motivation Iota was born out of my fru

Greg Chapple 1.5k Sep 20, 2022
A modern editor with a backend written in Rust.

Xi Editor (pronounced "Zigh") A modern editor with a backend written in Rust. Maintenance status: The xi-editor project is not currently under active

null 19.6k Sep 27, 2022
Web base text editor written in rust

Ultron Ultron is a web based monospace text-editor with syntax highlighting, completely written in rust. I wrote this code editor for my very specific

Jovansonlee Cesar 59 Aug 8, 2022
A collision editor for Guilty Gear -Strive-, written in Rust

ggst_collision_editor_rs A collision editor for Guilty Gear -Strive- and other Team Red Arc System Works games, written in Rust. Uses a customized ver

null 4 May 3, 2022
Helix - A kakoune / neovim inspired editor, written in Rust

A kakoune / neovim inspired editor, written in Rust. The editing model is very heavily based on kakoune; during development I found myself agree

null 13.1k Sep 28, 2022
Borderlands 3 Save/Profile Editor for Windows/MacOS and Linux!

Borderlands 3 Save Editor A tool to help you modify your Borderlands 3 Saves and Profiles. Currently it runs on Windows, Mac OS and Linux. It supports

Zak 178 Sep 19, 2022
An independent Rust text editor that runs in your terminal!

Ox editor Ox is a code editor that runs in your terminal. About The Project Ox is a code editor. It was written in Rust using ANSI escape sequences. I

null 2.8k Sep 27, 2022
Rust-based traffic editor for RMF

Traffic Editor III Welcome to Traffic Editor III. install stuff Unfortunately we need a newer Rust than what comes with Ubuntu 20.04. First make sure

null 1 Nov 26, 2021
A simple terminal-based editor made in rust!

ELuna Editor The terminal-based editor for europa lang. Goals Be as minimal as possible, but retain conveniences found in other editors. Do not add fe

Junhao 3 May 25, 2022
Ginkgo is a text editor built entirely in Rust

Ginkgo is a text editor built entirely in Rust. It supports cursor movements, CTRL commands, select vim commands, insert vs. normal modes, and more. Ginkgo is based on my text editor JED, which itself was based on the popular online editor Kilo.

James Asbury 11 Mar 21, 2022
Aspiring vim-like text editor

Rim Rim is an aspiring Vim-like text editor written in Rust. Current state Rim is in an early prototype stage. This means that you can load, edit and

Mathias Hällman 547 Sep 24, 2022
An experimental next-generation Electron-based text editor

Attention: GitHub has decided not to move forward with any aspect of this project. We'll archive the repository in case anybody finds value here, but

Atom Archive 8.6k Sep 22, 2022