Commit Graph

1742 Commits (313579d27ce6ad55b5c2410856e6aa62a7778320)

Author SHA1 Message Date
Michael Davis 313579d27c Remove language-server configuration in integration tests
This change removes language server configuration from the default
languages.toml config for integration tests. No integration-tests
currently depend on the availability of a language server but if any
future test needs to, it may provide a language server configuration
by passing an override into the `test_syntax_conf` helper.

Language-servers in integration tests cause false-positive failures
when running integration tests in GitHub Actions CI. The Windows
runner appears to have `clangd` installed and all OS runners have
the `R` binary installed but not the `R` language server package.
If a test file created by `tempfile::NamedTempFile` happens to have a
file extension of `r`, the test will most likely fail because the
R language server will fail to start and will become a broken pipe,
meaning that it will fail to shutdown within the timeout, causing a
false-positive failure. This happens surprisingly often in practice.

Language servers (especially rust-analyzer) also emit unnecessary
log output when initializing, which this change silences.
2 years ago
Michael Davis 1243db11a5 Use helix_view::apply_transaction in integration-tests
`helix_view::apply_transaction` closes over `Document::apply` and
`View::apply` to ensure that jumplist entries are updated when a
document changes from a transaction. `Document::apply` shouldn't
be called directly - this helper function should be used instead.
2 years ago
Matouš Dzivjak 4cff625054
chore(view): remove indent_unit helper fn (#4389) 2 years ago
Matouš Dzivjak eee8362015
fix(commands): no last picker error (#4387) 2 years ago
Blaž Hrastnik 78c0cdc519
Merge pull request #2267 from dead10ck/fix-write-fail
Write path fixes
2 years ago
Fisher Darling 4174b25b3d
Pretty print `tree-sitter-subtree` expression (#4295) 2 years ago
Skyler Hawthorne 756253b43f fix tree_sitter_scopes 2 years ago
Skyler Hawthorne e645804b0a Editor::flush_writes returns an error 2 years ago
Blaž Hrastnik 52ba550098 Use flush_writes in application.close() 2 years ago
Blaž Hrastnik 55b50d9e83 Seems like this flush is unnecessary 2 years ago
Blaž Hrastnik b0212b3611 Deduplicate flush_writes 2 years ago
Blaž Hrastnik 30c93994b5 Use a single save_queue on the editor 2 years ago
Skyler Hawthorne beb3427bfb improve app close failure display 2 years ago
Skyler Hawthorne bf378e71b0 fix tests 2 years ago
Skyler Hawthorne 31d1bbfddb review comments 2 years ago
Skyler Hawthorne 3f07885b35 document should save even if formatter fails 2 years ago
Skyler Hawthorne b530a86d1f remove Callback::Compositor variant
To reduce likelihood of accidental discarding of important callbacks
2 years ago
Skyler Hawthorne b3fc31a211 move language server refresh to document saved event handler 2 years ago
Skyler Hawthorne af03df3413 fix write scratch buffer to file 2 years ago
Skyler Hawthorne 18c32118b1 Save text in document saved events, use in status message 2 years ago
Skyler Hawthorne f82a551b98 Rename doc save event names to past tense 2 years ago
Skyler Hawthorne 57de4e6251 various fixes in write-all path 2 years ago
Skyler Hawthorne d544376590 reset idle timer for all events 2 years ago
Skyler Hawthorne e5fd5e2a9c fix panic when view of pending write is closed 2 years ago
Skyler Hawthorne 8c667ef8de factor editor event handling into function 2 years ago
Skyler Hawthorne aaa1450678 fix write-quit with auto format
write-quit will now save all files successfully even when there is auto
formatting
2 years ago
Skyler Hawthorne c9418582d2 fix modified status with auto format 2 years ago
Skyler Hawthorne cb23399dee improve reliability of shutdown 2 years ago
Skyler Hawthorne b8a07f7d15 add conditional noop render back
It makes it much slower without stubbing this out
2 years ago
Skyler Hawthorne 69c9e44ef2 update write-quit to wait for saves 2 years ago
Skyler Hawthorne e1f7bdb1d2 fix buffer-close 2 years ago
Skyler Hawthorne 83b6042b97 fix(write): do not set new path on document until write succeeds
If a document is written with a new path, currently, in the event that
the write fails, the document still gets its path changed. This fixes
it so that the path is not updated unless the write succeeds.
2 years ago
Skyler Hawthorne a5a93182cd fix: buffer-close ensuring writes
Make sure buffer-close waits for the document to finish its writes.
2 years ago
Skyler Hawthorne d706194597 chore(write): serialize write operations within a Document
The way that document writes are handled are by submitting them to the
async job pool, which are all executed opportunistically out of order. It
was discovered that this can lead to write inconsistencies when there
are multiple writes to the same file in quick succession.

This seeks to fix this problem by removing document writes from the
general pool of jobs and into its own specialized event. Now when a
user submits a write with one of the write commands, a request is simply
queued up in a new mpsc channel that each Document makes to handle its own
writes. This way, if multiple writes are submitted on the same document,
they are executed in order, while still allowing concurrent writes for
different documents.
2 years ago
Jonathan LEI 1a772d1b67
Fix deleting word from end of buffer (#4328) 2 years ago
Roberto Vidal 1f74cf45d4
display tree sitter scopes in a popup (#4337) 2 years ago
Philipp Mildenberger d17ffc47f0
Use the same `WalkBuilder` configuration for the global search file picker as the default file picker (#4334)
Skip searching .git in global search, similar to how file picker skips listing files in .git.
2 years ago
A-Walrus 8bbddf90ff Replace `in_bounds` with calculation of end_indent
Instead of repeatedly checking if it is in_bounds, calculate the
max_indent beforehand and just loop. I added a debug_assert to "prove"
that it never tries drawing out of bounds.
2 years ago
A-Walrus 1de02a147c Only draw indent guides within bounds
Better performance, and otherwise very long lines with lots of tabs
will wrap around the u16 and come back on the other side, messing up
the beginning skip_levels.
2 years ago
A-Walrus 2c36e33e0a Make skip_levels a u8 2 years ago
A-Walrus 3ba665d804 Fix rendering of lines longer than 2^16
Before things would be cast to u16 earlier than needed, which would
cause problems for insanely long lines (longer than 2^16 ~ 65 thousand)
2 years ago
Gokul Soumya 4e691d6247
Change diagnostic picker keybind to <space>d (#4229)
Also changes workspace diagnostic picker bindings to <space>D and
changes the debug menu keybind to <space>g, the previous diagnostic
picker keybind. This brings the diagnostic picker bindings more in
line with the jump to next/previous diagnostic bindings which are
currently on ]d and [d.
2 years ago
Michael Davis 5f4f171b73
Fix debug assertion for diagnostic sort order (#4319)
The debug assertion that document diagnostics are sorted incorrectly
panics for cases like `[161..164, 162..162]`. The merging behavior
in the following lines that relies on the assertion only needs the
input ranges to be sorted by `range.start`, so this change simplifies
the assertion to only catch violations of that assumption.
2 years ago
ZJPzjp 0e8e7cae3b
fix `:insert-output` doc: inserting output **before** each selection (#4286) 2 years ago
Poliorcetics 45e038f4d5
nit: remove a String allocation that is immediately used as an &str (#4277) 2 years ago
Nathaniel Graham e80beaa7b0
Changed Selection Yank Message (#4275)
Co-authored-by: Nathaniel Graham <ngraham@protonmail.com>
2 years ago
Michael Davis e16c632760
Apply transactions to the jumplist for undo/redo (#4227)
Undo/redo/earlier/later call `Document::apply_impl` which applies
transactions to the document. These transactions also need to be
applied to the view as in 0aedef0.
2 years ago
Armin Ronacher 7f75458e6f
Fix some commands not showing names in palette (#4223) 2 years ago
Graic 68909dcef4
Fix append cursor location when selection anchor is at end of document (#4147) 2 years ago
Brian Orwe f4d96b2ca3
Fix confusion with using --hsplit --vsplit on startup at same time (#4202) 2 years ago