Skip to content

Fix incorrect typings in OpenJsDocLinkCommand_Args#209872

Merged
mjbvz merged 1 commit intomicrosoft:mainfrom
pisv:open-jsdoc-link
Apr 8, 2024
Merged

Fix incorrect typings in OpenJsDocLinkCommand_Args#209872
mjbvz merged 1 commit intomicrosoft:mainfrom
pisv:open-jsdoc-link

Conversation

@pisv
Copy link
Contributor

@pisv pisv commented Apr 8, 2024

Fixes an issue in openJsDocLink command due to incorrect typings in OpenJsDocLinkCommand_Args.

The openJsDocLink command currently declares the type of its args parameter as

{
        readonly file: vscode.Uri;
        readonly position: vscode.Position;
}

However, the type of the actual argument given to the command is

{
        readonly file: UriComponents;
        readonly position: { line: number; character: number; };
}

As a consequence, while the command does convert args.file to vscode.Uri via vscode.Uri.from(args.file), it misses converting args.position to vscode.Position. This works by accident in VS Code, but causes an issue in Eclipse Theia (eclipse-theia/theia#13568).

This PR fixes the typings in OpenJsDocLinkCommand_Args and adds the necessary conversion for args.position.

@mjbvz mjbvz added this to the April 2024 milestone Apr 8, 2024
@mjbvz mjbvz enabled auto-merge (squash) April 8, 2024 20:06
@mjbvz mjbvz assigned mjbvz and unassigned roblourens Apr 8, 2024
@mjbvz mjbvz merged commit 5bde174 into microsoft:main Apr 8, 2024
@pisv pisv deleted the open-jsdoc-link branch April 9, 2024 09:36
@pisv
Copy link
Contributor Author

pisv commented Apr 9, 2024

Thank you very much for so prompt review and merging -- really great contributing experience! 👍

@microsoft microsoft locked and limited conversation to collaborators Jun 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants