Open avilesj opened 6 months ago
Hey! A couple of questions:
:messages
)Hi!
cd
-ing into it with projects
.Thank you for the swift response!
I am running into the same issue, however it only happens on large projects to me (NX monorepo with 130k LOC.)
Smaller projects work fine.
Can confirm, happening to me as well on a larger repo. Happens regardless of whether or not I open nvim at the root of the repo.
@Noodle-Bug would that repo happen to be open-source? :)
@Noodle-Bug would that repo happen to be open-source? :)
...no? Is that an issue?
Does not work on this public repo I own https://github.com/avilesj/configs
It didn't work there when it was private either.
I figured it out! I've been having this issue for so long and now I finally figured it out by accident when I was trying to copy the file URL.
The issue lies in .nvmrc
file being in the repo. I'm using fnm, not sure if this happens with nvm as well, but fnm prints 'Using Node 18.16.1' (or whatever your specified node version is) when .nvmrc is present and that messes up the script.
The plugin works as it's supposed to when you delete the .nvmrc
file. However, for obvious reasons, that is not the ideal solution.
I remember having problems or seeing this "Using node x" in more places using nvim. It also prints the line when you open a new shell (i'm using fish, but it probably happens with others as well I would guess). So I guess nvim internally opens a new shell for the commands?
Output of GitBlameCopyFileURL
with .nvmrc
Using Node v18.16.1/blob/Using Node v18.16.1/ts/Repos/folder/folder/project/src/metrics.ts#L13
Output of GitBlameCopyFileURL
without .nvmrc
https://ssh.dev.azure.com/v3/org/project/repo-name/blob/d66a1294736bcf60cebe9455f92efdfab1cd2e82/src/metrics.ts#L17
The URL doesn't really work either since it's completely incorrect when it comes to Azure, it should look something like this:
https://dev.azure.com/org/project/_git/repo-name?path=/src/metrics.ts
But that's besides the point.
@f-person what do you think?
Thanks @filipkrayem! This is very weird, but it makes sense that an issue like this would be caused by the output being tampered with. I wonder if @avilesj & @Noodle-Bug could confirm your observations and share whether they also had nvmrc (or things)?
Hi. Thanks again for keeping up with this.
I make no use of nvmrc. I do use Volta but the specs are within package.json
One thing tho, I have the same issue in my Terraform repository too and there is 0 Node code inside, fwiw.
does anything print to your console when you open up a new terminal? The actual problem most likely isn't a .nvmrc file or fnm, but the fact that it prints something to the console
Try running the command :GitBlameCopyFileURL, that should reveal the problem imo. If the URL looks valid, we may have a different issue that results in the same behavior, I guess "Not commited yet" is a fallback message so multiple issues could be causing it.
The actual problem most likely isn't a .nvmrc file or fnm, but the fact that it prints something to the console
exactly!
Try running the command :GitBlameCopyFileURL
yes please! it would be very nice if you could also share it in case it looked weird! please replace any sensitive details with a placeholder, though! :)
I figured it out! I've been having this issue for so long and now I finally figured it out by accident when I was trying to copy the file URL.
The issue lies in
.nvmrc
file being in the repo. I'm using fnm, not sure if this happens with nvm as well, but fnm prints 'Using Node 18.16.1' (or whatever your specified node version is) when .nvmrc is present and that messes up the script.The plugin works as it's supposed to when you delete the
.nvmrc
file. However, for obvious reasons, that is not the ideal solution.
@filipkrayem do you have anything into your fish shell init script or repo that runs nvm before or after every command? I use nvm regularly in other nodejs repos and don't run into any issues. The only way that nvm will provide an output is if you invoke it (via nvm use
or nvm install
). In this case it looks like nvm use
is being run. I've tried to reproduce but can't find a way to do so. Do you know if this command is running automatically through a shell init script or git hook?
In my conf.d/fnm.fish
I have this script:
# fnm
set PATH "~/.config/.fnm" $PATH
fnm env --use-on-cd --log-level error | source
Basically what it does it runs fnm use
if a .nvmrc file is specified and prints the Using version
to the console.
By adding --log-level error
flag I have fixed the issue, since fnm prints the version log as level info
.
I've tried a bit but can't manage to reproduce the issue even if I output to my shell after every command. I also looked into testing the url generation for azure but I don't think I can create a repo without paying :sweat_smile:
Hi. I am using LazyVim and I am extending it with this plugin. I have not added any special config.
Here is the config.