smithy-language-server
smithy-language-server copied to clipboard
Go-to-definition broken on error shapes in operations with inline I/O
To reproduce:
- Create a file,
a.smithy:
$version: "2"
namespace test
operation HelloWorld {
input := {}
errors: [TestErr]
}
@error("client")
structure TestErr {}
- Go to
errors: [Test<cursor>Err] - Trigger "go to definition"
- See "No references found for 'TestErr'" (in vscode)
LSP request/response:
[Trace - 15:28:27] Sending request 'textDocument/definition - (237)'.
Params: {
"textDocument": {
"uri": "file:///Users/kubukoz/projects/demos/a.smithy"
},
"position": {
"line": 6,
"character": 17
}
}
[Trace - 15:28:27] Received response 'textDocument/definition - (237)' in 3ms.
Result: [
{
"uri": "file:/Users/kubukoz/projects/demos/a.smithy",
"range": {
"start": {
"line": 5,
"character": 13
},
"end": {
"line": 6,
"character": 21
}
}
}
]
The response is present, but incorrect: the range [5, 13] - [6, 21] (0-indexed) translates to this text:
{}
errors: [TestErr]
and interestingly, vscode decides to ignore that rather than navigate to the incorrect range.
Guess who just tried to report it again 😅
This is fixed by #146
Indeed!