Commit Graph

13 Commits (1d27b503188ebd5ae0ac32bbafa198048cfcf2a4)

Author SHA1 Message Date
Anthony Rubick 1d27b50318
fix: auto-reloading on focus
Open question: should we prompt users here too? currently don't
2025-07-15 18:28:01 -07:00
Anthony Rubick bf02b4dbea
fix: typos
I has originally named this feature `auto_read`, but changed the name to `auto_reload`, this changes some references I forgot to update to the new name
2025-07-15 17:56:38 -07:00
Anthony Rubick 104bb7443f
feat: automatic reload when file changes externally
Implements the idea raised by @porridgewithraisins in this comment:
https://github.com/helix-editor/helix/issues/1125#issuecomment-3073782827

The implementation was modeled after the implementation of the autosave feature.

Here are some example snippets of configuration for this feature:

- disable auto-reloading (default)
```toml
[editor]
auto-reload = false
```
or
```toml
[editor.auto-reload]
focus-gained = false
```
- auto-reload on focus
```toml
[editor]
auto-reload = true
```
or
```toml
[editor.auto-reload]
focus-gained = true
```
- auto-reload at some periodically at time interval (5 seconds in this example)
```toml
[editor.auto-reload]
periodic.enable = true
periodic.interval = 5000
```
- of course, you could have it reload on focus and at an interval too:
```toml
[editor.auto-reload]
focus-gained = true
periodic.enable = true
periodic.interval = 5000
```
2025-07-15 17:47:54 -07:00
Nik Revenco 0ee5850016
Color swatches ( 🟩 green 🟥 #ffaaaa ) (#12308) 2025-03-23 16:07:02 -05:00
Michael Davis 6da1a79d80
Add document and LSP lifecycle events, move some callbacks into hooks
This adds events for:

* a document being opened
* a document being closed
* a language server sending the initialized notification
* a language server exiting

and also moves some handling done for these scenarios into hooks,
generally moving more into helix-view. A hook is also added on
`DocumentDidChange` which sends the `text_document_did_change`
notification - this resolves a TODO in `document`.
2025-03-22 11:41:50 -04:00
Pascal Kuthe 5c1f3f814f
implement incomplete completion requests 2025-02-01 19:36:10 -05:00
Pascal Kuthe 1badd9e434
implement snippet tabstop support 2024-12-17 13:34:40 -05:00
Pascal Kuthe 7283ef881f
only show inline diagnostics after a delay 2024-07-15 16:36:29 +02:00
Hendrik Wolff 265608a3d8
Auto Save All Buffers After A Delay (#10899)
* auto save after delay

* configable

* clearer names

* init

* working with some odd behaviour

* working with greater consistency

* Apply reviewer suggestions

- Remove unneccessary field
- Remove blocking save

* Improve auto-save configuration

Auto save can be configured to trigger on focus loss:
```toml
auto-save.focus-lost = true|false
```

and after a time delay (in milli seconds) since last keypress:
```toml
auto-save.after-delay.enable = true|false
auto-save.after-delay.timeout = [0, u64::MAX] # default: 3000
```

* Remove boilerplate and unnecessary types

* Remove more useless types

* Update docs for auto-save.after-delay

* Fix wording of (doc) comments relating to auto-save

* book: Move auto-save descriptions to separate section

---------

Co-authored-by: Miguel Perez <miguelvojito@gmail.com>
Co-authored-by: Miguel Perez <perezoji@cs.fsu.edu>
2024-06-11 00:39:06 +02:00
Pascal Kuthe 38ee845b05 don't overload LS with completion resolve requests
While moving completion resolve to the event system in #9668 we introduced what
is essentially a "DOS attack" on slow LSPs. Completion resolve requests were
made in the render loop and debounced with a timeout. Once the timeout expired
the resolve request was made. The problem is the next frame would immediately
request a new completion resolve request (and mark the old one as obsolete but
because LSP has no notion of cancelation the server would still process it). So
we were in essence sending one completion request to the server every 150ms and
only stopped if the server managed to respond before we rendered a new frame.
This caused overload on slower machines/with slower LS.

In this PR I revamped the resolve handler so that a request is only ever
resolved once. Both by checking if a request is already in-flight and by marking
failed resolve requests as resolved.
2024-04-22 12:27:47 +09:00
Michael Davis cb286b7a5d
Fix rustc warnings about unused 'pub use's (#10011) 2024-03-27 14:34:47 +09:00
Pascal Kuthe 8e592a151f refactor completion and signature help using hooks 2024-01-23 11:20:19 +09:00
Pascal Kuthe 13ed4f6c47 Add hook/event system 2024-01-23 11:20:19 +09:00