Skip to content

Completion provides no results unless [[ are typed #444

Open
@WhyNotHugo

Description

@WhyNotHugo

Check if applicable

  • I have searched the existing issues (required)
  • I'm willing to help fix the problem and contribute a pull request

Describe the bug

When I manually invoke auto-completion, it won't provide any suggestions for inserting links.

Moreover, if using markdown style links, I still need to type [[ before the completion provider yields any results.

How to reproduce?

  1. Invoke your text editor's autocompletion
  2. You'll see no suggestions for inserting links

OR

  1. Configure your notebook to use markdown style links.
  2. Type [ and (optionally) manually trigger autocompletion.
  3. You'll see no suggestions for inserting links

The root cause here is the completion provider only yields results in the two preceding characters are [[:

if strings.HasPrefix(doc.LookBehind(position, len(currentWord)+2), "[[") {

zk configuration

[notebook]
dir = "~/zk"

[note]
filename = "{{id}}"

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

[lsp.diagnostics]
dead-link = "error"


### Environment

```bash
zk-0.14.1-r2
system: Linux 6.10.3-0-edge x86_64 Linux

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions