Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Returning partial results #156

Open
kjeremy opened this issue Apr 23, 2020 · 2 comments
Open

Returning partial results #156

kjeremy opened this issue Apr 23, 2020 · 2 comments

Comments

@kjeremy
Copy link
Contributor

kjeremy commented Apr 23, 2020

While doing #155 I realized that only semantic tokens can handle a partial result in it's Request::Result. Would it make sense to add a new trait for requests that can return partial results instead of making every result an enum?

pub trait PartialRequest : Request {
    type PartialResult: DeserializeOwned + Serialize;
}
@Marwes
Copy link
Member

Marwes commented Apr 24, 2020

Can any request return a partial result? Not sure how this is supposed to work. Does it make sense to just provide a generic struct to be used if a partial result is accepted

pub struct Partial<T> {
    #[serde(flatten)]
    pub result: T,
    #[serde(flatten)]
    pub work_done_progress_params: WorkDoneProgressParams,
}

@kjeremy
Copy link
Contributor Author

kjeremy commented Apr 24, 2020

Not all requests can return partial results and some can report progress without returning partial results.

See https://microsoft.github.io/language-server-protocol/specifications/specification-3-15/#workDoneProgress and https://microsoft.github.io/language-server-protocol/specifications/specification-3-15/#partialResults

I do like the idea of making things generic though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants