-
Notifications
You must be signed in to change notification settings - Fork 41
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
[ST4] Opening URIs #3989
Comments
Preferred solution continuedIf the scheme of the URI is not async def on_query_uri(
self,
window: sublime.Window,
uri: str
) -> Optional[Tuple[str, str, Optional[str]]]:
... If you define this method in a plugin, then you must return a tuple of three elements:
If you don't know how to handle the provided URI then you must return This would allow plugins to extend the behavior of opening URIs for custom schemes. For instance, the Deno language server uses a |
Of course I didn't think of this myself. VSCode already has this mechanism. |
I'm learning this idea has consequences for various other features:
Nevertheless I still think this would be a nice feature to have as a basis for, for instance, remote SSH file viewing, or translating paths for inspecting files in a docker container. |
Another use case is resolving URIs with a |
Problem description
Development is moving more and more towards web-based tooling. Sublime is lacking in this area.
view.uri()
#3742Preferred solution
A new async method for the
sublime.Window
class:It should have the following behavior:
file
orres
, delegates to Make Window.open_file asynchronous #3172.http
orhttps
, downloads the file asynchronously, puts the content into a scratch buffer. Theview.uri()
should return theuri
passed inopen_uri
.buffer
, find an existing view with that buffer ID.The return type should be an
Optional[View]
if the URI can be represented as a single file. It may beNone
because it might have been closed/cancelled by the user while opening it.Alternatives
N/A
Additional Information (optional)
sublimelsp/LSP#1605
The Deno language server has the "goto definition" capability. When the user wants to jump to the definition of a module that is not in the workspace, it will report back a resource on the web. The editor is expected to open that web resource.
EDIT: Contrary to what you might expect, Deno doesn't use http:// schemes but rather deno:// schemes (see below).
The text was updated successfully, but these errors were encountered: