-
-
Notifications
You must be signed in to change notification settings - Fork 31
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
goto definition for a file path #557
Comments
Did you mean "go to definition" for file paths? AFAIK, Ctrl + Click works as a part of "documentLink" on vscode, I guess your editor may not provide such linking. |
Yeah, I believe 'go to definition' is what it is. In Helix, it triggered when I hit languages = {
language-server.nixd = {
command = "nixd";
formatting = {
command = ["alejandra"];
};
options.nixos = {
expr = "(builtins.getFlake \"/etc/nixos\").nixosConfigurations.core.options";
};
};
language = [
{
name = "nix";
auto-format = true;
language-servers = ["nixd" "nil"];
formatter.command = "${pkgs.alejandra}/bin/alejandra";
}
];
}; If I select |
I see, seems to be reasonable to integrate it. |
Thanks for the detailed information; Acked. I also wanted to note that the feature document link behaves differently across editors. In vscode, document links become However, I believe it's important to enhance the user experience across all editors, so I'm happy to add this feature. |
Thanks for that! I really appreciate it. ^w^ |
(Please let me know if I'm misunderstanding the issue): In Helix, 2024-08-08_09-29-25.mp4Relevant snippet from HM config for Helix: languages = {
language = [
{
name = "nix";
auto-format = true;
language-servers = [ "nixd" ];
formatter.command = "nixfmt";
}
];
language-server = {
nixd = {
command = "nixd";
config = {
nixpkgs.expr = "import (builtins.getFlake \"/home/brisingr05/nixos-config\").inputs.nixpkgs { }";
formatting.command = [ "nixfmt" ]; # Currently doesn't work
options.nixos.expr = "(builtins.getFlake \"/home/brisingr05/nixos-config\").nixosConfigurations.hpaio.options";
};
};
}
} |
That's nifty, @Brisingr05! I actually was just thinking of Regardless, the concern still remains. Other editors will seemingly often roll the go-to-file and go-to-definition logic into a single user-facing action, but Helix does not. In Helix, you would need to train separate reflexes for both use cases. This is unpleasant if you're used to I also believe there is a logical separation here, too. This also has precedence as a more 'intelligent' go-to-file behavior (as opposed to the raw behavior) -- which is why I'd prefer to keep my muscle memory trained on E.g., in Rust, if you |
Just tested it, and it also works in
Edit: It also works for Bash! Hitting |
Is your feature request related to a problem? Please describe.
It's awkward to navigate between related source files (e.g., source files that import other source files).
Describe the solution you'd like
LSP go-to on file path would ideally open that path.
Describe alternatives you've considered
I've tried to setup multi-LSP support and have
nil
do it, but it doesn't seem to work.Additional context
In nil, if you 'go to' a path, it will open that file path. E.g., 'go to
./module.nix
' will open./module.nix
. After switching tonixd
, I am loving a lot of the cross-file analysis, but I really miss being able to hop between source files.The text was updated successfully, but these errors were encountered: