aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/commands/typed.rs
Commit message (Collapse)AuthorAge
* 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
|
* add workspace config and manual LSP root managementPascal Kuthe2023-03-29
| | | | | | | | | | fixup documentation Co-authored-by: LeoniePhiline <22329650+LeoniePhiline@users.noreply.github.com> fixup typo Co-authored-by: LeoniePhiline <22329650+LeoniePhiline@users.noreply.github.com>
* Run shell commands asynchronously (#6373)sarah2023-03-21
|
* fix compilationBlaž Hrastnik2023-03-14
|
* Only complete appropriate arguments for typed commands. (#5966)Kyle Smith2023-03-14
|
* Generalised to multiple runtime directories with priorities (#5411)paul-scott2023-03-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Generalised to multiple runtime directories with priorities This is an implementation for #3346. Previously, one of the following runtime directories were used: 1. `$HELIX_RUNTIME` 2. sibling directory to `$CARGO_MANIFEST_DIR` 3. subdirectory of user config directory 4. subdirectory of path to helix executable The first directory provided / found to exist in this order was used as a root for all runtime file searches (grammars, themes, queries). This change lowers the priority of `$HELIX_RUNTIME` so that the user config runtime has higher priority. More significantly, all of these directories are now searched for runtime files, enabling a user to override default or system-level runtime files. If the same file name appears in multiple runtime directories, the following priority is now used: 1. sibling directory to `$CARGO_MANIFEST_DIR` 2. subdirectory of user config directory 3. `$HELIX_RUNTIME` 4. subdirectory of path to helix executable One exception to this rule is that a user can have a `themes` directory directly in the user config directory that has higher piority to `themes` directories in runtime directories. That behaviour has been preserved. As part of implementing this feature `theme::Loader` was simplified and the cycle detection logic of the theme inheritance was improved to cover more cases and to be more explicit. * Removed AsRef usage to avoid binary growth * Health displaying ;-separated runtime dirs * Changed HELIX_RUNTIME build from src instructions * Updated doc for more detail on runtime directories * Improved health symlink printing and theme cycle errors The health display of runtime symlinks now prints both ends of the link. Separate errors are given when theme file is not found and when the only theme file found would form an inheritence cycle. * Satisfied clippy on passing Path * Clarified highest priority runtime directory purpose * Further clarified multiple runtime details in book Also gave markdown headings to subsections. Fixed a error with table indentation not building table that also appears present on master. --------- Co-authored-by: Paul Scott <paul.scott@anu.edu.au> Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
* Softwrapping improvements (#5893)Clément Delafargue2023-03-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * use max_line_width + 1 during softwrap to account for newline char Helix softwrap implementation always wraps lines so that the newline character doesn't get cut off so he line wraps one chars earlier then in other editors. This is necessary, because newline chars are always selecatble in helix and must never be hidden. However That means that `max_line_width` currently wraps one char earlier than expected. The typical definition of line width does not include the newline character and other helix commands like `:reflow` also don't count the newline character here. This commit makes softwrap use `max_line_width + 1` instead of `max_line_width` to correct the impedance missmatch. * fix typos Co-authored-by: Jonathan Lebon <jonathan@jlebon.com> * Add text-width to config.toml * text-width: update setting documentation * rename leftover config item * remove leftover max-line-length occurrences * Make `text-width` optional in editor config When it was only used for `:reflow` it made sense to have a default value set to `80`, but now that soft-wrapping uses this setting, keeping a default set to `80` would make soft-wrapping behave more aggressively. * Allow softwrapping to ignore `text-width` Softwrapping wraps by default to the viewport width or a configured `text-width` (whichever's smaller). In some cases we only want to set `text-width` to use for hard-wrapping and let longer lines flow if they have enough space. This setting allows that. * Revert "Make `text-width` optional in editor config" This reverts commit b247d526d69adf41434b6fd9c4983369c785aa22. * soft-wrap: allow per-language overrides * Update book/src/configuration.md Co-authored-by: Pascal Kuthe <pascal.kuthe@semimod.de> * Update book/src/languages.md Co-authored-by: Pascal Kuthe <pascal.kuthe@semimod.de> * Update book/src/configuration.md Co-authored-by: Pascal Kuthe <pascal.kuthe@semimod.de> --------- Co-authored-by: Pascal Kuthe <pascal.kuthe@semimod.de> Co-authored-by: Jonathan Lebon <jonathan@jlebon.com> Co-authored-by: Alex Boehm <alexb@ozrunways.com> Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
* Do not add intermediate lines to jumplist with :<linenum> command. (#5751)Kyle Smith2023-03-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | * Do not add intermediate lines to jumplist with :<linenum> command. * Revert jumplist index changes. * Reduce calculations during update cycle. * Use jumplist for undo, set jumplist before preview. * remove some debug logging * Revert "remove some debug logging" This reverts commit 5772c4327e7121c53ea0726a4d7333ae1c413ffb. * Revert "Use jumplist for undo, set jumplist before preview." This reverts commit f73a1b29824feaf16477b9df547fb28d9db81923. * Add last_selection, update implementation. * @pascalkuthe initial feedback * Ensure ":goto 123" keybinding works as expected. * fix clippies, prefer expect() for expect last_selection state
* Add command for resetting diff hunks (#5736)Pascal Kuthe2023-03-08
|
* Allow LSP server to be stopped (#5964)Davide Galassi2023-03-08
|
* feat: show current language when no argument is provided (#5895)Guillaume2023-02-16
|
* Add :toggle-option command (#4085)A-Walrus2023-02-13
| | | This command toggles the value of boolean options
* Address new clippy lintsBlaž Hrastnik2023-02-09
|
* Add :character-info command (#4000)William Etheredge2023-02-03
|
* always commit to history when pasting (#5790)Pascal Kuthe2023-02-02
|
* Use filename completer on run-shell-command (#5729)Jonathan LEI2023-01-30
|
* Remove apply_transaction helper (#5598)Ivan Tham2023-01-21
|
* Fix language config reload logic (#5381)Ethan Kiang2023-01-03
|
* Expand `~` when parsing file paths in `:open` (#5329)iobtl2022-12-29
|
* Fix opening new files (#5278)alois312022-12-24
| | | | | | | Commit 1b89d3e5350f83b2ffb86a86326bd2714308ee53 introduced a regression where opening a new file would no longer work, because attempting to canonicalize its path would lead to a "No such file or directory" error. Fall back to opening a new file when encountering an error to fix this case.
* Add file picker dialogue when opening a directory with :o (#2707)Jack Allison2022-12-23
|
* Remove redraw to fix buildBlaž Hrastnik2022-12-15
|
* add redraw command (#4354)Roberto Vidal2022-12-15
| | | | | | | | | | | | | * add redraw command * update docs * Update helix-term/src/commands/typed.rs Co-authored-by: Michael Davis <mcarsondavis@gmail.com> * update docs Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
* Improve error message handling for theme loading failures (#5073)Michael Davis2022-12-15
| | | | | | | | | | | | | | | | | The error messages for a theme that failed to be deserialized (or otherwise failed to load) were covered up by the context/with_context calls: * The log message for a bad theme configured in config.toml would only say "Failed to deserilaize theme" * Selecting a bad theme via :theme would show "Theme does not exist" With these changes, we let the TOML deserializer errors bubble up, so the error messages can now say the line number of a duplicated key - and that key's name - when a theme fails to load because of a duplicated key. Providing a theme which does not exist to :theme still gives a helpful error message: "No such file or directory."
* Add `:pipe-to` typable command that ignores shell output (#4931)Alexander Schlögl2022-12-12
|
* reload_all: Ensure view is synced with doc history before reload (#4965)Michael Davis2022-12-02
|
* Show (git) diff signs in gutter (#3890)Pascal Kuthe2022-12-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Show (git) diff signs in gutter (#3890) Avoid string allocation when git diffing Incrementally diff using changesets refactor diffs to be provider indepndent and improve git implementation remove dependency on zlib-ng switch to asynchronus diffing with similar Update helix-vcs/Cargo.toml fix toml formatting Co-authored-by: Ivan Tham <pickfire@riseup.net> fix typo in documentation use ropey reexpors from helix-core fix crash when creating new file remove useless use if io::Cursor fix spelling mistakes implement suggested improvement to repository loading improve git test isolation remove lefover comments Co-authored-by: univerz <univerz@fu-solution.com> fixed spelling mistake minor cosmetic changes fix: set self.differ to None if decoding the diff_base fails fixup formatting Co-authored-by: Ivan Tham <pickfire@riseup.net> reload diff_base when file is reloaded from disk switch to imara-diff Fixup formatting Co-authored-by: Blaž Hrastnik <blaz@mxxn.io> Redraw buffer whenever a diff is updated. Only store hunks instead of changes for individual lines to easily allow jumping between them Update to latest gitoxide version Change default diff gutter position Only update gutter after timeout * update diff gutter synchronously, with a timeout * Apply suggestions from code review Co-authored-by: Blaž Hrastnik <blaz@mxxn.io> Co-authored-by: Michael Davis <mcarsondavis@gmail.com> * address review comments and ensure lock is always aquired * remove configuration for redraw timeout Co-authored-by: Blaž Hrastnik <blaz@mxxn.io> Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
* Call View::apply within Document::append_changes_to_historyMichael Davis2022-11-29
|
* Revert "Don't apply transactions to Views in undo/redo"Michael Davis2022-11-29
| | | | This reverts commit fd00f3a70eb626242bb2fcc9bddf2c4d94580a9a.
* reload-all: Only update viewport when view focuses on the doc (#4901)Filipe Azevedo2022-11-26
|