-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Syntax Highlighting related panic: IncludedRangesError(1) #3816
Comments
Unable to reproduce. Linux 5.15.60-1-MANJARO @ 21.3.7 Which |
Seems to trigger if the start of the range is past the end of the range or if ranges overlap:
I also can't replicate: which Line 31 in 0361217
I don't think it has anything to do with the LSP, this is a tree-sitter parsing issue. |
There's a flake.nix linked in the initial post, it's collapsible so easy to miss. I could reproduce the crash with it (on mobile right now so can't get the |
I tested that file with |
@AlexanderBrevig
At least for me there are no keys required at all. I tested adding the
I do not have auto-pairs disabled. I'll provide my config here: ~/.config/helix/config.tomltheme = "autumn"
[editor]
idle-timeout = 0
[editor.cursor-shape]
insert = "bar"
normal = "block"
select = "block"
[keys]
[keys.insert]
down = "move_line_down"
left = "move_char_left"
right = "move_char_right"
up = "move_line_up"
[keys.normal.space]
n = ":new"
u = ":format" ~/.config/helix/languages.toml[[language]]
name = "latex"
[language.language-server]
command = "ltex-ls"
[[language]]
name = "nix"
[language.formatter]
command = "/nix/store/8i4cph1j35jx722snpd2dbj9s8w60amr-nixfmt-0.5.0/bin/nixfmt"
[[language]]
comment-token = "#"
file-types = ["COMMIT_EDITMSG"]
name = "git-commit"
roots = []
scope = "git.commitmsg"
[language.indent]
tab-width = 2
unit = " "
[language.language-server]
command = "ltex-ls"
[[language]]
file-types = ["md"]
name = "markdown"
roots = []
scope = "source.markdown"
[language.language-server]
command = "ltex-ls" Other than these settings, default from 0361217 are used |
Here is a flake.nix which just straight up crashes helix. flake.nix <----- Collapsible{
inputs = {
utils.url = "github:numtide/flake-utils";
devshell.url = "github:numtide/devshell";
fenix.url = "github:nix-community/fenix";
fenix.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { self, nixpkgs, utils, devshell, fenix, ... }@inputs:
utils.lib.eachSystem [ "aarch64-linux" "i686-linux" "x86_64-linux" ]
(system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ devshell.overlay ];
};
rust-toolchain = with fenix.packages.${system};
combine [ stable.rustc stable.cargo stable.clippy stable.rustfmt ];
in rec {
devShells.default = (pkgs.devshell.mkShell {
imports = [
# "${devshell}/extra/language/rust.nix"
"${devshell}/extra/git/hooks.nix"
];
name = "apex-rs-vanilla-dev-shell";
packages = with pkgs; [
rust-toolchain
rust-analyzer
cargo-outdated
cargo-udeps
];
devshell.startup.bindgen-hook.text = ''
source ${pkgs.rustPlatform.bindgenHook}/nix-support/setup-hook
populateBindgenEnv
'';
git.hooks = {
enable = true;
pre-commit.text = "nix flake check";
};
commands = [
{
package = "git-cliff";
help = "Changelog generator";
}
{
package = "treefmt";
help = "Format project tree with recommended formatter";
category = "formatter";
}
{
name = "udeps";
command = "cargo-udeps udeps";
category = "formatter";
help = "Find unused dependencies in Cargo.toml";
}
{
name = "outdated";
command = "cargo-outdated outdated";
category = "formatter";
help = "Find out-of-date dependencies";
}
{
name = "build";
command = "cd $PRJ_ROOT && cargo build";
help = "Build project";
category = "build";
}
{
name = "build release";
command = "cd $PRJ_ROOT && cargo build --release";
help = "Build project in release mode";
category = "build";
}
{
name = "clippy";
command = "cd $PRJ_ROOT && cargo clippy";
help = "Build project";
category = "build";
}
{
name = "clippy release";
command = "cd $PRJ_ROOT && cargo clippy --release";
help = "Build project in release mode";
category = "build";
}
{
name = "watch";
command = "cd $PRJ_ROOT && cargo watch -x clippy";
help = "Watch project and continuesly clippy";
category = "build";
}
{
name = "watch release";
command = "cd $PRJ_ROOT && cargo watch -x clippy --release";
help = "Watch project and continuesly clippy in release mode";
category = "build";
}
];
});
checks = {
nixpkgs-fmt = pkgs.runCommand "nixpkgs-fmt" {
nativeBuildInputs = [ pkgs.nixpkgs-fmt ];
} "nixpkgs-fmt --check ${./.}; touch $out";
cargo-fmt = pkgs.runCommand "cargo-fmt" {
nativeBuildInputs = [ rust-toolchain ];
} "cd ${./.}; cargo fmt --check; touch $out";
};
});
} With #3826 of course the output of the program changes to: Program output
|
It looks like this was introduced by 665e27f |
minimal reproduction: {
startup.hook = ''
sh
''
} I assume it has something to do with this: helix/runtime/queries/nix/injections.scm Line 17 in eb81cf3
|
looking at this the query: helix/runtime/queries/nix/injections.scm Lines 11 to 19 in eb81cf3
matches twice for the above nix text
so there is duplicated content nodes helix/helix-core/src/syntax.rs Lines 1192 to 1197 in eb81cf3
adding |
Summary
When adding a
'
-symbol to a specific line of a specific nix-file, the predefined language-server for nix files (rnix-lsp) seems to provide information which results in an error in the tree_sitter parser which is unwrapped and hence panics.helix/helix-core/src/syntax.rs
Line 988 in 0361217
Reproduction Steps
I tried this:
hx flake.nix
'
after the=
-symbol of that lineflake.nix
I expected this to happen:
No crash
Instead, this happened:
Crash
Helix log
~/.cache/helix/helix.log
console output
Platform
Linux (NixOS)
Terminal Emulator
alacritty
Helix Version
helix 22.08.1 (0361217)
The text was updated successfully, but these errors were encountered: