Skip to content

support getting various document ranges from InteractiveSessionProviders - #193656

Merged
Ulugbek Abdullaev (ulugbekna) merged 8 commits into
mainfrom
ulugbekna/implement-code-mappers-context
Sep 23, 2023
Merged

Ulugbek Abdullaev (ulugbekna) merged 8 commits into
mainfrom
ulugbekna/implement-code-mappers-context

Conversation

@ulugbekna

@ulugbekna Ulugbek Abdullaev (ulugbekna) commented Sep 21, 2023 •

Copy link
Copy Markdown
Contributor

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 Johannes Rieken (@jrieken) and roblourens

* 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
Ulugbek Abdullaev (ulugbekna) force-pushed the ulugbekna/implement-code-mappers-context branch from b2ff67c to a25b86c Compare September 21, 2023 17:11
@ulugbekna
Ulugbek Abdullaev (ulugbekna) force-pushed the ulugbekna/implement-code-mappers-context branch from a25b86c to 63080ad Compare September 21, 2023 17:12
@ulugbekna Ulugbek Abdullaev (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
}

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

Copy link
Copy Markdown
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
Copy Markdown
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.

this._responseParts.push(responsePart);
this._updateRepr(quiet);
} else if ('documents' in responsePart) {
this._usedContext = responsePart;

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor Author

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

@ulugbekna
Ulugbek Abdullaev (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