Commit Graph

432 Commits (4c82a21b2753e78170e21d09d5396efd29585ec2)

Author SHA1 Message Date
mattwparas 76d665b0c9 address more comments 9 months ago
mattwparas f9ad6ef571 remove unnecessary keybinding functions 9 months ago
mattwparas d7ef4824e1 remove global keybindings thread local 9 months ago
mattwparas 759d32e8ac remove repr c 9 months ago
mattwparas cf967ed71e addressing more comments 9 months ago
mattwparas eb20adbaad add new xtask for code generation of core libraries 10 months ago
mattwparas 38f344c21c removing the language and theme configurations in favor of a better implementation in the future 10 months ago
mattwparas 392275ddb2 merge latest from master 10 months ago
Pascal Kuthe 87a720c3a1
make path changes LSP spec conform (#8949)
Currently, helix implements operations which change the paths of files
incorrectly and inconsistently. This PR ensures that we do the following
whenever a buffer is renamed (`:move` and workspace edits)

* always send did_open/did_close notifications
* send will_rename/did_rename requests correctly
  * send them to all LSP servers not just those that are active for a
    buffer
  * also send these requests for paths that are not yet open in a buffer (if
    triggered from workspace edit).
  * only send these if the server registered interests in the path
* autodetect language, indent, line ending, ..

This PR also centralizes the infrastructure for path setting and
therefore `:w <path>` benefits from similar fixed (but without didRename)
10 months ago
Michael Davis 8b6565c839 Respect injections in :tree-sitter-highlight-name 10 months ago
Nick d8b8d2fda6
Fix error message shown for goto references (#9382) 10 months ago
Pascal Kuthe 8e592a151f refactor completion and signature help using hooks 10 months ago
mattwparas d6c3804ed8 use in memory representation of configuration 10 months ago
Michael Davis 1f916e65cf Create helix-stdx crate for stdlib extensions
helix-stdx is meant to carry extensions to the stdlib or low-level
dependencies that are useful in all other crates. This commit starts
with all of the path functions from helix-core and the CWD tracking that
lived in helix-loader.

The CWD tracking in helix-loader was previously unable to call the
canonicalization functions in helix-core. Switching to our custom
canonicalization code should make no noticeable difference though
since `std::env::current_dir` returns a canonicalized path with
symlinks resolved (at least on unix).
10 months ago
Daniel Sedlak af8e524a7d
Address clippy lints (#9371) 10 months ago
Michael Davis eca3ccff76
Select subtree within injections in :tree-sitter-subtree (#9309)
`:tree-sitter-subtree` could previously only print subtrees of nodes
in the root injection layer. We can improve on that by finding the layer
that contains the given byte range and printing the subtree within that
layer. That gives more useful results when a selection is within an
injection layer.
11 months ago
Gabriel Dinner-David 84e24b33dc
make sure to sync views when applying edits to unfocused views (#9173) 11 months ago
Philipp Mildenberger 41ca46cf8c
Initialize diagnostics when opening a document (#8873) 11 months ago
Michael Davis 0cbd8d3df1
Check for rename support before showing LSP rename prompt (#9277) 11 months ago
mattwparas 01996b2bec No more passing around the helix context for every function call 11 months ago
ath3 9ba691cd3a
Support drawing popup frame (#4313)
Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
11 months ago
TornaxO7 914c83420b
fix `:indent-style` crash (#9087)
* removing unreachable statement in `:indent-style`

* update checks when setting indent line and update docs

* `cargo xtask docgen`
12 months ago
Cole Helbling 8b0ae3d279
bump MSRV to 1.70.0 (#8877)
* rust-toolchain.toml: bump MSRV to 1.70.0

With Firefox 120 released on 21 November 2023, the MSRV is now 1.70.0.

* Fix cargo fmt with Rust 1.70.0

* Fix cargo clippy with Rust 1.70.0

* Fix cargo doc with Rust 1.70.0

* rust-toolchain.toml: add clippy component

* .github: bump dtolnay/rust-toolchain to 1.70

* helix-term: bump rust-version to 1.70

* helix-view/gutter: use checked_ilog10 to count digits

* helix-core/syntax: use MAIN_SEPARATOR_STR constant

* helix-view/handlers/dap: use Display impl for displaying process spawn error

* WIP: helix-term/commands: use checked math to assert ranges cannot overlap
1 year ago
Yomain e868678139
Add command to move files with LSP support (#8584)
* Added rename command

* Added an error if the new path already exists

* Fixed wrong command name being used

* fixed clippy suggestions

* removed didRenameFiles call, fixed early return due to path Err

* added ':rnm' alias to ':rename'

* code cleanup

* formatting

* removed debug line

* cargo fmt

* Improved new buffer error message

Co-authored-by: Pascal Kuthe <pascal.kuthe@semimod.de>

* Removed unnecessary path normalizing

Co-authored-by: Pascal Kuthe <pascal.kuthe@semimod.de>

* Update helix-term/src/commands/typed.rs

Co-authored-by: Pascal Kuthe <pascal.kuthe@semimod.de>

* Update helix-term/src/commands/typed.rs

Co-authored-by: Pascal Kuthe <pascal.kuthe@semimod.de>

* Update helix-term/src/commands/typed.rs

Co-authored-by: Pascal Kuthe <pascal.kuthe@semimod.de>

* Update helix-term/src/commands/typed.rs

Co-authored-by: Pascal Kuthe <pascal.kuthe@semimod.de>

* feat: change `rename` command to `move`

* feat: add multi lsp support when moving files

* feat: allow lsp calls with a custom timeout

* feat: sending lsp file_changed event once file has moved

---------

Co-authored-by: ontley <theontley@gmail.com>
Co-authored-by: ontley <67148677+ontley@users.noreply.github.com>
Co-authored-by: Pascal Kuthe <pascal.kuthe@semimod.de>
1 year ago
Skyler Hawthorne 10b178e94b
swap yank command registers (#8708)
#8703 swapped the `+` and `*` registers, but did not swap them in the
corresponding yank commands.
1 year ago
mattwparas 0b5501d175 clean up 1 year ago
mattwparas 4550faf50f fix build issues 1 year ago
mattwparas fbabc40930 merge with event system 1 year ago
mattwparas cc65e583f4 checkpoint before event system 1 year ago
mattwparas 30dba6a6de add one more keybinding 1 year ago
mattwparas c0fdbc1148 start theme api 1 year ago
Pascal Kuthe dbfa2a63fa
refactor completion and signature help using hooks 1 year ago
mattwparas 76de40c1ed have some comments on the global search 1 year ago
mattwparas 0b107d6f41 deprecate old keybinding scheme 1 year ago
mattwparas baa753176a add more functions for document and editor api 1 year ago
mattwparas 6a9d0b3c64 reverse keymap overlay 1 year ago
mattwparas db3e9ed31d Merge remote-tracking branch 'origin' into mwp-steel-integration 1 year ago
mattwparas 500963b1c5 clean up warnings 1 year ago
mattwparas 2d4bc31d54 reorganize top level to use precedence for multiple plugins 1 year ago
Em Zhan 7090555dab
Add `insert-final-newline` config option (#8157)
Co-authored-by: Xalfer <64538944+Xalfer@users.noreply.github.com>
1 year ago
Luke Halasy b959162ceb
Add tree-sitter-highlight-name command (#8170)
* adds treesitter-highlight-name command

* commit documentation changes

* moves the get_highlight_name function into core/syntax

* rename get_highlight_name function to get_highlight_for_node_at_position

* addresses pr comments: moves fn into helper fn, simplifies a lot

* commit updated documentation changes

* changes scope method to return &str so that callers can decide whether or not to own
1 year ago
Weiyuan Wu 8017bb2999
add redraw command (#6949)
Co-authored-by: Roberto Vidal <vidal.roberto.j@gmail.com>
1 year ago
Lorenzo Bellina e8fc77fe98
Maintain the current cursor's position and view in the vsplit/hsplit commands too (#8109)
Co-authored-by: Benjamin Bouvier <public@benj.me>
1 year ago
Pascal Kuthe 0cb595e226
transition to nucleo for fuzzy matching (#7814)
* transition to nucleo for fuzzy matching

* drop flakey test case

since the picker streams in results now any test that relies
on the picker containing results is potentially flakely

* use crates.io version of nucleo

* Fix typo in commands.rs

Co-authored-by: Skyler Hawthorne <skyler@dead10ck.com>

---------

Co-authored-by: Skyler Hawthorne <skyler@dead10ck.com>
1 year ago
mattwparas cb93a68595 fix borrow mut error 1 year ago
mattwparas 0eb0be55a3 slim down interfact even more 1 year ago
mattwparas 7d63468b83 cleanup 1 year ago
mattwparas 18fa67d157 more clean up 1 year ago
mattwparas 279f5eddb3 add feature flag 1 year ago
mattwparas 81243247c6 nuke the dlopen stuff 1 year ago
mattwparas 7da809a780 fix borrow mut errors 1 year ago
mattwparas 67a5266da3 engine shouldn't panic when helix.scm file fails to load 1 year ago
mattwparas 5fbc086ccd add back missing command 1 year ago
mattwparas fe4d6ceb40 fix formatting 1 year ago
mattwparas 42c9997487 merge in master 1 year ago
mattwparas a73e212a7c fixes 1 year ago
mattwparas 20d7d6a426 update instructions 1 year ago
nkitsaini 22f4f313f1
Remove unnecessary `Err` from `get_canonicalized_path` (#8009)
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
1 year ago
nkitsaini 2767459f89
Remove path completions for `:new` command (#8010) 1 year ago
mattwparas 72aa2d9520 indenting full in steel now 1 year ago
mattwparas d0d9f7b5b0 more integration, not pretty but still making progress 1 year ago
quantonganh 085706e0cd
Include completions for git-ignored files in debugger prompt (#7936) 1 year ago
Daniel Ebert 155cedc5c8 Fix broken indentation that causes the indentation tests to fail.
For some reason, `cargo fmt` does not change the indentation in
these places (maybe it isn't sure about what the correct formatting
should be).
1 year ago
mattwparas db5bf128bb remove dead code 1 year ago
mattwparas 6fdb71750c clean up keymap api 1 year ago
mattwparas 1fb2df48e1 wip 1 year ago
Alex Vinyals 48eb0d4792
Enhance :toggle to support cycling numbers (#7877) 1 year ago
woojiq aa4d84a0b3
Align view for background buffer opened with `alt-ret` (#7691)
* fix(picker): `alt-ret' changes cursor pos of current file, not new one

Closes #7673

* fix other pickers

* symbol pickers
* diagnostick pickers

This is done using the already patched `jump_to_location` method.

* fix global and jumplist pickers

* use `view` as old_id; make `align_view` method of `Action`

* test(picker): basic <alt-ret> functionality

* fix: picker integrational test

* fix nit

Co-authored-by: Michael Davis <mcarsondavis@gmail.com>

---------

Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
1 year ago
Connortsui20 fcbac485f8
Show whether file readonly in statusline (#7740) 1 year ago
Michael Davis 4555a6b433 Reimplement clipboard commands in terms of special regs
Since the clipboard provider now lives on the Registers type, we want
to eliminate it from the Editor. We can do that and clean up the
commands that interact with the clipboard by calling regular yank,
paste and replace impls on the clipboard special registers.

Eventually the clipboard commands could be removed once macro keybinding
is supported.
1 year ago
Michael Davis baceb02a09 Use refactored Registers type
This is an unfortunately noisy change: we need to update virtually all
callsites that access the registers. For reads this means passing in the
Editor and for writes this means handling potential failure when we
can't write to a clipboard register.
1 year ago
Philipp Mildenberger 8a28f30593
Reformat with nightly rustfmt for better let-else formatting (#7721) 1 year ago
Ryan Fowler 5c41f22c2a
Add support for LSP DidChangeWatchedFiles (#7665)
* Add initial support for LSP DidChangeWatchedFiles

* Move file event Handler to helix-lsp

* Simplify file event handling

* Refactor file event handling

* Block on future within LSP file event handler

* Fully qualify uses of the file_event::Handler type

* Rename ops field to options

* Revert newline removal from helix-view/Cargo.toml

* Ensure file event Handler is cleaned up when lsp client is shutdown
1 year ago
sigmaSd 8977123f25
feat: resolve code action (#7677) 1 year ago
mattwparas ca346b1416 fix versions 1 year ago
mattwparas 0f96fea7d9 remove exported identifiers interface 1 year ago
mattwparas 3ee5829ed7 buffer specific keybindings 1 year ago
Yomain 8afc0282f2
Fix crash when cwd is deleted (#7185) 1 year ago
Ryan Fowler 828c7432e3
Implement the wa! command (#7577) 1 year ago
mattwparas 34144490ec Merge branch 'master' into mwp-steel-integration 1 year ago
mattwparas 76181da53a file tree with better prompts and callbacks 1 year ago
mattwparas e063c58d30 working file tree 1 year ago
mattwparas a0153fb50b checkpoint 1 year ago
mattwparas c7687806a4 update to use safer APIs 1 year ago
Gokul Soumya f18acadbd0
Completely remove old Picker and rename FilePicker to Picker 1 year ago
Michael Davis 545acfda88
Make file preview callback optional
When Picker and FilePicker are merged, not all Pickers will be able to
show a preview.

Co-authored-by: Gokul Soumya <gokulps15@gmail.com>
1 year ago
spectre256 d8b7232a47
Add yank_joined command (#7195)
Resolves issue #6888 by adding a command to join all selections and yank
them to the specified register. The typed command takes an argument as
the separator to use when joining the selections.
1 year ago
Zisulin Morbrot fbd22afe29
Add rl and rla aliasses for reload and reload-all commands (#7158) 1 year ago
Michael Davis d4427125eb
Bail if no language servers support workspace symbols (#7286) 1 year ago
Alex Vinyals 204bac1706
commands(toggle): use pattern matching on the Value enum (#7240) 1 year ago
mattwparas 4213328ebd more reworking 1 year ago
Alex Vinyals d5707a4696
feat(commands): allows cycling option values at runtime (#4411) 1 year ago
mattwparas 15886dec3f more integration 2 years ago
mattwparas ba1a38d497 more integration 2 years ago
Matthew Toohey 207829eefe
Fix off-by-one in select symbol references (#7132) 2 years ago
Philipp Mildenberger 2b746ea6fa Some minor clarity/cosmetic improvements
Co-authored-by: Pascal Kuthe <pascal.kuthe@semimod.de>
2 years ago
Philipp Mildenberger 39b9a4bba2 Add function `Editor::language_server_by_id` and refactor/simplify related code, also don't 'crash' in completion menu if language_server somehow disappeared 2 years ago
Philipp Mildenberger 3e4bac1d96 Fix lsp_restart across multiple different document scopes (language servers weren't restarted, if not of the same scope id), and fix some smaller rebase issues 2 years ago
Philipp Mildenberger 93fd79a949 Remove offset_encoding in CodeActionOrCommandItem, as it can be retrieved on demand 2 years ago
Philipp Mildenberger ff26208427 Filter language servers also by capabilities in `doc.language_servers_with_feature`
* Add `helix_lsp::client::Client::supports_feature(&self, LanguageServerFeature)`
* Extend `doc.language_servers_with_feature` to use this method as filter as well
* Add macro `language_server_with_feature!` to reduce boilerplate for non-mergeable language server requests (like goto-definition)
* Refactored most of the `find_map` code to use the either the macro or filter directly via `doc.language_servers_with_feature`
2 years ago