Skip to content

Providing a Language Server (LSP) #22

@mickael-menu

Description

@mickael-menu

zk can provide a basic integration with any LSP-compatible text editor by shipping a Language Server.

PR #21 implements a proof of concept server showing promising results, but there's more to come:

  • Links

    • Auto-complete internal Markdown links with [[
    • Auto-complete the path portion of a Markdown link with [custom title]((
    • User configuration to specify the link format using a template
    • Open a note from an inline Markdown link or WikiLink (document link when supported and go to definition as an alternative)
    • Open a website from an inline external Markdown link (with textDocument/documentLink)
    • Open a reference link
    • Move the caret to the next link in the note with a code action, for quick navigation (with window.showDocument)
    • Preview the content of a linked note with a hover
    • Diagnostic (error) to show dead links
    • Diagnostic (hint) to show the title of a linked note next to the link
    • Browse backlinks with find references
    • Browse backlinks / outbound links with a tree-like call hierarchy (client support is still lacking)
    • Highlight WikiLinks using semantic tokens (client support is still lacking)
    • (Maybe?) Report DocumentLink for unlinked mentions, using aliases metadata
  • Tags

    • Auto-complete tags with # and : trigger characters
    • Rename a tag with a refactor code action
    • Highlight tags using semantic tokens (client support is still lacking)
    • View the list of all the notes for a particular tag when running the References action.
  • Notes

    • Code action to create (and link) a new note using the current selection as its title
    • Code action to create (and link) a new note using the current selection as its content (refactor.extract?)
    • Code action to rename the note title
    • User configuration to declare dynamic code actions to generate notes with custom group / template
    • Snippet support using zk templates
  • Expose zk commands as LSP commands, for easy client-side consumption

    • zk.init to create a new notebook
    • zk.index to index a notebook manually
    • zk.new to create a new note
    • zk.list to search for notes (returning a JSON)
    • zk.tag.list to return the list of tags
    • zk.info to provide detailed JSON metadata about a notebook (list of groups, templates, dirs, etc.)
  • Other

    • Optimizations for large (10k+) notebooks (esp. completion)

Feel free to share more ideas!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions