microsoft / language-server-protocol

Defines a common protocol for language servers.
https://microsoft.github.io/language-server-protocol/
Creative Commons Attribution 4.0 International
11.29k stars 802 forks source link

Find references from a given selected file (in explorer) #2047

Open angelozerr opened 1 month ago

angelozerr commented 1 month ago

Today LSP specification support textDocument/references which works with symbol. It would be nice if LSP specification could provide a new LSP feature like file/references to find references from a file selected in the explorer.

Takes a sample with the HTML language server.

Given this HTML file:

<html>
    <link href="foo.css" />
</html>

It would be nice to open the contextual menu from the foo.css and have a Find File References menu

Image

to retrieve the index.html as find file references.

//cc @aeschli

angelozerr commented 1 month ago

I think there are a lot of language which could use this new file/references feature like:

//cc @fbricon @rgrunber @datho7561

dbaeumer commented 1 month ago

I like that idea. I will move it to the spec repository .

dbaeumer commented 1 month ago

There is a custom implementation for this in VS Code for TypeScript.

angelozerr commented 1 month ago

There is a custom implementation for this in VS Code for TypeScript.

Great! It is an another usecase. IMHO I think LSP should provide this feature.