-
Notifications
You must be signed in to change notification settings - Fork 30.6k
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
Provide encoding-related APIs for editor extensions (#824) #240804
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Overview
This pull request introduces encoding-related APIs for editor extensions to address issue #824. The updates propagate encoding options through API interfaces and internal document handling, with new tests verifying encoding behavior, and modifications to the underlying implementations in extHost and mainThread modules.
- Update TextDocument and workspace API interfaces to include an optional encoding parameter.
- Add new tests for encoding-related behaviors and error scenarios.
- Propagate encoding options in extHostDocuments, extHost.api.impl, mainThreadDocuments, and extHost.protocol.
Changes
File | Description |
---|---|
extensions/vscode-api-tests/src/singlefolder-tests/workspace.test.ts | Adds new tests and updates test names to validate encoding behavior in text document APIs |
src/vs/workbench/api/common/extHostDocuments.ts | Updates document retrieval and creation functions to accept and handle encoding options |
src/vs/workbench/api/common/extHost.api.impl.ts | Modifies openTextDocument to propagate encoding options when creating or opening documents |
src/vs/workbench/api/browser/mainThreadDocuments.ts | Refactors resource handling and untitled document creation to incorporate encoding support |
src/vs/workbench/api/common/extHost.protocol.ts | Updates protocol definitions to include the encoding parameter |
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
src/vs/workbench/api/common/extHost.api.impl.ts:1030
- [nitpick] Consider using a distinct variable name (e.g. documentOptions) when merging uriOrFileNameOrOptions with options to improve clarity between the URI and options object.
options = (options ?? uriOrFileNameOrOptions) as ({ language?: string; content?: string; encoding?: string } | undefined);
Tip: If you use Visual Studio Code, you can request a review from Copilot before you push from the "Source Control" tab. Learn more
for #824