microsoft / microsoft/language-server-protocol

get documentation for arbitrary identifier.

Open
#1,034 1 comment 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature-request symbol documentation
Dominant language
TypeScript
Stars
13k
Forks
1k
Avg merge
6d 1h
Merged PRs (30d)
10

Description

This issue is a mix of #634 and #1033. What I'd like is to be able to pinpoint some type in the current workspace, and then get the documentation for it. Preventing me from having to google type information that the language server should already have.

See also eglot#507

For example:

use std::fs::File;

fn main() {
    let f = File::open("hello.txt");
    println!("{:?}", f);
}

The return type of File::open is an std::io::Result instance. the language-server can tell me this on :textDocument/hover. I'd like to look up the documentation for this return type but there's doesn't seem to be a standalone request for that. If I try to hover on the identifier f then I just get f: Result<File, Error> which makes sense, the variable could have its own documentation distinct from its type. I've been getting around this by explicitly entering the type name and then getting the information from :textDocument/hover on std::io::Result<File>, so I change the above to this:

let f: std::io::Result<File> = File::open("hello.txt");

and then promptly delete the explicit type declaration because it's not necessary. I think this is too much ceremony for a relatively simple ask. The server has the information I want, I should just be able to ask for it without all this hassle.

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 with the :textDocument/hover examples in this issue and compare the related eglot#507 discussion. Define how a standalone request would identify an arbitrary type or identifier and return its documentation, including the Rust std::io::Result example; done means the protocol specifies this request clearly.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, typescript
Domain
api, developer-experience, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.