Commit graph

5749 commits

Author SHA1 Message Date
woojiq
52a43bcdfc
bash, make, css: highlight and indent queries improvement (#9393)
* highlights(bash): rework keywords section

* Use more specified scope when possible for keywords like @keyword.repeat.
* Add more keywords like "local" or "unsetenv".

Limitation:
* Bash doesn't allow you to have a local variable outside of a function, so maybe we need to have better queries to not highlight the local in this case.
* If we name a function with a keyword (such as unset or local), it will use the highlight scope "keyword" instead of "function".

* indents(css, make): add basic queries

* Despite the fact that queries look simple, they improve indentation in some edge cases that helix couldn't handle correctly by default.
2024-01-22 19:51:12 +01:00
Matthew Toohey
f5f08becef
Fix typo in string representation of GotoReference (#9395) 2024-01-22 23:06:20 +09:00
Ahmed Hagi
9c56afeff3
Handle failure when enabling bracketed paste (#9353)
* match instead of crash

* pulling bracketedpaste out, refactor, tracking for bracketed paste

* sending disable bracketed paste only when supports true

* move disable bracketed paste to throwaway
2024-01-18 13:34:06 +01:00
Michael Davis
1bc7aac780 Use helix-stdx tilde expansion and normalization for HELIX_RUNTIME paths
Previously this wasn't possible since helix-core depends on helix-loader,
so helix-loader couldn't use helix-core's path extensions.

We use the path normalization/canonicalization for the runtime directory
provided by the HELIX_RUNTIME environment variable. This improves a
scenario where you set a path containing a tilde. Now that path will be
expanded and normalized.
2024-01-18 10:57:53 +09:00
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).
2024-01-18 10:57:53 +09:00
Daniel Sedlak
af8e524a7d
Address clippy lints (#9371) 2024-01-17 12:40:45 -06:00
Matouš Dzivjak
c60ba4ba04
feat(lsp): implement show document request (#8865)
* feat(lsp): implement show document request

Implement [window.showDocument](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#window_showDocument)
LSP server-sent request.

This PR builds on top of helix-editor#5820,
moves the external-URL opening functionality into shared crate-level
function that returns a callback that is now used by both the
`open_file` command as well as the window.showDocument handler if
the URL is marked as external.

* add return

* use vertical split

* refactor

---------

Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
2024-01-17 18:24:38 +01:00
HumanEntity
6754acd83f
Made inlay-hints not look like normal code (#9370)
Added `"ui.virtual.whitespace" = { fg = "grey_dim" }` line
2024-01-17 18:23:46 +01:00
Ben Dennis
dcdecaab22
Exit a language server if it sends a message with invalid json (#9332)
* Keep lsp event listener thread alive when malformed json is encountered from the lsp server

* Update unexpected error flow in recv() to close outstanding requests and close the language server

* Log malformed notifications as info instead of error

* Make close_language_server a nested function inside recv, similar to what's done in send

* Update malformed notification log text

* Clean up new log text a bit

* Initialize recv_buffer closer to where it's used

* Use "exit" instead of "close"

* Remove whitespace

* Remove the need for a helper method to exit the language server

* Match on Unhandled error explicitly and keep catch-all error case around
2024-01-17 15:49:25 +01:00
Jeremy Brudvik
f41727cc9c
Support PureScript's new spago.yaml configs (#9362) 2024-01-17 23:15:38 +09:00
Kirawi
6339a8c95a
Delete .ignore (#9363)
This isn't being used for anything anymore.
2024-01-17 15:15:09 +01:00
Kirawi
44cb8e5475
update tempfile dev-dependency to 3.9 (#9359) 2024-01-16 18:32:05 -06:00
dependabot[bot]
eef46b1aed
build(deps): bump cachix/cachix-action from 13 to 14 (#9347)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-16 14:13:12 +09:00
dependabot[bot]
bd9eef1f90
build(deps): bump cachix/install-nix-action from 24 to 25 (#9346)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-16 14:13:04 +09:00
dependabot[bot]
0e7f5d604e
build(deps): bump thiserror from 1.0.52 to 1.0.56 (#9345)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-16 14:12:39 +09:00
dependabot[bot]
fa1d8dfabc
build(deps): bump anyhow from 1.0.78 to 1.0.79 (#9344)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-16 14:12:32 +09:00
dependabot[bot]
2d8d16ff5e
build(deps): bump rustix from 0.38.28 to 0.38.30 (#9342)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-16 14:12:25 +09:00
dependabot[bot]
8a00620a71
build(deps): bump smallvec from 1.11.2 to 1.12.0 (#9341)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-16 14:12:15 +09:00
JR
6ce57b7924
Fix export instructions in installation doc (#9306) 2024-01-15 21:43:23 +01:00
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.
2024-01-15 15:34:38 +09:00
Michael Davis
3011df4f35
Bump tree-sitter to latest master (#9317)
* query capture names now return `&str`s rather than `String`s
* the `#any-of?` predicate is now supported
2024-01-15 15:33:26 +09:00
Pascal Kuthe
445f7a273a ignore empty TS nodes in match bracket 2024-01-15 15:32:07 +09:00
Pascal Kuthe
2fb7e50b54 don't crash in plaintext bracket match (mm) on empty file 2024-01-15 15:32:07 +09:00
woojiq
3f88a3f4e6
Change path normalization strategy to not resolve symlinks (#9330) 2024-01-14 08:46:32 -06:00
Sebastian Zivota
a0b02106c3
Make nix flake respect unused grammars (#9326)
* Make nix flake respect unused grammars

* Use default value

* Refactor

* Take use-grammars.only into account

---------

Co-authored-by: Sebastian Zivota <sebastian.zivota@mailbox.org>
2024-01-14 15:11:40 +01:00
jw013
054ce3961a
Fallback to filename for +arg (#9333) 2024-01-14 15:11:18 +01:00
Michael Davis
17dd102e5c
Remove sourcehut tree-sitter grammars from default build (#9316)
Sourcehut has outages occasionally that cause the CI and from-source
builds to fail. It also doesn't setup redirects when a user renames
themselves, so if a user that publishes a tree-sitter grammar we use
changes their sourcehut name then it breaks the build and any prior
builds using that grammar.

For now let's remove them from the default build. It's a bandaid over
a larger reliability and trust problem with the grammar repositories
but it should fix the build for now.
2024-01-11 09:26:25 -06:00
Pascal Kuthe
7739d3ece1
Revert "build(deps): bump ahash from 0.8.6 to 0.8.7" (#9294) 2024-01-11 22:13:39 +09:00
Gabriel Dinner-David
84e24b33dc
make sure to sync views when applying edits to unfocused views (#9173) 2024-01-09 10:21:16 +09:00
Sammo98
65d0412880
health - add formatter to display (#7986) 2024-01-09 10:15:50 +09:00
Michael Davis
305d6e9c89
Normalize S-<lower-ascii> keymaps to uppercase ascii (#9213) 2024-01-09 10:04:34 +09:00
Philipp Mildenberger
41ca46cf8c
Initialize diagnostics when opening a document (#8873) 2024-01-09 10:01:04 +09:00
rojebd
46ecc102ba
added voxed theme (#9164) 2024-01-09 09:57:14 +09:00
Kirawi
7af78c7788
update comment grammar (#9253) 2024-01-09 09:56:51 +09:00
Pascal Kuthe
48c49f0227
update history of a newly focused view (#9271) 2024-01-09 09:56:09 +09:00
Michael Davis
0cbd8d3df1
Check for rename support before showing LSP rename prompt (#9277) 2024-01-09 09:55:11 +09:00
Pascal Kuthe
4da6191a1c
don't automatically dismiss zero width diagnostics (#9280) 2024-01-09 09:54:55 +09:00
dependabot[bot]
20b91fd99a
build(deps): bump serde_json from 1.0.109 to 1.0.111 (#9284)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-09 09:52:36 +09:00
dependabot[bot]
97145eaae6
build(deps): bump ignore from 0.4.21 to 0.4.22 (#9283)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-09 09:52:25 +09:00
dependabot[bot]
bad10a5ddd
build(deps): bump libc from 0.2.151 to 0.2.152 (#9282)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-09 09:51:58 +09:00
dependabot[bot]
f4212421da
build(deps): bump ahash from 0.8.6 to 0.8.7 (#9281)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-09 09:51:38 +09:00
dependabot[bot]
e2e8d2739a
build(deps): bump serde from 1.0.193 to 1.0.195 (#9285)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-09 09:51:25 +09:00
Tomas
77ab792ac7
runtime/themes: adding "ttox" theme (#8524)
* runtime/themes: adding 'ttox' theme

* Improving primary selections
2024-01-08 03:57:04 +01:00
Greedwolf DSS
918bd9c2b0
feat: update wren tree-sitter grammar (#8544)
Co-authored-by: masai.dss <masai.dss@bytedance.com>
2024-01-08 03:54:16 +01:00
NitinKM
e46fb58595
Info on how to skip grammar build when building from source (#8698)
* info: no grammar compile

Added instructions on how to compile without compiling grammars

* Update book/src/install.md

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

---------

Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
2024-01-08 03:46:53 +01:00
jw013
00d681cc69
Update goto_file docs (#8563) (#9001)
Make the pluralization of files and selections consistent to emphasize
the 1-to-1 relation between files and selections. The prior wording
with plural "files" and singular "selection" can mislead users into
thinking the command can open multiple files from a single selection.
2024-01-08 03:11:18 +01:00
Ryan Roden-Corrent
c8e58304bf
Add textobject queries for protobuf grammar. (#9184)
Given `message Foo {string s = 1;}`
- `mat` selects `message Foo {string s = 1}`
- `mit` selects `{string s = 1;}`

Given `service SearchService { rpc Search(Req) returns (Resp); }
- `mit` or `mat` selects `Req` or `Resp`
- `mif` or `maf` selects `rpc Search(Req) returns (Resp);`
- `mit` selects { rpc Search(Req) returns (Resp); }`
- `mat` selects `service SearchService { rpc Search(Req) returns (Resp); }`
2024-01-08 03:08:41 +01:00
Paul Graydon
154d9b6ed1
Update tokyonight themes (#9099) 2024-01-08 03:08:20 +01:00
Jaakko Paju
73deba7044
Add textobject queries for Scala (#9191) 2024-01-08 03:05:10 +01:00
Jaakko Paju
a32d537d0a
Add HOCON language support (#9203)
* Add HOCON language support

* Remove error query

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

* Change include query

* Fix query error

---------

Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
2024-01-08 03:04:43 +01:00