Skip to content

LSP server for editor integration #213

Closed

Description

@Nadrieril

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.

Activity

  1. srid commented on Jun 3, 2020

    @srid
    Owner

    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.

  2. sureyeaah commented on Jun 5, 2020

    @sureyeaah

    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.

  3. srid commented on Jun 16, 2020

    @srid
    Owner
  4. NullSense commented on Jun 19, 2020

    @NullSense

    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.

  5. Nadrieril commented on Jun 19, 2020

    @Nadrieril
    ContributorAuthor

    Other suggestion: easy creation of a new note using current selection as the title

  6. srid commented on Jun 24, 2020

    @srid
    Owner

    Another: "refactor" by renaming a tag across the zettelkasten.

    cf. felko/neuron-mode@beeb47f

  7. pinned this issue on Jul 3, 2020
  8. aca commented on Jul 30, 2020

    @aca
    Contributor

    @srid Are you working on this? or anyone?
    I'm interested.

  9. srid commented on Jul 30, 2020

    @srid
    Owner

    @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.

  10. aca commented on Aug 2, 2020

    @aca
    Contributor

    There will be an "official" neuron lsp implentation in haskell.
    Until then, you might want to try https://github.com/aca/neuron-language-server.

  11. sureyeaah commented on Aug 2, 2020

    @sureyeaah

    @aca I can help with the "official" neuron lsp!

  12. aca commented on Aug 2, 2020

    @aca
    Contributor

    @sureyeaah. You should join matrix and discuss about official neuron lsp.
    For now, I will just play,experiment with the go lsp..

  13. trevortknguyen commented on Aug 3, 2020

    @trevortknguyen

    I do not think I will be able to work on the "official" neuron lsp.

  14. hoschi commented on Aug 5, 2020

    @hoschi

    the call/caller graph features of LSP can also be utilized for viewing/navigating the z-index.

  15. added this to the 1.0 milestone on Aug 11, 2020
  16. srid commented on Sep 3, 2020

    @srid
    Owner

    An extension that displays neuron HTML preview to side would be pretty cool: https://twitter.com/owickstrom/status/1301241287727812610

  17. unpinned this issue on Sep 6, 2020
  18. srid commented on Sep 7, 2020

    @srid
    Owner
  19. removed this from the 1.0 milestone on Sep 12, 2020
  20. srid commented on Jan 24, 2021

    @srid
    Owner

    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.

    $ cat ~/.config/nvim/coc-settings.json 
    {
      "languageserver": {
        "neuron": {
          "command": "neuron",
          "args": ["lsp"],
          "filetypes": ["markdown"]
        }
      }
    }
    
  21. srid commented on Mar 12, 2021

    @srid
    Owner

    One tiny benefit of using LSP would be that renames on large notebooks would be faster (O(1)). cf. svsool/memo#286 (comment)

  22. srid commented on Apr 17, 2021

    @srid
    Owner
  23. samwalls commented on Apr 21, 2021

    @samwalls
    Contributor

    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

  24. srid commented on Apr 21, 2021

    @srid
    Owner

    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:

    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.

  25. mickael-menu commented on Apr 24, 2021

    @mickael-menu
    Contributor

    I've integrated an LSP server in zk, which is compatible with neuron. Just run zk init in 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)

    • Configure VSCode (this might require writing an extension in TypeScript?) to use neuron lsp

    That's right, you will need to create a VS Code extension for your LSP server. I've created one for zk that is pretty minimal, which should be easy to modify to start neuron lsp.

    One important bit is to configure the activationEvents. I chose to start my LSP client when a .zk folder is detected in the folder, you can probably do the same with neuron.dhall: https://github.com/mickael-menu/zk-vscode/blob/701cfd07db3529b039392067385fa81df594e74d/package.json#L14-L16

  26. Repository owner locked and limited conversation to collaborators on Aug 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions