aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/commands/typed.rs
Commit message (Collapse)AuthorAge
* add register completion (#9936)Kirawi2024-03-19
|
* Prevent `shell_keep_pipe` from stopping on nonzero exit status code (#9817)Cyrill Schenkel2024-03-19
| | | | | | | | | | | | The `shell_impl` and `shell_impl_async` functions no longer return `success` because it was always `true`. If the command didn't succeed both functions would return an `Err`. This was also the reason, why `shell_keep_pipe` didn't work. It relied upon the value of `success` and aborted in case of an `Err`. It now removes any selection for which `shell_impl` returns `Err`. If the command always fails, the selections are preserved and an error message is displayed in the status bar.
* Do not stop reloading docs on error (#9870)Luis Useche2024-03-19
| | | | | | | | | | In the `reload-all` command, we should not stop reloading the documents if one error is found. Instead, we should report the error and continue trying to reload the current open documents. This is useful in cases where a backing file does not exist temporarily (e.g. when editing a git patch in the outstanding chain that doesn't have a file just yet). This change also remove the error messages in the cases where the backing is `None`, like in new docs or `tutor`.
* Add a yank diagnostic command (#9640)Kirawi2024-03-15
| | | | | | | | | * yank diagnostic command * improve success message * move to a typed command * docgen
* Optimization of tilde expansion (#9709)Mo2024-02-24
| | | | | | | | | | | | | | | | * Use next and avoid a redundant prefix strip * Avoid allocations Especially when `expand_tilde` is claled on a path that doesn't contain a tilde. * Add a test * Use Into<Cow<…>> * Put the expand_tilde test at the end of the file * Remove unused importsw
* make path changes LSP spec conform (#8949)Pascal Kuthe2024-01-28
| | | | | | | | | | | | | | | | | 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)
* Respect injections in :tree-sitter-highlight-nameMichael Davis2024-01-28
|
* Create helix-stdx crate for stdlib extensionsMichael Davis2024-01-18
| | | | | | | | | | | | | 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).
* Address clippy lints (#9371)Daniel Sedlak2024-01-17
|
* Select subtree within injections in :tree-sitter-subtree (#9309)Michael Davis2024-01-15
| | | | | | | `: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.
* make sure to sync views when applying edits to unfocused views (#9173)Gabriel Dinner-David2024-01-09
|
* Initialize diagnostics when opening a document (#8873)Philipp Mildenberger2024-01-09
|
* Support drawing popup frame (#4313)ath32023-12-19
| | | Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
* fix `:indent-style` crash (#9087)TornaxO72023-12-15
| | | | | | | * removing unreachable statement in `:indent-style` * update checks when setting indent line and update docs * `cargo xtask docgen`
* Add command to move files with LSP support (#8584)Yomain2023-11-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* swap yank command registers (#8708)Skyler Hawthorne2023-11-04
| | | | #8703 swapped the `+` and `*` registers, but did not swap them in the corresponding yank commands.
* Add `insert-final-newline` config option (#8157)Em Zhan2023-09-12
| | | Co-authored-by: Xalfer <64538944+Xalfer@users.noreply.github.com>
* Add tree-sitter-highlight-name command (#8170)Luke Halasy2023-09-10
| | | | | | | | | | | | | | | * 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
* add redraw command (#6949)Weiyuan Wu2023-09-08
| | | Co-authored-by: Roberto Vidal <vidal.roberto.j@gmail.com>
* Maintain the current cursor's position and view in the vsplit/hsplit ↵Lorenzo Bellina2023-09-04
| | | | | | commands too (#8109) Co-authored-by: Benjamin Bouvier <public@benj.me>
* transition to nucleo for fuzzy matching (#7814)Pascal Kuthe2023-08-30
| | | | | | | | | | | | | | | | | | * 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>
* Remove unnecessary `Err` from `get_canonicalized_path` (#8009)nkitsaini2023-08-20
| | | | Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
* Remove path completions for `:new` command (#8010)nkitsaini2023-08-20
|
* Fix broken indentation that causes the indentation tests to fail.Daniel Ebert2023-08-11
| | | | | | 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).
* Enhance :toggle to support cycling numbers (#7877)Alex Vinyals2023-08-09
|
* Show whether file readonly in statusline (#7740)Connortsui202023-08-08
|
* Reimplement clipboard commands in terms of special regsMichael Davis2023-07-31
| | | | | | | | | | 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.
* Use refactored Registers typeMichael Davis2023-07-31
| | | | | | | 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.
* Reformat with nightly rustfmt for better let-else formatting (#7721)Philipp Mildenberger2023-07-27
|
* Add support for LSP DidChangeWatchedFiles (#7665)Ryan Fowler2023-07-21
| | | | | | | | | | | | | | | | | | | * 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
* Fix crash when cwd is deleted (#7185)Yomain2023-07-11
|
* Implement the wa! command (#7577)Ryan Fowler2023-07-09
|
* Add yank_joined command (#7195)spectre2562023-06-16
| | | | | 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.
* Add rl and rla aliasses for reload and reload-all commands (#7158)Zisulin Morbrot2023-06-13
|
* commands(toggle): use pattern matching on the Value enum (#7240)Alex Vinyals2023-06-07
|
* feat(commands): allows cycling option values at runtime (#4411)Alex Vinyals2023-06-05
|
* Fix lsp_restart across multiple different document scopes (language servers ↵Philipp Mildenberger2023-05-18
| | | | weren't restarted, if not of the same scope id), and fix some smaller rebase issues
* Use let else instead of variable and fix some error messagesPhilipp Mildenberger2023-05-18
| | | | Co-authored-by: Pascal Kuthe <pascal.kuthe@semimod.de>
* Simplify 'lsp_stop' commandPhilipp Mildenberger2023-05-18
|
* Fix docgen and lsp-stop documentationPhilipp Mildenberger2023-05-18
|
* Refactored doc.language_servers and doc.language_servers_with_feature to ↵Philipp Mildenberger2023-05-18
| | | | | | return an iterator and refactor LanguageServerFeature handling to a HashMap (language server name maps to features) Co-authored-by: Pascal Kuthe <pascal.kuthe@semimod.de>
* Adds support for multiple language servers per language.Philipp Mildenberger2023-05-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Language Servers are now configured in a separate table in `languages.toml`: ```toml [langauge-server.mylang-lsp] command = "mylang-lsp" args = ["--stdio"] config = { provideFormatter = true } [language-server.efm-lsp-prettier] command = "efm-langserver" [language-server.efm-lsp-prettier.config] documentFormatting = true languages = { typescript = [ { formatCommand ="prettier --stdin-filepath ${INPUT}", formatStdin = true } ] } ``` The language server for a language is configured like this (`typescript-language-server` is configured by default): ```toml [[language]] name = "typescript" language-servers = [ { name = "efm-lsp-prettier", only-features = [ "format" ] }, "typescript-language-server" ] ``` or equivalent: ```toml [[language]] name = "typescript" language-servers = [ { name = "typescript-language-server", except-features = [ "format" ] }, "efm-lsp-prettier" ] ``` Each requested LSP feature is priorized in the order of the `language-servers` array. For example the first `goto-definition` supported language server (in this case `typescript-language-server`) will be taken for the relevant LSP request (command `goto_definition`). If no `except-features` or `only-features` is given all features for the language server are enabled, as long as the language server supports these. If it doesn't the next language server which supports the feature is tried. The list of supported features are: - `format` - `goto-definition` - `goto-declaration` - `goto-type-definition` - `goto-reference` - `goto-implementation` - `signature-help` - `hover` - `document-highlight` - `completion` - `code-action` - `workspace-command` - `document-symbols` - `workspace-symbols` - `diagnostics` - `rename-symbol` - `inlay-hints` Another side-effect/difference that comes with this PR, is that only one language server instance is started if different languages use the same language server.
* Fix completion on paths containing spaces (#6779)Ivan Gulakov2023-05-18
| | | | | | | | | | | There was an issue with autocompletion of a path with a space in it. Before: :o test\ dir -> <TAB> -> test\ dirfile1 After: :o test\ dir -> <TAB> -> test\ dir\file1
* Add wbc and wbc! commands (#6947)Kitsu2023-05-09
|
* feat(commands): add clear-register typable command (#5695)jorge2023-04-27
| | | Co-authored-by: Jorge <chorcheus@tutanota.com>
* make `:u` alias `:update` (#6835)Atticus Sebastiani2023-04-23
| | | | | | | * Gave the command update the alias u * Re added trailing newline * generated docs
* make :toggle-option print the new value (#6774)Aleksey Kuznetsov2023-04-16
| | | | Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
* Fix typos (#6643)Daniel Sedlak2023-04-07
|
* Let..else refactor (#6562)Casper Rogild Storm2023-04-03
|
* add option to enable/disable lsp snippetsPascal Kuthe2023-03-31
|