Skip to content

feature: InProcess LSP hook for editing prompts in the editor launched from OpenCode #238

@kunzaatko

Description

@kunzaatko

Did you check the docs?

  • I am using the latest plugin version
  • I read the plugin docs
  • I read the opencode docs

Is your feature request related to a problem? Please describe.

NOTE:
 I am not certain whether this is feasible under the current implementation and architecture of the plugin

It would be awesome if the LSP that is provided in this plugin within the snacks prompts would be available when a prompt is opened in an editor from OpenCode itself. I.e. when I have a longer prompt and would like to type it up in NeoVim, I use the OpenCode feature that opens the input in the editor. Would it be possible to hook into this process (as the plugin now hooks into the permissions request of OpenCode) to start the in-process LSP in the markdown file buffers that are created by OpenCode?

Describe the solution you'd like

The proposed workflow:
I launch the edit input in $EDITOR feature -> a new buffer is created in the NeoVim editor (for example file:///private/var/folders/yv/24zcyrzn0tsdg78xckk5mx0c0000gp/T/1776583186091.md) -> the buffer creation from the OpenCode buffer is detected (using an AutoCmd? How is this done for the permissions?) and the LSP with the session context is attached to the buffer so that I can @ + <TAB> to get the current files and the agents etc.

Describe alternatives you've considered

I considered writing the autocommand myself using the API of this plugin but I believe that this feature may be useful for all users.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions