-
Notifications
You must be signed in to change notification settings - Fork 184
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
Go to definition
support for external files
#2128
Comments
As far as opening images, this seems like something that could be treated as a bug if it works like in the screenshot where we open the image but still show an error. As far as other URI schemes than For example LSP-Deno implements support for |
Understood. But wouldn't |
I think that opening https links on "go to definition" would be abuse of that functionality. The intention is to go to the definition of the symbol within the editor rather than opening an external link. Apart from that, can it really be argued that an URI in a markdown link is the definition of that link? I have some doubts. If you want you could discuss this idea at https://github.com/microsoft/language-server-protocol/issues but personally I don't think that's a correct way to go. For highlighting and opening external links there is a separate LSP functionality |
The URI is not the definition, but the element that contains the definition. A definition is a pair of
Thanks for that, I'll consider it. I'm just worried that this is too complicated for users (UX wise). I just want to jump to the definition of a link (the document, header, or remote URL). I don't want to invoke a separate keystroke to jump to a remote URL. |
Follow up to #2128 (comment): Document links at work: Unfortunately these are not the desired thing for an LSP: I'm used to resolution of file-based "definitions" via the respective shortcut, i.e. in JS LSPs. I want the same for markdown files. |
I'm not sure, maybe it makes sense to support https: natively... It doesn't seem fully right though because: |
On a thing the editor can clearly open (the context menu says "Open XYZ"), why shouldn't the language server reference it (and request to open) if it regards it as a "definition" to jump to? For me as a user this makes total sense. Your call as a maintainer if you want to support it. If you'd accept a contribution to add this functionality, please give me a heads-up. Otherwise please close this issue as won't fix. |
Ideally I would like to know an opinion of the LSP spec maintainer and it would also nice to know how VSCode behaves here. Did you by any chance test your server in it? |
Will check in VSCode 👍 |
I would say it's pretty clear that opening the links from your Markdown example should be realized via If you want to use F12 / the same keybinding as for "Goto Definition" for the Line 381 in 472187b
|
@jwortmann Yes these are links, but speaking from the users perspective in my LSP these are also URIs to documents that define a resource. I don't want to click it, but I want to jump to the definition of that resource, may it be internal (can be opened by editor) or external. Conversely I can ask for references to these definitions, too, as I would expect in a markdown LSP. Links also add additional markup, which I do not intend to do. Cf. also #2128 (comment). |
and afaik the term "location" in the LSP specs usually means some place within a document, but not a document, other file, or remote URL itself. I would not say that a file or remote URL can be considered as the "definition" of a link. Maybe we could argue about something like Another example I can give from another server (Julia language server) is include("path/to/file.jl") which uses Anyways, the result of the
I was advocating to hide the link underlining by default in #1974 (comment), but it was overruled by the other contributors. |
Is your feature request related to a problem? Please describe.
I'm implementing
markmark
, a language server for markdown at the moment.That language server shall allow me to
Go to definition
on any link, including external resources, i.e. images, but also HTTP(S) URLs. What I'm doing to accomplish this LSP server wise is returning the external (image or remote resource) URI with the expectation that it is being opened by sublime text. That works partially:Unable to open URI
error messasge popsDescribe the solution you'd like
I'm able to open remote URIs and local (non text resources).
Open XYZ
featureOpen XYZ
featureDescribe alternatives you've considered
From the practical point of view I could limit my LSP to only return matches for text files; I could alternatively send explicit "open file" requests (not sure if that is possible?).
However that defeats the purpose of
Go to definition
: The ideas is that I can use it everywhere, without special context.Additional context
Screen capture of current usage within sublime LSP:
The text was updated successfully, but these errors were encountered: