What happened?
The VS Code companion webview openFile handler parses paths like src/app.ts:123:45 and converts the line/column to VS Code zero-based positions by subtracting 1.
That means inputs such as src/app.ts:0 or src/app.ts:1:0 produce negative vscode.Position values (-1 or -1 column). In the real VS Code API this can make the open-file request fail instead of opening the document.
Expected behavior
Zero line/column values from a webview open request should not produce negative editor positions. The handler should normalize them to the start of the file/line or otherwise ignore the invalid location while still opening the file.
Notes
Relevant code:
packages/vscode-ide-companion/src/webview/handlers/FileMessageHandler.ts
packages/vscode-ide-companion/src/webview/handlers/FileMessageHandler.test.ts
What happened?
The VS Code companion webview
openFilehandler parses paths likesrc/app.ts:123:45and converts the line/column to VS Code zero-based positions by subtracting 1.That means inputs such as
src/app.ts:0orsrc/app.ts:1:0produce negativevscode.Positionvalues (-1or-1column). In the real VS Code API this can make the open-file request fail instead of opening the document.Expected behavior
Zero line/column values from a webview open request should not produce negative editor positions. The handler should normalize them to the start of the file/line or otherwise ignore the invalid location while still opening the file.
Notes
Relevant code:
packages/vscode-ide-companion/src/webview/handlers/FileMessageHandler.tspackages/vscode-ide-companion/src/webview/handlers/FileMessageHandler.test.ts