Commit graph

5283 commits

Author SHA1 Message Date
Pascal Kuthe
87a720c3a1
make path changes LSP spec conform (#8949)
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)
2024-01-29 01:34:45 +09:00
sogaiu
f5b67d9acb
Use janet-simple grammar for Janet (#9247)
* Use janet-simple grammar for Janet

* Update book

* Tweak language name and related

* Rename janet-simple to janet in book

* Remove spurious language section for janet

* Drop quote_lit and qq_lit related highlighting

---------

Co-authored-by: sogaiu <983021772@users.noreply.github.com>
Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
2024-01-28 19:17:46 +09:00
NitinKM
4ab7029535
Add icon to Windows executable (#9104)
* injecting the icon through a resource file, no extra deps

* formatted

* scripted rc compilation

* formatted and restructured

* simplified conditional func call
2024-01-28 18:31:10 +09:00
Twinkle
eb3c4e9f00
feat: add hard/soft contrast for gruvbox light mode (#9266) 2024-01-28 18:20:51 +09:00
Ryan Roden-Corrent
fe44391016
Add argument to textobject in gdscript. (#9288)
Currently `maa` only selects parameters in a function definition.
Allow it to also select arguments inside a function call.
2024-01-28 18:19:25 +09:00
Jaakko Paju
ee68fd09ac
highlight(scala): highlight abstract methods in traits and classes (#9340) 2024-01-28 18:18:35 +09:00
Abderrahmane TAHRI JOUTI
0328fa4d02
adjust color darkness on ruler & inlay-hints (#9375) 2024-01-28 18:14:12 +09:00
Michael Davis
035b8eabdb Respect injections in movement::move_parent_node_end 2024-01-28 18:13:33 +09:00
Michael Davis
8b6565c839 Respect injections in :tree-sitter-highlight-name 2024-01-28 18:13:33 +09:00
Michael Davis
5e0b3cc28b Use injection syntax trees for bracket matching
Previously we used the root syntax tree for bracket matching. We can use
the new functionality in `Syntax` for finding the correct syntax tree
for a given byte range though so we use the correct syntax tree within
injections. This improves bracket matching behavior within HTML
injections like script or style tags for example.
2024-01-28 18:13:33 +09:00
Jaakko Paju
9978d421fe
Include interpolated SQL strings in Scala injection queries (#9428)
* Change Scala injection queries to include SQL strings

* Include block comments in comment injection

* Change #match predicate to #any-of

Co-authored-by: Kirawi <67773714+kirawi@users.noreply.github.com>

---------

Co-authored-by: Kirawi <67773714+kirawi@users.noreply.github.com>
2024-01-28 18:12:07 +09:00
Travis Harmon
f0be0c6d4a
Make status line modes bold for theme onedark (#9435)
* Make status line modes bold

* Revert change to onedarker
2024-01-28 18:11:31 +09:00
Chirikumbrah
1616021a5a
Make status line modes bold (#9449) 2024-01-28 18:11:05 +09:00
Poliorcetics
0d09fb4f55
lang(git-ignore): add helix/ignore to git-ignore file types (#9447) 2024-01-27 13:17:37 -06:00
blinxen
2661e05b34
Update some grammars to a commit where the license file is included (#9279)
Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
2024-01-25 14:12:17 +09:00
Nick
d8b8d2fda6
Fix error message shown for goto references (#9382) 2024-01-25 14:11:12 +09:00
Michael Davis
cda8ea991e
highlighting: Gate multiple captures behind #is-not? local predicates (#9390) 2024-01-25 14:10:58 +09:00
Blaž Hrastnik
83f09ecbff minor: Silence noisy language server not found error in log 2024-01-24 16:00:21 +09:00
Michael Davis
cb25d13028 Improve error handling for which::which failures
Co-authored-by: Pascal Kuthe <pascalkuthe@pm.me>
2024-01-24 15:47:49 +09:00
Michael Davis
6d724a8f33 Re-export which from helix-stdx::env
We use `which::which` in many crates, so `which` was a separate
dependency across all of them. We can centralize `which` into the
stdx crate so it's easy for all crates to depend on it.

I also moved the rest of `helix-view/src/env.rs` into helix-stdx's
`env` module since it only contained a thin wrapper around `which`
and `std::env`.
2024-01-24 15:47:49 +09:00
Blaž Hrastnik
6bfe1ddc53 minor: Silence noisy set_error log
Outside of debugging tests, it makes no sense to log this.
2024-01-24 15:31:16 +09:00
dependabot[bot]
b606c05246
build(deps): bump actions/cache from 3 to 4 (#9402)
Bumps [actions/cache](https://github.com/actions/cache) from 3 to 4.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-23 20:23:39 +01:00
Idobenhamo
299bcce481
Update Typst Tree-Sitter grammar (#9403)
Co-authored-by: Idobenhamo <idobenhamo@users.noreply.github.com>
2024-01-23 18:27:46 +01:00
melted-brownie
2058b3732c
Add text object queries for dart (#9411)
* Add text object queries for dart

* Update runtime/queries/dart/textobjects.scm

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

* Clean up internal capture name

---------

Co-authored-by: Sébastien Blondiau <sebastien.blondiau@iot-d.com>
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
2024-01-23 18:27:09 +01:00
dependabot[bot]
7caae13465
build(deps): bump gix from 0.57.1 to 0.58.0 (#9407)
Bumps [gix](https://github.com/Byron/gitoxide) from 0.57.1 to 0.58.0.
- [Release notes](https://github.com/Byron/gitoxide/releases)
- [Changelog](https://github.com/Byron/gitoxide/blob/main/CHANGELOG.md)
- [Commits](https://github.com/Byron/gitoxide/compare/gix-v0.57.1...gix-v0.58.0)

---
updated-dependencies:
- dependency-name: gix
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-23 16:56:16 +01:00
dependabot[bot]
cbd8602018
build(deps): bump smallvec from 1.12.0 to 1.13.1 (#9405)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-23 23:19:36 +09:00
Jaakko Paju
4168864572
Add bufferline config for onedark & onedarker themes (#9397) 2024-01-23 23:19:22 +09:00
dependabot[bot]
ae8042bb83
build(deps): bump bitflags from 2.4.1 to 2.4.2 (#9404)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-23 11:24:38 +09:00
dependabot[bot]
e85507ccac
build(deps): bump regex from 1.10.2 to 1.10.3 (#9408)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-23 11:24:29 +09:00
dependabot[bot]
960cda60ab
build(deps): bump chrono from 0.4.31 to 0.4.32 (#9409)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-23 11:22:42 +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
Boris Verkhovskiy
7d7ace551c
Highlight .bash_history as bash (#9401) 2024-01-23 00:19:28 +01:00
Jaakko Paju
9ed3dc52e0
Update Scala tree-sitter grammar (#9348)
* Update Scala tree-sitter grammar

* Support block comments

Modify comment handling in textobjects and highlights to support new TS-scala node type 'block_comment'
2024-01-22 19:51:56 +01:00
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