godotengine / godotengine/godot-vscode-plugin
Resources linked with "uid://" scheme does not correctly link to the correct files.
- Dominant language
- TypeScript
- Stars
- 2.1k
- Forks
- 257
- PR merge metrics
- No merged PRs in 30d
Description
### Godot version
v4.4.1.stable.official [49a5bc7b6]
### VS Code version
1.98.2
### Godot Tools VS Code extension version
2.5.1
### System information
Windows 11
### Issue description
Currently, Godot's LSP does not return the correct file path for `uid://` resource scheme when the `textDocument/documentLink` command is called.
This results in the following error when trying to follow a reference to a `uid://` resource.

This also means that the hover preview does not work for `uid://` preloads.
**Working**

**Not Working**

To fix this, i have created a fork with a proof of concept fix. This currently only works for GDScripts resource type since they have an easily distinguishable accompanying `*.uid` file, linked below:
[https://github.com/godotengine/godot-vscode-plugin/compare/master...anthonyme00:godot-vscode-plugin:uid_script_shortcut?expand=1](https://github.com/godotengine/godot-vscode-plugin/compare/master...anthonyme00:godot-vscode-plugin:uid_script_shortcut?expand=1)
With the changes on this fork, hovers over `uid://` strings on supported files works as expected (only for GDScript resources). `ctrl+click`ing `uid://` strings also now works as expected.

This fix works by overriding the return from `textDocument/documentLink` calls and stripping target links that starts with `uid://`, and instead relying on the internal `DocumentLinkProvider` implementation instead.
### Steps to reproduce
1. Open any project that contains `uid://` resource references
2. Hover or attempt `ctrl+click` on those resources
3. Be greeted with the following error message:

Contributor guide
Assessment
This issue has not been assessed yet.