Thanks to visit codestin.com
Credit goes to github.com

Skip to content

"First party" LSP written in C3 #2538

@giuliano-macedo

Description

@giuliano-macedo

I saw that in #1456 there is this bullet point:

High quality LSP

What is your opinion on implementing one in C3 by using the c3c lexer/parser, and adding to the c3c repo or another repo inside c3lang?

I'm asking this because one of the things I like about go is that gopls is maintained by the go team (thats what I call a "First party" LSP) and AFAIK it uses the same lexer/parser that that the go compiler uses, increasing its correctness.

I've never built an LSP myself, this is just my first thoughts about this, I would love to implement* like this if you think it is a good idea, but I am open to new ideas as well.

*: I can't promise though, it would be a lot of work I think.

I think it could start with these actions (that are the same that helix currently supports) because is a good subset of commonly used LSP actions:

  • must:
    • diagnostics → textDocument/publishDiagnostics (notification from server)
    • goto-definition → textDocument/definition
    • goto-declaration → textDocument/declaration
    • goto-type-definition → textDocument/typeDefinition
    • goto-reference → textDocument/references
    • goto-implementation → textDocument/implementation
    • format → textDocument/formatting
    • hover → textDocument/hover
    • textDocument/didChange for codecompletion/error reporting for each keystroke
  • nice to have:
    • document-symbols → textDocument/documentSymbol
    • workspace-symbols → workspace/symbol
    • rename-symbol → textDocument/rename
    • completion → textDocument/completion
    • signature-help → textDocument/signatureHelp
    • code-action → textDocument/codeAction
    • document-highlight → textDocument/documentHighlight
    • workspace-command → workspace/executeCommand
    • inlay-hints → textDocument/inlayHint

Metadata

Metadata

Assignees

No one assigned

    Labels

    ToolchainAffect peripheral parts of the compiler

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions