Skip to content

feature: in-process LSP to interact with opencode #179

@nickjvandyke

Description

@nickjvandyke

Opening the floor to ideas for an in-process LSP that interacts with opencode 😁

Validity

Pros

  • Primary goal of this plugin is supplementing editor-first workflows, and LSPs are essentially first-class citizens in editors
  • Familiar UX
  • ?

Cons

  • Slight departure from opencode-TUI-only experience; bit scattered
  • LSPs are generally deterministic and reliable; LLMs, not as much
  • ?

Handlers

  • Code actions
    • Ask opencode to fix the diagnostic under the cursor
    • ?
  • Hover
    • Ask opencode to explain the symbol under the cursor
      • I say "symbol" but really it works for anything, like literals
  • Code lens/inlay hints
    • Some kind of useful contextual info?
  • Completion
    • Inline
      • Not sure how much this adds over e.g. copilot.lua. opencode can probably gather more context for a better suggestion, but is that worth the speed tradeoff?
  • ?

Describe alternatives you've considered

Manually prompting opencode with whatever the LSP handlers would do. Possibly via non-LSP keymaps.

Additional context

Presumably some ideas in https://github.com/SilasMarvin/lsp-ai, but I think we could do better with nvim and opencode specificity.


Please offer ideas and feedback!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestquestionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions