-
Notifications
You must be signed in to change notification settings - Fork 39
Builtin Obsidian LSP #52
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This look interesting @neo451.
Thinking out loud to get a better feel for what this means:
If we decide to go down the lsp route, this would mean
- we remove all
blink.cmp
andnvim.cmp
related code - we just have have completion-framework agnostic code which would power the obsidian-lsp
- we can offer various obsidian commands via code actions (I really well integrated code action, e.g. these https://github.com/mrcjkb/rustaceanvim). Note that only relevant actions should be shown. This is better than the
Obsidian*
commands which you can always call, but some don't apply for the current situation. - we need lsp experience to migrate everything and new contributors might shy away from contributing (maybe)
- we need to phase out the current approach and switch to the new one without breaking how ppl use
obsidian.nvim
What are the must have features for the LSP?
- completion for tags and links
- some context specific actions
- hover
I suggest to have a concrete list of features that cover some of the more risky features as part of this POC PR. Then we can decide how to procced, i.e. if we want to replace the cmp stuff.
I'll have to think more about other points like migration and a full feature proposal, but I can confidently say the lsp developer experience will be much better, the prototype completion logic is less than 100 lines and very readable, instead of needing to knowing specific plugin's API to do anything about it. I will also make sure to add documentation on how it works. |
found a nice project for reference: |
Nice progress @neo451! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello, I have marksman installed and I am checking the features that are implemented there, already. How about references on links? Is there a way to list all the notes linking to the same note link under cursor?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will be easy to implement, ObdisianBacklinks already has the same logic I think
I, while perusing nixpkgs, found markdown-oxide, what are the possible features that this plugin would provide that this lsp server doesnt? |
sorry that might have come off as hostile, I like this plugin but dont want people to have to reinvent the wheeel |
after playing around with it this plugin supports the |
I totally get the idea of not wanting to reinvent the wheel. Some thoughts:
In conclusion, lsp is powerful for being editor-agnostic, but this plugin do not use it for that but for the great neovim lsp lua library. As a result, this plugin will have:
and of course folks can just opt out of any feature they don't want and use other markdown lsps, we would be happy to make sure conflicts don't happen. |
I think the current of approach of providing completion sources is not sustainable. It is a lot of work debugging blink support, and potentially supporting other alternatives, like mini.completion and native omni complete.
This LSP approach solves it by spawning a in process LSP server (just a function) and lets the completion plugin to handle completion.
On top of that I also had some luck implementing a simple hover support to preview notes, I think zk-nvim has this but they need an external process and I think this one is much neater. (no shade
I think this opened quite nice space for new arrangement of functionalities.
currently ideas:
This PR:
completion
smart_snnipets
: https://linkarzu.com/posts/neovim/markdown-setup-2025/#add-markdown-link-from-clipboardhover
for previewing note contentrename
->ObsidianRename
workspace_diagnostic
->ObsidianCheck
code_action
diagnostic
Another PR:
Because this concerns making pickers lsp compatible:
references
->ObsidianBacklinks
document_symbol
->ObsidianTOC
document_link
->ObsidianLinks
let me know if there's more ideas!