Skip to content
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

Consider adding a threadId to the CommentThread API #130107

Closed
alexr00 opened this issue Aug 4, 2021 · 4 comments
Closed

Consider adding a threadId to the CommentThread API #130107

alexr00 opened this issue Aug 4, 2021 · 4 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug comments Comments Provider/Widget/Panel issues verified Verification succeeded
Milestone

Comments

@alexr00
Copy link
Member

alexr00 commented Aug 4, 2021

Currently, there is no official way through the VS Code API to provide an ID for a comment thread, but it seems like an ID would be the best solution to the following problem:

Let's say I create a comment thread, then add a command to the menu comments/commentThread/context. When this command is executed, my command handler will get a CommentReply as an argument. Now, I would like to do something based on this CommentThread in this CommentReply, but I have no way to correlate that CommentThread back to something that my extension knows how to handle. I could make some hash based on the properties and keep a map of CommentThread to MyCommentThread, but it would make more sense to have a commentThreadId instead.

You could say that I should look at the first Comment in the comments array and use that ID, but it is possible to have a CommentThread without any comments so I don't think that's a good solution.

I'd be happy to be told there's something I'm missing here and that there's a good way to do what I'm looking for instead :)

@rebornix
Copy link
Member

rebornix commented Aug 4, 2021

@alexr00 I think it makes sense to introduce id for the CommentThread. The CommentThread is an object managed by VS Code so we can generate a GUID as id. Feel free to bring this up in API sync and PR is welcome :)

@rebornix rebornix added api-proposal comments Comments Provider/Widget/Panel issues labels Aug 4, 2021
@rebornix
Copy link
Member

rebornix commented Aug 4, 2021

Assigning to you as well since I might not have time for it this month so feel free to drive this if it's blocking GHPRI.

@alexr00
Copy link
Member Author

alexr00 commented Aug 5, 2021

GHPRI uses a hack to work around this for now, but it's not supported API. I will see if I have time for it.

@rebornix rebornix added the feature-request Request for new features or functionality label Oct 11, 2021
@alexr00 alexr00 added this to the March 2022 milestone Feb 24, 2022
alexr00 added a commit that referenced this issue Mar 9, 2022
alexr00 added a commit that referenced this issue Mar 10, 2022
@alexr00 alexr00 added bug Issue identified by VS Code Team member as probable bug and removed feature-request Request for new features or functionality api-proposal labels Mar 11, 2022
@alexr00
Copy link
Member Author

alexr00 commented Mar 11, 2022

The API is not needed now that we use the same object.

@alexr00 alexr00 closed this as completed Mar 11, 2022
@mjbvz mjbvz added the verified Verification succeeded label Mar 24, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Apr 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug comments Comments Provider/Widget/Panel issues verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

3 participants