mirror of
https://github.com/danog/code-server.git
synced 2024-11-30 04:39:46 +01:00
2bfe15b3e9
* Update upstream Code to 1.70 * Update CSP hashes * Update comment on remote authority Also remove it from script-src since it is invalid anyway. * Use absolute path for disable download patch Just to keep it consistent with the other imports. We initially added the patch like this so it was not part of the upgrade but might as well fix it now. * Fix inability to change language while code-server is running Co-authored-by: Asher <ash@coder.com>
37 lines
2.1 KiB
Diff
37 lines
2.1 KiB
Diff
Unconditionally enable the proposed API
|
|
|
|
To test run an extension that uses the proposed API.
|
|
|
|
We also override isProposedApiEnabled in case an extension does not declare the
|
|
APIs it needs correctly (the Jupyter extension had this issue).
|
|
|
|
Index: code-server/lib/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.ts
|
|
===================================================================
|
|
--- code-server.orig/lib/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.ts
|
|
+++ code-server/lib/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.ts
|
|
@@ -1460,7 +1460,7 @@ class ProposedApiController {
|
|
|
|
this._envEnabledExtensions = new Set((_environmentService.extensionEnabledProposedApi ?? []).map(id => ExtensionIdentifier.toKey(id)));
|
|
|
|
- this._envEnablesProposedApiForAll =
|
|
+ this._envEnablesProposedApiForAll = true ||
|
|
!_environmentService.isBuilt || // always allow proposed API when running out of sources
|
|
(_environmentService.isExtensionDevelopment && productService.quality !== 'stable') || // do not allow proposed API against stable builds when developing an extension
|
|
(this._envEnabledExtensions.size === 0 && Array.isArray(_environmentService.extensionEnabledProposedApi)); // always allow proposed API if --enable-proposed-api is provided without extension ID
|
|
Index: code-server/lib/vscode/src/vs/workbench/services/extensions/common/extensions.ts
|
|
===================================================================
|
|
--- code-server.orig/lib/vscode/src/vs/workbench/services/extensions/common/extensions.ts
|
|
+++ code-server/lib/vscode/src/vs/workbench/services/extensions/common/extensions.ts
|
|
@@ -359,10 +359,7 @@ function extensionDescriptionArrayToMap(
|
|
}
|
|
|
|
export function isProposedApiEnabled(extension: IExtensionDescription, proposal: ApiProposalName): boolean {
|
|
- if (!extension.enabledApiProposals) {
|
|
- return false;
|
|
- }
|
|
- return extension.enabledApiProposals.includes(proposal);
|
|
+ return true
|
|
}
|
|
|
|
export function checkProposedApiEnabled(extension: IExtensionDescription, proposal: ApiProposalName): void {
|