You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For best editor integration, it'd be awesome to have a LSP (Language Server Protocol) implementation for neuron. It could potentially provide autocompletion of links, automatically showing the link title next to a link, make links clickable, show backlinks, etc., and all this in an editor-agnostic way. That would greatly improve the experience of editing zettels with neuron.
Reacted by felko, Sridhar Ratnakumar, harri, PanAeon, Gustav, Josh, Bruno Bigras, bulbousBullfrog, Stefan Gojan, Harald Gliebe and 12 more
In theory one could also do things like new note creation (eg: felko/neuron-mode#28) -- so all editors can just delegate to neuron in that aspect -- however I'm not sure if that's in the scope of LSP.
I think we can have some kind of a hack here. Go-to-definition provides the mechanism for going to a different file and we could provide "note creation" as a codeaction.
Renaming of links could also be a functionality for an LSP. Go-to-definition as @sureyeaah mentioned of course. Now sure if views like backlinking would be implemented an an LSP level.
If anybody feels like taking a stab at this, I added sample LSP server in Haskell here: #539
This provides a neuron lsp command that doesn't do much really, but you can use it with coc.vim in neovim using the below config. There is a hover handler which simply prints the notebook path.
Is there any other way to use neuron's searching facilities within vscode, currently? Ideally I'd like some quick command, mapped to a keyboard shortcut, where I can search zettel by their title, tag, or contents etc..
Regardless I might like to take a look at this, as I want to get familiar with serving LSP, writing utilities for zettel, and making "production-level" haskell. What's still left to do here? @srid
Configure VSCode (this might require writing an extension in TypeScript?) to use neuron lsp (a command, hidden from --help) as the LSP server. In NeoVim, this is straightforward to do.
Confirm that the stub LSP.hs hover message works. This ensures that neuron lsp is hooked up to the editor successfully.
As for "writing utilities for zettel" - I imagine that a lot of that can be done by neuron query in the command line, but if you can describe the specific workflows, I can give more info.
For contributing to production Haskell projects more generally, there are some good first issues here in neuron's issue tracker.
Anyway, happy to help with any further specific questions. We also have a Matrix chat room here.
Activity
srid commentedon Jun 3, 2020
In theory one could also do things like new note creation (eg: felko/neuron-mode#28) -- so all editors can just delegate to neuron in that aspect -- however I'm not sure if that's in the scope of LSP.
sureyeaah commentedon Jun 5, 2020
I think we can have some kind of a hack here. Go-to-definition provides the mechanism for going to a different file and we could provide "note creation" as a codeaction.
srid commentedon Jun 16, 2020
Some ideas: https://marketplace.visualstudio.com/items?itemName=sheilacat.zknotes
NullSense commentedon Jun 19, 2020
Renaming of links could also be a functionality for an LSP. Go-to-definition as @sureyeaah mentioned of course. Now sure if views like backlinking would be implemented an an LSP level.
Nadrieril commentedon Jun 19, 2020
Other suggestion: easy creation of a new note using current selection as the title
srid commentedon Jun 24, 2020
Another: "refactor" by renaming a tag across the zettelkasten.
cf. felko/neuron-mode@beeb47f
aca commentedon Jul 30, 2020
@srid Are you working on this? or anyone?
I'm interested.
srid commentedon Jul 30, 2020
@aca I'm not working on this. But @trevortknguyen was looking into this. Trevor, are you still interested? If so perhaps you two can collaborate?
@aca You might want to join Matrix, the project channel.
aca commentedon Aug 2, 2020
There will be an "official" neuron lsp implentation in haskell.
Until then, you might want to try https://github.com/aca/neuron-language-server.
sureyeaah commentedon Aug 2, 2020
@aca I can help with the "official" neuron lsp!
aca commentedon Aug 2, 2020
@sureyeaah. You should join matrix and discuss about official neuron lsp.
For now, I will just play,experiment with the go lsp..
trevortknguyen commentedon Aug 3, 2020
I do not think I will be able to work on the "official" neuron lsp.
hoschi commentedon Aug 5, 2020
the call/caller graph features of LSP can also be utilized for viewing/navigating the z-index.
srid commentedon Sep 3, 2020
An extension that displays neuron HTML preview to side would be pretty cool: https://twitter.com/owickstrom/status/1301241287727812610
srid commentedon Sep 7, 2020
Reference implementation in Haskell: https://github.com/dhall-lang/dhall-haskell/tree/master/dhall-lsp-server
srid commentedon Jan 24, 2021
If anybody feels like taking a stab at this, I added sample LSP server in Haskell here: #539
This provides a
neuron lspcommand that doesn't do much really, but you can use it with coc.vim in neovim using the below config. There is a hover handler which simply prints the notebook path.srid commentedon Mar 12, 2021
One tiny benefit of using LSP would be that renames on large notebooks would be faster (
O(1)). cf. svsool/memo#286 (comment)srid commentedon Apr 17, 2021
Inspiration: https://github.com/artempyanykh/zeta-note#screenshots
samwalls commentedon Apr 21, 2021
Is there any other way to use neuron's searching facilities within vscode, currently? Ideally I'd like some quick command, mapped to a keyboard shortcut, where I can search zettel by their title, tag, or contents etc..
Regardless I might like to take a look at this, as I want to get familiar with serving LSP, writing utilities for zettel, and making "production-level" haskell. What's still left to do here? @srid
srid commentedon Apr 21, 2021
You can try task prompts and then have vscode run the neuron command with prompted values.
For LSP, there is stub code here: https://github.com/srid/neuron/blob/master/src/Neuron/LSP.hs
I'd say the next steps are:
neuron lsp(a command, hidden from--help) as the LSP server. In NeoVim, this is straightforward to do.neuron lspis hooked up to the editor successfully.As for "writing utilities for zettel" - I imagine that a lot of that can be done by
neuron queryin the command line, but if you can describe the specific workflows, I can give more info.For contributing to production Haskell projects more generally, there are some good first issues here in neuron's issue tracker.
Anyway, happy to help with any further specific questions. We also have a Matrix chat room here.
mickael-menu commentedon Apr 24, 2021
I've integrated an LSP server in
zk, which is compatible with neuron. Just runzk initin your neuron notebook, then follow the LSP instructions for your editor.It supports neuron's tags and wiki-links.
(Kudos to @aca, your neuron LSP Go server got me started)
That's right, you will need to create a VS Code extension for your LSP server. I've created one for
zkthat is pretty minimal, which should be easy to modify to startneuron lsp.One important bit is to configure the
activationEvents. I chose to start my LSP client when a.zkfolder is detected in the folder, you can probably do the same withneuron.dhall: https://github.com/mickael-menu/zk-vscode/blob/701cfd07db3529b039392067385fa81df594e74d/package.json#L14-L16