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

zk lsp fails with custom link-format #264

Closed
dstanberry opened this issue Oct 15, 2022 · 5 comments
Closed

zk lsp fails with custom link-format #264

dstanberry opened this issue Oct 15, 2022 · 5 comments
Labels
stale No recent activity

Comments

@dstanberry
Copy link
Contributor

Version: zk 0.11.1-3-g404ef9d

[format.markdown]
link-format = "wiki"

Until recently I've been using the above settings and have had no issues in neovim with the lsp configuration.

However, after changing the link-format to "[{{title}}]({{path}})" I get error "zk: not found".

Launching the zk binary and specifying a log location doesn't seem to show anything helpful to diagnose this, the handler for textDocument/definition just prints 'null'.

1a05a04#commitcomment-77337988 suggests that this shouldn't be an issue for zk to be able to resolve, so I'm not sure what the cause is. This may be related to #250.

Can you provide any guidance if there is some other setting I may need to modify? Happy to provide any additional information as needed.

@mickael-menu
Copy link
Member

I can't reproduce this error, using the [[ completion trigger in nvim and the following TOML config:

[note]
template = "default.md"
filename = "{{id}}"

[format.markdown]
link-format = "[{{title}}]({{path}})"

Maybe check that the directory containing zk is properly set in nvim by running :echo $PATH?

@dstanberry
Copy link
Contributor Author

dstanberry commented Oct 30, 2022

The completion works for me as well (and seems to be the only action lsp-wise that works) but vim.lsp.buf.hover() fails and results in the error message I mentioned in the initial post.

This is the config I am using:

[note]
language = "en"
filename = "{{date now '%Y-%m-%d'}}-{{slug title}}"
template = "default.md"
id-charset = "hex"
id-length = 5
id-case = "lower"

[group.journal]
paths = ["inbox", "journal"]
[group.journal.note]
filename = "{{date now '%Y-%m-%d'}}-{{id}}"
extension = "md"
template = "journal.md"

[format.markdown]
hashtags = true
colon-tags = true
# link-format = "wiki"
# link-format = "[[{{filename}}]]"
link-format = "[{{title}}]({{path}})"
link-encode-path = true
link-drop-extension = true

@dstanberry
Copy link
Contributor Author

dstanberry commented Oct 31, 2022

I've found that it works as intended with link-format = "markdown". The difference is when accepting a completion entry, the path is relative to the current file.

So if I have a file that I'm working on in inbox/<file-currently-being-edited.md> and I add a link to a file located in journal/<another-file.md> it shows up as

...
[Another File](../journal/<another-file.md>)
...

Just to clarify, what doesn't work for me is using link-format = "[{{title}}]({{path}})" as this produces

...
[Another File](journal/<another-file.md>)  <!-- zk: not found -->
...

In your setup are you seeing any distinctions between the two link-format values?

@github-actions
Copy link

github-actions bot commented Dec 1, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs in the next 5 days.

@github-actions github-actions bot added the stale No recent activity label Dec 1, 2022
@github-actions
Copy link

github-actions bot commented Dec 7, 2022

This issue was closed because it has been stalled for 5 days with no activity.

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

No branches or pull requests

2 participants