Skip to content
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

LSP go to definition goes to incorrect note #111

Closed
pwntester opened this issue Nov 23, 2021 · 4 comments · Fixed by #112
Closed

LSP go to definition goes to incorrect note #111

pwntester opened this issue Nov 23, 2021 · 4 comments · Fixed by #112

Comments

@pwntester
Copy link

Hi,

I group notes for the same project under a directory called <DATE> - Project name and then I have a main note for that project on that directory with the same name <DATE> - Project name.md. When I add a link to that note ([[<DATE> - Project name]]) and use the LSP go to definition feature, it opens another note from the same directory.

Steps to reproduce:

  • Create a directory called 2021-12-31 - test
  • Create a note called 2021-12-31 - test.md in 2021-12-31 - test
  • Create a note called another note.md in 2021-12-31 - test
  • In a different note add the following link ([[2021-12-31 - test]])
  • Use LSP go to definition to navigate to the note. In my case another note.md is opened instead.

Thanks

@mickael-menu
Copy link
Collaborator

This is caused by zk matching any note containing the given portion in its path, ordered by the smallest path.

I guess it could be changed to give precedence to the filename instead of the whole path.

@pwntester
Copy link
Author

that would be great!

@mickael-menu
Copy link
Collaborator

@pwntester Could you check out the latest main and see if it fixes the problem for you?

@pwntester
Copy link
Author

Seems to works flawlessly! Will test more thoughfully during the next days. Thanks!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants