Skip to content

feat: move to in-process LSP#7

Open
cvigilv wants to merge 18 commits into
mainfrom
feat-move-to-inprocess-lsp
Open

feat: move to in-process LSP#7
cvigilv wants to merge 18 commits into
mainfrom
feat-move-to-inprocess-lsp

Conversation

@cvigilv

@cvigilv cvigilv commented Apr 16, 2026

Copy link
Copy Markdown
Owner

Decided to move this plugin into a new structure to make my life easier maintaining it.

The new structure organized denote.nvim as 2 parts:

  • The ftplugin for the actual denote files
  • The in-process lsp to manage all intelligence and features related to working with denote.

Although the API and command lines will still exists, the move to having a in-process LSP
allows me to use the LSP harness to expose features commonly used in other LSPs, such as code
actions, diagnostics, and more. This will allow me to add features more easily and make the
plugin more powerful.

This PR implements the preliminary version that will be available once all basic functionality is
implemented.

- Introduce `denote.lsp` module with handlers for definition, references, code actions, and commands.
- Replace old autocmd-based link/backlink cache with LSP-driven navigation.
- Refactor `denote.links` to use loclist and lgrep for link extraction.
- Update API for backlinks to accept filename argument.
- Remove cache population and update logic from autocmds.
- Start LSP server automatically in denote filetype plugin.

BREAKING CHANGE: Removes global link cache and changes how links/backlinks are discovered and displayed. Users must now rely on the built-in LSP for navigation and actions.
- Add `links` and `backlinks` functions to populate the loclist with links and backlinks for the current buffer, including formatted titles.
- Refactor related code for consistency and improved formatting.
- Add LSP completion handler for Denote files, providing fuzzy-matched file suggestions with markdown documentation.
- Improve hover handler to strip link syntax and format content as markdown.
- Refactor definition and references handlers to use new API functions for links and backlinks.
- Register new LSP capabilities for completion.
Set the global variable to true to correctly indicate that the plugin has been loaded, preventing redundant setup.
This change makes Org-mode follow links by:

- Editing note files with text-like extensions directly in Neovim
- Opening other file types via the OS default application
- Adding platform-specific open commands for Windows, macOS, and Unix
@cvigilv cvigilv force-pushed the feat-move-to-inprocess-lsp branch from 6b431b8 to 1b2afee Compare May 14, 2026 11:02
cvigilv added 4 commits May 14, 2026 13:08
This seems to generate some problems, but its worth keeping to debug the
plugin. May remove this group after all, as I yet have found a solution
that works seamlessly.
This is the first usercommands on the major change on moving into a more
minimal and simple interface. The new command does one thing and it does
it well: create a new note. Now users can select text visually and
invoke this command to (i) create a new note with the selected text as
title and (ii) automatically replace the selected text into a link into
the newly created file.

A major changes related to this commit also comes in the form of
extending the API.The "denote.api.denote()" function now accepts a table
with Denote components / fields, and a boolean to whether open the new
file after creating the note.
@cvigilv cvigilv force-pushed the feat-move-to-inprocess-lsp branch from 3d501a7 to 31e1eff Compare May 14, 2026 21:10
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 this pull request may close these issues.

1 participant