lapce / lapce/lapce-plugin-rust

Function to respond to a request from the client editor

Open
#10 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
31
Forks
12
PR merge metrics
No merged PRs in 30d

Description

Currently, one can respond to a request (received in handle_request) by using object_to_stdout, but that is a poor API. Here's my idea of the function definition for responding:

/// `T` is the type of the request you're responding to
fn send_response<T: Request>(id: u64, params: T::Result);

So, knowing the request type (which they can presumably do), it enforces that the resulting type you send back is correct.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating handle_request and object_to_stdout in the plugin API. Assess how a typed send_response<T: Request> could replace the current response path, then verify that the response parameter type is enforced according to T::Result and that client requests can receive the response by id.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.