Commit Graph

437 Commits

Author SHA1 Message Date
Dongdong Zhou 7c3405c147 just language configurations 2024-08-08 19:22:09 +01:00
Dongdong Zhou 36bebb6d15 add markup syntax color for markdown 2024-08-08 19:02:28 +01:00
Dongdong Zhou 8661de659d bump floem 2024-08-06 23:33:25 +01:00
Dongdong Zhou 0f1aeddfc2 tree sitter nightly version detection change 2024-08-03 13:44:53 +01:00
Jakub Panek 87a517a1cd
add more languages, cleanup code (#3396)
* add more languages, cleanup code

* replace inline indents declarations with comptime

* remove newlines

* rename (lapce) "code lens" to "code glance"
2024-08-01 18:07:27 +01:00
Dongdong Zhou 20fa316f2c fix git commit char length in version 2024-07-22 20:42:26 +01:00
ifengqi 8a610b0442
Fix head's path (#3380) 2024-07-22 18:24:25 +02:00
Jakub Panek 94c83124ab
fix: dont use git2 for linux, since it fails when cross-compiling 2024-07-21 00:38:39 +02:00
Jakub Panek af42f186ed
fix grammars fetching, log errors for queries, add zstd
log errors when reading queries

add error context to grammars fetching

fix grammars fetching, allow zstd archives
2024-07-13 09:30:08 +02:00
Jakub Panek 9f120f9016
re-implement grammar/queries update system (#3341) 2024-07-12 06:03:12 +02:00
ifengqi 28302a43ec
Terminal file jump: change the judgment point to Ctrl + left mouse click. (#3342)
* 1. Terminal file jump: change the judgment point to Ctrl + left mouse click.
2. Optimize some code according to clippy.

* 1. Fix the issue where the actual Point are incorrect due to the scroll bar.

* 1. Adjust the actual number of lines and characters.
2024-06-28 11:22:06 +01:00
Jakub Panek dd1dce96ef
format imports 2024-06-24 11:47:39 +02:00
Dongdong Zhou f5fddebb5d update tree-sitter 2024-06-20 22:36:11 +01:00
Dongdong Zhou 28988c8fa2 load tree sitter quries from folder 2024-06-13 22:32:11 +01:00
Dongdong Zhou caab22d091 Fix lanaguage from path 2024-06-12 22:20:30 +01:00
Jakub Panek d4c562fcae
fix file language detection from path
detection was broken due to Option's returning early on
file_stem() and extension()
2024-06-12 10:13:31 +02:00
Jakub Panek 682ed93f23
remove unused dependencies (#3296) 2024-06-02 11:45:03 +02:00
Jakub Panek 4af4244397
format code 2024-06-02 10:10:07 +02:00
Jakub Panek bfb0358c53
upgrade include_dir 2024-06-01 18:10:51 +02:00
Jakub Panek 09065bb7af fix: remove tree-sitter-yaml
fixes #3251
2024-05-07 22:07:45 +02:00
Jakub Panek 3dc59aeb27 fix: remove unsupported highlight for cpp 2024-05-01 15:44:30 +02:00
Jakub Panek 7ebdf7f5bb fix fmt 2024-04-23 03:38:26 +02:00
Jakub Panek 468d416704 log target lapce_core=debug, try to unload library on failure and log the error 2024-04-23 03:11:53 +02:00
Dongdong Zhou 9fb61d0a72 remember panel section open status 2024-04-19 22:20:52 +01:00
dependabot[bot] c1ce13d1ce chore(deps): bump libloading from 0.7.4 to 0.8.1
Bumps [libloading](https://github.com/nagisa/rust_libloading) from 0.7.4 to 0.8.1.
- [Commits](https://github.com/nagisa/rust_libloading/compare/0.7.4...0.8.1)

---
updated-dependencies:
- dependency-name: libloading
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-15 20:07:35 +00:00
Jakub Panek 54d9a7b7b2
fix: switch to tree-sitter-json crate 2024-04-05 07:09:31 +02:00
dependabot[bot] bc617f8995
chore(deps): bump tree-sitter-javascript from 0.20.3 to 0.20.4 (#3112)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-01 01:36:50 +02:00
MinusGix cfc88c434b
Update floem (#3134) 2024-04-01 00:49:20 +02:00
Jakub Panek 51a56ac085
style: format Cargo manifests (#3092) 2024-03-24 17:56:31 +00:00
Jakub Panek 16e0775297
fix: update msrv (#3013) 2024-03-21 16:52:41 +01:00
dependabot[bot] c289599826
chore(deps): bump tree-sitter-cpp from 0.20.4 to 0.20.5
Bumps [tree-sitter-cpp](https://github.com/tree-sitter/tree-sitter-cpp) from 0.20.4 to 0.20.5.
- [Commits](https://github.com/tree-sitter/tree-sitter-cpp/compare/v0.20.4...v0.20.5)

---
updated-dependencies:
- dependency-name: tree-sitter-cpp
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-04 05:48:43 +00:00
geekvest 52de8302c1
fix some comments (#3030)
Signed-off-by: geekvest <cuimoman@sohu.com>
2024-03-03 13:42:19 +00:00
dependabot[bot] ed3f599360
chore(deps): bump tree-sitter-cpp from 0.20.0 to 0.20.4
Bumps [tree-sitter-cpp](https://github.com/tree-sitter/tree-sitter-cpp) from 0.20.0 to 0.20.4.
- [Commits](https://github.com/tree-sitter/tree-sitter-cpp/compare/v0.20.0...v0.20.4)

---
updated-dependencies:
- dependency-name: tree-sitter-cpp
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-15 12:55:51 +00:00
dependabot[bot] 3099fff025
chore(deps): bump tree-sitter-c from 0.20.6 to 0.20.8
Bumps [tree-sitter-c](https://github.com/tree-sitter/tree-sitter-c) from 0.20.6 to 0.20.8.
- [Release notes](https://github.com/tree-sitter/tree-sitter-c/releases)
- [Commits](https://github.com/tree-sitter/tree-sitter-c/compare/v0.20.6...v0.20.8)

---
updated-dependencies:
- dependency-name: tree-sitter-c
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-15 12:21:10 +00:00
dependabot[bot] 8044cdadba
chore(deps): bump tree-sitter-javascript from 0.20.1 to 0.20.3
Bumps [tree-sitter-javascript](https://github.com/tree-sitter/tree-sitter-javascript) from 0.20.1 to 0.20.3.
- [Commits](https://github.com/tree-sitter/tree-sitter-javascript/compare/v0.20.1...v0.20.3)

---
updated-dependencies:
- dependency-name: tree-sitter-javascript
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-15 11:16:24 +00:00
MinusGix 6e7aa1c5ab
Floem Editor (#2909)
* Initial sketch of floem-editor

* Very basic phantom

* Basic wrapping + layout styling

* More phantom, more styling, more view code

* Line height, more drawing code

* More drawing logic

* Move to separate crate

* Add example; fixes

* Partial reimpl of Lapce's Document

* Downcasting Document; add basic EditorData impl

* Progress on implementing run_command

* More progress on run_command

* Editor container view

* Hook up modal and smart tab

* Receive char

* Add clicking support

* Add Ctrl+{Home,End}

* Remove usage of buffer in Cursor::yank

* Bunch of editor -> new editor functions impl

* Scroll commands and other bits

* Make buildable

* Cursor blink; remove vestiges of sticky header

* Impl compute screen lines for new doc

* Replace existing modules with floem-editor versions

* Shift over to using floem-editor (broken)

* Remove uses of original doc

* Rename doc2 -> doc

* Don't force Rc to allow swapping out Editor signals

* Add Styling::id; various minor changes

* Fix updating Lines

* Hook up styling

* Deduplicate many pieces of paint logic

* Make indentation on newline configurable

* Impl scroll commands

* Add clippy changes from non-rebased commit

* Simplify+improve view update logic; fix style sharing bug

* Stop returning SyntaxEdit on edits

This was needed so that we can avoid depending on tree-sitter when extracting the buffer + editing logic out to floem-editor
This actually makes it cheaper in the cases where we don't need the edits.
However we are factoring the delta twice now. It would be better to not do that.

* Remove Syntax usage in Buffer

* Move syntax/util.rs, because syntax won't be in floem-editor-core

* Move all editor logic out of lapce-core and into floem-editor-core

* Remove lapce deps from floem-editor

* Fix warnings

* Fix various floem-editor TODOs

* Make cursor blink at the correct times

* Move last_movement onto floem-editor

* Rename core Editor -> Action to avoid name collisions

* Avoid crash where line is out of bounds while loading file

* Return iterative ropes with deltas

* Put off some todos; Reimpl some missing select cmds

* Dispose of editor on cleanup

* Move floem-editor to floem; various changes from that

* Update to use latest floem

* Update floem; Pass cache rev
2024-02-12 21:23:15 +00:00
bbrabbitt 2c08177d9b
feat(editor): bracket colorization (#2835)
* feat(editor): bracket highlight

style: apply clippy fix

* feat(editor): use tree-sitter parser, add config and theme colors for colorization

* fix: clear bracket_pos to prevent miscolored characters

* fix: add fallback colors if theme does not provide bracket colors

chore: fmt

* fix: utf-8 char will cause crash

fix: brackets in string interpolation

* rename config; add get_base_color instead of using TERMINAL

* remove fallback

* fix: pass config to Document::new

* update colorization code

* cargo fmt

* feat(editor): use tree-sitter parser, add config and theme colors for colorization

* fix: clear bracket_pos to prevent miscolored characters

* fix: utf-8 char will cause crash

fix: brackets in string interpolation

* rename config; add get_base_color instead of using TERMINAL

* remove fallback

* fix: pass config to Document::new

* update colorization code

* cargo fmt

* add bracket colorization limit

* cargo fmt and clippy

* merge

* merge

* merge to latest doc.rs

* update doc.rs

* change from to_string to String::new

* set colorization to off by default
2024-01-18 22:50:01 +01:00
Dongdong Zhou 9424a3336a bump floem 2024-01-05 21:25:02 +00:00
Alexandre Leblanc 1d585b2bb5
fix: detect git changes when no commit in repository (#2872)
* fix: Display untracked files on a fresh git repository.

Issue #2779.

Known issue: files without history are displaying text-less diff.

* fix: Display untracked files on a fresh git repository.

Issue #2779.

Known issue: files without history are displaying text-less diff.

* fix: clippy warnings

* fix: clippy errors

---------

Co-authored-by: Alexandre Leblanc <a.leblanc@kitai.dev>
2023-12-30 18:09:43 +00:00
Jakub Panek 5c09aa731d
fix: add cmakelists to cmake lang (#2864) 2023-12-27 04:52:43 +01:00
MinusGix e9435735f2
Implement inline completion (#2846) 2023-12-11 19:08:05 +00:00
MinusGix f1a96106c1
Doc backend (#2836)
* Initial basic save backend

* Trait extension, move history to backend

* Move diagnostics to Document backend

* Move inlay hints to Document backend

* Move completion lens to Document backend

* Move code actions to Document backend

* Move syntax/semantic highlighting to Document backend

* Move breakpoints to Document backend

* Rename ProxyBackend -> DocBackend

* Update floem
2023-12-09 19:06:54 +00:00
Jakub Panek 7a330513af
fix: hide inline grammars (#2840) 2023-12-08 18:49:12 +01:00
MinusGix 87e0fc06f1
Line wrap (#2723)
* Line-wrap impl

* Fix paint normal selection around linewrapping and phantom text

* Fix linewise selection

* Maybe fix scroll bug

* Fix breakpoint positioning

* Clippy fixes

* Docs + Fixes + Cleanup

* Make phantom text before_col more indirect

This will be useful once we stop aggressively computing the full PhantomText whenever it is accessed.

* Make over-monomorphizations over TextLayoutProvider less likely

* Fix bench
2023-12-05 14:14:37 +00:00
Dongdong Zhou 2cf6fa12cb add ruby tree sitter queries 2023-12-04 21:11:08 +00:00
riverbl 9009c97916
Reworked cursor rendering, fixing several bugs (#2803)
* Block cursors were rendered with a fixed width, rather than the width of the current character, when after an inlay hint and using a variable width font.

* In visual normal mode, the selection highlight didn't extend past the end of the current line when the cursor was past the end of the line.

* In visual normal mode, if there was an inlay hint after the end of the current line and the cursor was past the end of the line, the cursor was rendered after the inlay hint.

* In visual normal and block modes, when selecting backwards to the first character after an inlay hint, the selection highlight extended leftward of the cursor to include the inlay hint.

* When there were multiple cursors on the same line, only one was rendered.

* The selection highlight for visual block mode excluded the rightmost column when selecting right and up or left and down.

* When in visual block mode, when the cursor was to the left of the anchor column of the selection and past the end of the line, the cursor wasn't rendered.
2023-11-20 19:23:49 +00:00
riverbl f26e045978
Fix non_canonical_partial_ord_impl clippy lints (#2798)
* Reimplement PartialOrd in terms of Ord for some types to fix non_canonical_partial_ord_impl (previously called incorrect_partial_ord_impl_on_ord_type) clippy lints

* Fix potential incorrect order or panic when comparing FileNodeViewData objects containing invalid unicode
2023-11-20 12:07:59 +00:00
Tv 8a137c5b2c
Add explicit static lifetime to consts (#2793)
This removes 219 warnings with Rust 1.74.0.
All changes are from `cargo fix`.
See https://github.com/rust-lang/rust/issues/115010
2023-11-19 21:21:14 +00:00
Elmeri Keitaanranta d3e8ea8c6a
Auto-surround config (#2764)
* wrap selected text with corresponding char fix

* auto-surround config
2023-11-08 21:38:32 +00:00
Jakub Panek de2d7b11e1
fix language name used in status bar (#2724)
* fix language name used in status bar

* use new name() func

* simplify to string conversion

* fix format
2023-11-06 09:37:14 +01:00