-
-
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
Add navigation/find usages/completion support for Nix paths #45
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First, thanks for your contribution. Here is my initial review.
I would appreciate if you could also write some basic test, if possible.
Maybe this might help https://plugins.jetbrains.com/docs/intellij/writing-tests-for-plugins.html.
psiElement(NixStringText.class) | ||
.withText(string().matches(NIX_PATH_REGEX)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I currently don't quite understand how this is working. How does this code associate which files match against which strings or paths? The sting might also contain escape sequences, shouldn't we have to parse them somewhere?
string_text ::= STR | IND_STR | ||
{ | ||
mixin="org.nixos.idea.psi.impl.NixStringReferencingElementImpl" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you provide some rationale why you are putting the mixin at string_text
, not string
? One string might contain multiple string_text
elements, couldn't this be a problem? I fear that the current implementation would work for ./
in ''hi ''$./''
, but not in ''*hi ./''
. (I think we should probably detect neither of these cases, and only match against the whole string.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi I am in good hands I just need some money I am going back in tomorrow and I'm trying my luck and I'm not even trying
What kind of error do we get? Is it possible that we catch the error and provide some more meaningful error message for the user? |
default.nix
file offer that file as an optional destination.Note that rename for path components is partially working but gets an error. This needs more work, but doesn't impact on the other new features.