Skip to content

Commit

Permalink
update ext manifest schema validation and built-in exts
Browse files Browse the repository at this point in the history
  • Loading branch information
sbatten committed Apr 21, 2021
1 parent 301d4e9 commit f9fc28d
Show file tree
Hide file tree
Showing 25 changed files with 145 additions and 58 deletions.
6 changes: 4 additions & 2 deletions extensions/configuration-editing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@
"jsonc-parser": "^2.2.1",
"vscode-nls": "^4.1.1"
},
"workspaceTrust": {
"request": "never"
"capabilities": {
"untrustedWorkspaces": {
"supported": true
}
},
"contributes": {
"languages": [
Expand Down
6 changes: 5 additions & 1 deletion extensions/css-language-features/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
"main": "./client/out/node/cssClientMain",
"browser": "./client/dist/browser/cssClientMain",
"enableProposedApi": true,
"workspaceTrust": { "request": "never" },
"capabilities": {
"untrustedWorkspaces": {
"supported": true
}
},
"scripts": {
"compile": "gulp compile-extension:css-language-features-client compile-extension:css-language-features-server",
"watch": "gulp watch-extension:css-language-features-client watch-extension:css-language-features-server",
Expand Down
6 changes: 4 additions & 2 deletions extensions/debug-auto-launch/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
"vscode": "^1.5.0"
},
"icon": "media/icon.png",
"workspaceTrust": {
"request": "never"
"capabilities": {
"untrustedWorkspaces": {
"supported": true
}
},
"activationEvents": [
"*"
Expand Down
6 changes: 4 additions & 2 deletions extensions/debug-server-ready/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@
"activationEvents": [
"onDebugResolve"
],
"workspaceTrust": {
"request": "never"
"capabilities": {
"untrustedWorkspaces": {
"supported": true
}
},
"enableProposedApi": true,
"main": "./out/extension",
Expand Down
8 changes: 5 additions & 3 deletions extensions/emmet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,9 @@
"vscode-emmet-helper": "^2.3.0",
"vscode-languageserver-textdocument": "^1.0.1"
},
"workspaceTrust": {
"request": "never"
}
"capabilities": {
"untrustedWorkspaces": {
"supported": true
}
},
}
6 changes: 5 additions & 1 deletion extensions/extension-editing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@
],
"main": "./out/extensionEditingMain",
"browser": "./dist/browser/extensionEditingBrowserMain",
"workspaceTrust": { "request": "never" },
"capabilities": {
"untrustedWorkspaces": {
"supported": true
}
},
"scripts": {
"compile": "gulp compile-extension:extension-editing",
"watch": "gulp watch-extension:extension-editing"
Expand Down
8 changes: 5 additions & 3 deletions extensions/git/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@
"update-grammar": "node ./build/update-grammars.js",
"test": "node ../../node_modules/mocha/bin/mocha"
},
"workspaceTrust": {
"request": "never"
},
"capabilities": {
"untrustedWorkspaces": {
"supported": true
}
},
"contributes": {
"commands": [
{
Expand Down
6 changes: 5 additions & 1 deletion extensions/github-authentication/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@
"activationEvents": [
"onAuthenticationRequest:github"
],
"workspaceTrust": { "request": "never" },
"capabilities": {
"untrustedWorkspaces": {
"supported": true
}
},
"contributes": {
"commands": [
{
Expand Down
6 changes: 4 additions & 2 deletions extensions/github/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@
"vscode.git"
],
"main": "./out/extension.js",
"workspaceTrust": {
"request": "never"
"capabilities": {
"untrustedWorkspaces": {
"supported": true
}
},
"contributes": {
"commands": [
Expand Down
7 changes: 4 additions & 3 deletions extensions/grunt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@
"activationEvents": [
"onCommand:workbench.action.tasks.runTask"
],
"workspaceTrust": {
"request": "never",
"description": "This extension only provides tasks. Trust is already required by the tasks system before any task providers are called."
"capabilities": {
"untrustedWorkspaces": {
"supported": true
}
},
"contributes": {
"configuration": {
Expand Down
7 changes: 4 additions & 3 deletions extensions/gulp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@
"activationEvents": [
"onCommand:workbench.action.tasks.runTask"
],
"workspaceTrust": {
"request": "never",
"description": "This extension only provides tasks. Trust is already required by the tasks system before any task providers are called."
"capabilities": {
"untrustedWorkspaces": {
"supported": true
}
},
"contributes": {
"configuration": {
Expand Down
6 changes: 5 additions & 1 deletion extensions/html-language-features/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@
],
"main": "./client/out/node/htmlClientMain",
"browser": "./client/dist/browser/htmlClientMain",
"workspaceTrust": { "request": "never" },
"capabilities": {
"untrustedWorkspaces": {
"supported": true
}
},
"scripts": {
"compile": "npx gulp compile-extension:html-language-features-client compile-extension:html-language-features-server",
"watch": "npx gulp watch-extension:html-language-features-client watch-extension:html-language-features-server",
Expand Down
6 changes: 4 additions & 2 deletions extensions/image-preview/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@
"onCommand:imagePreview.zoomIn",
"onCommand:imagePreview.zoomOut"
],
"workspaceTrust": {
"request": "never"
"capabilities": {
"untrustedWorkspaces": {
"supported": true
}
},
"contributes": {
"customEditors": [
Expand Down
7 changes: 4 additions & 3 deletions extensions/jake/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@
"activationEvents": [
"onCommand:workbench.action.tasks.runTask"
],
"workspaceTrust": {
"request": "never",
"description": "This extension only provides tasks. Trust is already required by the tasks system before any task providers are called."
"capabilities": {
"untrustedWorkspaces": {
"supported": true
}
},
"contributes": {
"configuration": {
Expand Down
6 changes: 5 additions & 1 deletion extensions/json-language-features/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@
"main": "./client/out/node/jsonClientMain",
"browser": "./client/dist/browser/jsonClientMain",
"enableProposedApi": true,
"workspaceTrust": { "request": "never" },
"capabilities": {
"untrustedWorkspaces": {
"supported": true
}
},
"scripts": {
"compile": "gulp compile-extension:json-language-features-client compile-extension:json-language-features-server",
"watch": "gulp watch-extension:json-language-features-client watch-extension:json-language-features-server",
Expand Down
14 changes: 8 additions & 6 deletions extensions/markdown-language-features/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,14 @@
"onWebviewPanel:markdown.preview",
"onCustomEditor:vscode.markdown.preview.editor"
],
"workspaceTrust": {
"request": "onDemand",
"description": "%workspaceTrust%",
"requiredForConfigurations": [
"markdown.styles"
]
"capabilities": {
"untrustedWorkspaces": {
"supported": "limited",
"description": "%workspaceTrust%",
"restrictedConfigurations": [
"markdown.styles"
]
}
},
"contributes": {
"notebookMarkdownRenderer": [
Expand Down
6 changes: 4 additions & 2 deletions extensions/merge-conflict/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@
"categories": [
"Other"
],
"workspaceTrust": {
"request": "never"
"capabilities": {
"untrustedWorkspaces": {
"supported": true
}
},
"activationEvents": [
"onStartupFinished"
Expand Down
6 changes: 5 additions & 1 deletion extensions/microsoft-authentication/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@
"activationEvents": [
"onAuthenticationRequest:microsoft"
],
"workspaceTrust": { "request": "never" },
"capabilities": {
"untrustedWorkspaces": {
"supported": true
}
},
"extensionKind": [
"ui",
"workspace",
Expand Down
8 changes: 5 additions & 3 deletions extensions/npm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,11 @@
"workspaceContains:package.json",
"onView:npm"
],
"workspaceTrust": {
"request": "onDemand",
"description": "This extension calls the `tasks.executeTask()` API, which requires trust to run."
"capabilities": {
"untrustedWorkspaces": {
"supported": "limited",
"description": "This extension calls the `tasks.executeTask()` API, which requires trust to run."
}
},
"contributes": {
"languages": [
Expand Down
8 changes: 5 additions & 3 deletions extensions/php-language-features/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@
"categories": [
"Programming Languages"
],
"workspaceTrust": {
"request": "onDemand",
"description": "The extension requires workspace trust when the `php.validate.executablePath` setting will load a version of PHP in the workspace."
"capabilities": {
"untrustedWorkspaces": {
"supported": "limited",
"description": "The extension requires workspace trust when the `php.validate.executablePath` setting will load a version of PHP in the workspace."
}
},
"contributes": {
"configuration": {
Expand Down
6 changes: 5 additions & 1 deletion extensions/search-result/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@
"generate-grammar": "node ./syntaxes/generateTMLanguage.js",
"vscode:prepublish": "node ../../node_modules/gulp/bin/gulp.js --gulpfile ../../build/gulpfile.extensions.js compile-extension:search-result ./tsconfig.json"
},
"workspaceTrust": { "request": "never" },
"capabilities": {
"untrustedWorkspaces": {
"supported": true
}
},
"contributes": {
"configurationDefaults": {
"[search-result]": {
Expand Down
6 changes: 4 additions & 2 deletions extensions/simple-browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@
"onOpenExternalUri:http",
"onOpenExternalUri:https"
],
"workspaceTrust": {
"request": "never"
"capabilities": {
"untrustedWorkspaces": {
"supported": true
}
},
"contributes": {
"commands": [
Expand Down
6 changes: 4 additions & 2 deletions extensions/testing-editor-contributions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@
"dependencies": {
"vscode-nls": "^5.0.0"
},
"workspaceTrust": {
"request": "never"
"capabilities": {
"untrustedWorkspaces": {
"supported": true
}
},
"scripts": {
"vscode:prepublish": "node ../../node_modules/gulp/bin/gulp.js --gulpfile ../../build/gulpfile.extensions.js compile-extension:testing-editor-contributions ./tsconfig.json"
Expand Down
18 changes: 10 additions & 8 deletions extensions/typescript-language-features/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,16 @@
"license": "MIT",
"aiKey": "AIF-d9b70cd4-b9f9-4d70-929b-a071c400b217",
"enableProposedApi": true,
"workspaceTrust": {
"request": "onDemand",
"description": "%workspaceTrust%",
"requiredForConfigurations": [
"typescript.tsdk",
"typescript.tsserver.pluginPaths",
"typescript.npm"
]
"capabilities": {
"untrustedWorkspaces": {
"supported": "limited",
"description": "%workspaceTrust%",
"restrictedConfigurations": [
"typescript.tsdk",
"typescript.tsserver.pluginPaths",
"typescript.npm"
]
}
},
"engines": {
"vscode": "^1.30.0"
Expand Down
28 changes: 28 additions & 0 deletions src/vs/workbench/services/extensions/common/extensionsRegistry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,34 @@ export const schema: IJSONSchema = {
}
]
},
capabilities: {
description: nls.localize('vscode.extension.capabilities', 'Declare set of supported scenarios by the extension'),
type: 'object',
properties: {
untrustedWorkspaces: {
description: nls.localize('vscode.extension.capabilities.untrustedWorkspaces', 'Declares how the extension should be handled in untrusted workspaces.'),
type: 'object',
properties: {
supported: {
description: nls.localize('vscode.extension.capabilities.untrustedWorkspaces.supported', "Declares the level of support for untrusted workspaces by the extension. `false` indicates the extension will be disabled in untrusted workspaces. `'limited'` indicates the extension will be enabled with some functionality removed."),
type: ['string', 'boolean'],
enum: ['limited', true, false]
},
restrictedConfigurations: {
description: nls.localize('vscode.extension.capabilities.untrustedWorkspaces.restrictedConfigurations', "A list of configuration keys contributed by the extension that should not use workspace values in untrusted workspaces."),
type: 'array',
items: {
type: 'string'
}
},
description: {
type: 'string',
description: nls.localize('vscode.extension.capabilities.untrustedWorkspaces.description', "A description of how workspace trust affects the extensions behavior and why it is needed. This only applies when `supported` is not `true`."),
}
}
}
}
},
supportsVirtualWorkspace: {
description: nls.localize('supportsVirtualWorkspace', "When disabled the extension is not enabled in the workspace that has all folders using custom scheme. Default is `true`."),
type: 'boolean',
Expand Down

0 comments on commit f9fc28d

Please sign in to comment.