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

support getting various document ranges from InteractiveSessionProviders #193656

Merged
merged 8 commits into from
Sep 23, 2023

Conversation

ulugbekna
Copy link
Contributor

@ulugbekna ulugbekna commented Sep 21, 2023

In this PR, we add support for getting various documents ranges from InteractiveSessionProviders as part of provideResponseWithProgress. This allows passing that information to mapped-edit providers (aka code mappers).

We also update the API of mappedEditsProvider's.

Support for persisting document ranges across vscode sessions will happen in another PR, if that's okay with @jrieken and @roblourens

@ulugbekna ulugbekna self-assigned this Sep 21, 2023
@vscodenpa vscodenpa added this to the September 2023 milestone Sep 21, 2023
* create a separate type to represent a response part
* rename existing `ResponsePart` to `InternalResponsePart`
* fix? handle if response part's resolved value is a markdown string, which is allowed in the `IResponse` interface
@ulugbekna ulugbekna force-pushed the ulugbekna/implement-code-mappers-context branch from b2ff67c to a25b86c Compare September 21, 2023 17:11
@ulugbekna ulugbekna force-pushed the ulugbekna/implement-code-mappers-context branch from a25b86c to 63080ad Compare September 21, 2023 17:12
@ulugbekna ulugbekna changed the title mapped edits: can get doc ranges & version from InteractiveSessionProvider on provideResponseWithProgress & update MappedEdits proposed API to take context of array of arrays of documents support getting various document ranges from InteractiveSessionProviders Sep 21, 2023
@@ -138,7 +138,22 @@ declare module 'vscode' {
treeData: FileTreeData;
}

export type InteractiveProgress = InteractiveProgressContent | InteractiveProgressId | InteractiveProgressTask | InteractiveProgressFileTree;
export interface DocumentContext {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this work if there are multiple codeblocks? Does the context need to be associated with one of the codeblocks somehow?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We intend for this context to be associated with all codeblocks that occur a single reply for now. We can try associating a code block in the reply with ranges in documents but it's farther in the future.

@@ -162,6 +186,8 @@ export class Response implements IResponse {
} else if (isCompleteInteractiveProgressTreeData(responsePart)) {
this._responseParts.push(responsePart);
this._updateRepr(quiet);
} else if ('documents' in responsePart) {
this._usedContext = responsePart;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The API would imply that it's valid to send multiple UsedContext pieces

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This occurred to me as well. I think it makes sense in future to aggregate all IUsedContext progress reports. What do you think?

@ulugbekna
Copy link
Contributor Author

There are some integration tests related to mapped edits failing, I'll soon fix them

@ulugbekna ulugbekna merged commit 61a18c2 into main Sep 23, 2023
6 checks passed
@ulugbekna ulugbekna deleted the ulugbekna/implement-code-mappers-context branch September 23, 2023 12:38
yiliang114 pushed a commit to yiliang114/vscode that referenced this pull request Sep 25, 2023
…t-code-mappers-context

support getting various document ranges from InteractiveSessionProviders
yiliang114 pushed a commit to yiliang114/vscode that referenced this pull request Sep 26, 2023
…t-code-mappers-context

support getting various document ranges from InteractiveSessionProviders
yiliang114 pushed a commit to yiliang114/vscode that referenced this pull request Sep 30, 2023
…t-code-mappers-context

support getting various document ranges from InteractiveSessionProviders
yiliang114 pushed a commit to yiliang114/vscode that referenced this pull request Oct 9, 2023
…t-code-mappers-context

support getting various document ranges from InteractiveSessionProviders
@github-actions github-actions bot locked and limited conversation to collaborators Nov 7, 2023
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