Archived
1
0

chore(vscode): update to 1.54.2

This commit is contained in:
Joe Previte
2021-03-11 10:27:10 -07:00
1459 changed files with 53404 additions and 51004 deletions

View File

@ -40,8 +40,12 @@
"keybindings.json",
"extensions.json",
"argv.json",
"profiles.json"
]
"profiles.json",
".devcontainer.json"
],
"filenamePatterns": [
"**/.devcontainer/devcontainer.json"
]
}
],
"jsonValidation": [
@ -129,5 +133,9 @@
},
"devDependencies": {
"@types/node": "^12.19.9"
},
"repository": {
"type": "git",
"url": "https://github.com/microsoft/vscode.git"
}
}

View File

@ -1,4 +1,4 @@
{
"displayName": "Configuration Editing",
"description": "Provides capabilities (advanced IntelliSense, auto-fixing) in configuration files like settings, launch, and extension recommendation files."
}
}

View File

@ -19,6 +19,63 @@
"type": "integer"
}
},
"portsAttributes": {
"type": "object",
"patternProperties": {
"^\\d+(\\-\\d+)?$": {
"type": "object",
"description": "A port, or range of ports (ex. \"40000-55000\") that the attributes should apply to",
"properties": {
"onAutoForward": {
"type": "string",
"enum": [
"notify",
"openBrowser",
"openPreview",
"silent",
"ignore"
],
"enumDescriptions": [
"Shows a notification when a port is automatically forwarded.",
"Opens the browser when the port is automatically forwarded. Depending on your settings, this could open an embedded browser.",
"Opens a preview in the same window when the port is automatically forwarded.",
"Shows no notification and takes no action when this port is automatically forwarded.",
"This port will not be automatically forwarded."
],
"description": "Defines the action that occurs when the port is discovered for automatic forwarding",
"default": "notify"
},
"elevateIfNeeded": {
"type": "boolean",
"description": "Automatically prompt for elevation (if needed) when this port is forwarded. Elevate is required if the local port is a privileged port.",
"default": false
},
"label": {
"type": "string",
"description": "Label that will be shown in the UI for this port.",
"default": "Labeled Port"
}
},
"default": {
"label": "Labeled Port",
"onAutoForward": "notify"
}
}
},
"markdownDescription": "Set default properties that are applied when a specific port number is forwarded. For example:\n\n```\n\"3000\": {\n \"label\": \"Labeled Port\"\n},\n\"40000-55000\": {\n \"onAutoForward\": \"ignore\"\n}\n```",
"defaultSnippets": [
{
"body": {
"${1:3000}": {
"label": "${2:My Port}",
"onAutoForward": "notify"
}
}
}
],
"errorMessage": "Must be a port number or a range of port numbers",
"additionalProperties": false
},
"settings": {
"$ref": "vscode://schemas/settings/machine",
"description": "Machine specific settings that should be copied into the container. These are only copied when connecting to the container for the first time."

View File

@ -127,6 +127,64 @@
"minimum": 0
}
},
"portsAttributes": {
"type": "object",
"patternProperties": {
"^\\d+(\\-\\d+)?$": {
"type": "object",
"description": "A port, or range of ports (ex. \"40000-55000\") that the attributes should apply to",
"properties": {
"onAutoForward": {
"type": "string",
"enum": [
"notify",
"openBrowser",
"openPreview",
"silent",
"ignore"
],
"enumDescriptions": [
"Shows a notification when a port is automatically forwarded.",
"Opens the browser when the port is automatically forwarded. Depending on your settings, this could open an embedded browser.",
"Opens a preview in the same window when the port is automatically forwarded.",
"Shows no notification and takes no action when this port is automatically forwarded.",
"This port will not be automatically forwarded."
],
"description": "Defines the action that occurs when the port is discovered for automatic forwarding",
"default": "notify"
},
"elevateIfNeeded": {
"type": "boolean",
"description": "Automatically prompt for elevation (if needed) when this port is forwarded. Elevate is required if the local port is a privileged port.",
"default": false
},
"label": {
"type": "string",
"description": "Label that will be shown in the UI for this port.",
"default": "Labeled Port"
}
},
"default": {
"label": "Labeled Port",
"onAutoForward": "notify"
},
"additionalProperties": false
}
},
"markdownDescription": "Set default properties that are applied when a specific port number is forwarded. For example:\n\n```\n\"3000\": {\n \"label\": \"Labeled Port\"\n},\n\"40000-55000\": {\n \"onAutoForward\": \"ignore\"\n}\n```",
"defaultSnippets": [
{
"body": {
"${1:3000}": {
"label": "${2:My Port}",
"onAutoForward": "notify"
}
}
}
],
"errorMessage": "Must be a port number or a range of port numbers",
"additionalProperties": false
},
"remoteEnv": {
"type": "object",
"additionalProperties": {
@ -326,6 +384,64 @@
"minimum": 0
}
},
"portsAttributes": {
"type": "object",
"patternProperties": {
"^\\d+(\\-\\d+)?$": {
"type": "object",
"description": "A port, or range of ports (ex. \"40000-55000\") that the attributes should apply to",
"properties": {
"onAutoForward": {
"type": "string",
"enum": [
"notify",
"openBrowser",
"openPreview",
"silent",
"ignore"
],
"enumDescriptions": [
"Shows a notification when a port is automatically forwarded.",
"Opens the browser when the port is automatically forwarded. Depending on your settings, this could open an embedded browser.",
"Opens a preview in the same window when the port is automatically forwarded.",
"Shows no notification and takes no action when this port is automatically forwarded.",
"This port will not be automatically forwarded."
],
"description": "Defines the action that occurs when the port is discovered for automatic forwarding",
"default": "notify"
},
"elevateIfNeeded": {
"type": "boolean",
"description": "Automatically prompt for elevation (if needed) when this port is forwarded. Elevate is required if the local port is a privileged port.",
"default": false
},
"label": {
"type": "string",
"description": "Label that will be shown in the UI for this port.",
"default": "Labeled Port"
}
},
"default": {
"label": "Labeled Port",
"onAutoForward": "notify"
},
"additionalProperties": false
}
},
"markdownDescription": "Set default properties that are applied when a specific port number is forwarded. For example:\n\n```\n\"3000\": {\n \"label\": \"Labeled Port\"\n},\n\"40000-55000\": {\n \"onAutoForward\": \"ignore\"\n}\n```",
"defaultSnippets": [
{
"body": {
"${1:3000}": {
"label": "${2:My Port}",
"onAutoForward": "notify"
}
}
}
],
"errorMessage": "Must be a port number or a range of port numbers",
"additionalProperties": false
},
"remoteEnv": {
"type": "object",
"additionalProperties": {
@ -501,6 +617,64 @@
"minimum": 0
}
},
"portsAttributes": {
"type": "object",
"patternProperties": {
"^\\d+(\\-\\d+)?$": {
"type": "object",
"description": "A port, or range of ports (ex. \"40000-55000\") that the attributes should apply to",
"properties": {
"onAutoForward": {
"type": "string",
"enum": [
"notify",
"openBrowser",
"openPreview",
"silent",
"ignore"
],
"enumDescriptions": [
"Shows a notification when a port is automatically forwarded.",
"Opens the browser when the port is automatically forwarded. Depending on your settings, this could open an embedded browser.",
"Opens a preview in the same window when the port is automatically forwarded.",
"Shows no notification and takes no action when this port is automatically forwarded.",
"This port will not be automatically forwarded."
],
"description": "Defines the action that occurs when the port is discovered for automatic forwarding",
"default": "notify"
},
"elevateIfNeeded": {
"type": "boolean",
"description": "Automatically prompt for elevation (if needed) when this port is forwarded. Elevate is required if the local port is a privileged port.",
"default": false
},
"label": {
"type": "string",
"description": "Label that will be shown in the UI for this port.",
"default": "Labeled Port"
}
},
"default": {
"label": "Labeled Port",
"onAutoForward": "notify"
},
"additionalProperties": false
}
},
"markdownDescription": "Set default properties that are applied when a specific port number is forwarded. For example:\n\n```\n\"3000\": {\n \"label\": \"Labeled Port\"\n},\n\"40000-55000\": {\n \"onAutoForward\": \"ignore\"\n}\n```",
"defaultSnippets": [
{
"body": {
"${1:3000}": {
"label": "${2:My Port}",
"onAutoForward": "notify"
}
}
}
],
"errorMessage": "Must be a port number or a range of port numbers",
"additionalProperties": false
},
"remoteEnv": {
"type": "object",
"additionalProperties": {
@ -642,6 +816,64 @@
"minimum": 0
}
},
"portsAttributes": {
"type": "object",
"patternProperties": {
"^\\d+(\\-\\d+)?$": {
"type": "object",
"description": "A port, or range of ports (ex. \"40000-55000\") that the attributes should apply to",
"properties": {
"onAutoForward": {
"type": "string",
"enum": [
"notify",
"openBrowser",
"openPreview",
"silent",
"ignore"
],
"enumDescriptions": [
"Shows a notification when a port is automatically forwarded.",
"Opens the browser when the port is automatically forwarded. Depending on your settings, this could open an embedded browser.",
"Opens a preview in the same window when the port is automatically forwarded.",
"Shows no notification and takes no action when this port is automatically forwarded.",
"This port will not be automatically forwarded."
],
"description": "Defines the action that occurs when the port is discovered for automatic forwarding",
"default": "notify"
},
"elevateIfNeeded": {
"type": "boolean",
"description": "Automatically prompt for elevation (if needed) when this port is forwarded. Elevate is required if the local port is a privileged port.",
"default": false
},
"label": {
"type": "string",
"description": "Label that will be shown in the UI for this port.",
"default": "Labeled Port"
}
},
"default": {
"label": "Labeled Port",
"onAutoForward": "notify"
},
"additionalProperties": false
}
},
"markdownDescription": "Set default properties that are applied when a specific port number is forwarded. For example:\n\n```\n\"3000\": {\n \"label\": \"Labeled Port\"\n},\n\"40000-55000\": {\n \"onAutoForward\": \"ignore\"\n}\n```",
"defaultSnippets": [
{
"body": {
"${1:3000}": {
"label": "${2:My Port}",
"onAutoForward": "notify"
}
}
}
],
"errorMessage": "Must be a port number or a range of port numbers",
"additionalProperties": false
},
"remoteEnv": {
"type": "object",
"additionalProperties": {
@ -752,6 +984,64 @@
"minimum": 0
}
},
"portsAttributes": {
"type": "object",
"patternProperties": {
"^\\d+(\\-\\d+)?$": {
"type": "object",
"description": "A port, or range of ports (ex. \"40000-55000\") that the attributes should apply to",
"properties": {
"onAutoForward": {
"type": "string",
"enum": [
"notify",
"openBrowser",
"openPreview",
"silent",
"ignore"
],
"enumDescriptions": [
"Shows a notification when a port is automatically forwarded.",
"Opens the browser when the port is automatically forwarded. Depending on your settings, this could open an embedded browser.",
"Opens a preview in the same window when the port is automatically forwarded.",
"Shows no notification and takes no action when this port is automatically forwarded.",
"This port will not be automatically forwarded."
],
"description": "Defines the action that occurs when the port is discovered for automatic forwarding",
"default": "notify"
},
"elevateIfNeeded": {
"type": "boolean",
"description": "Automatically prompt for elevation (if needed) when this port is forwarded. Elevate is required if the local port is a privileged port.",
"default": false
},
"label": {
"type": "string",
"description": "Label that will be shown in the UI for this port.",
"default": "Labeled Port"
}
},
"default": {
"label": "Labeled Port",
"onAutoForward": "notify"
},
"additionalProperties": false
}
},
"markdownDescription": "Set default properties that are applied when a specific port number is forwarded. For example:\n\n```\n\"3000\": {\n \"label\": \"Labeled Port\"\n},\n\"40000-55000\": {\n \"onAutoForward\": \"ignore\"\n}\n```",
"defaultSnippets": [
{
"body": {
"${1:3000}": {
"label": "${2:My Port}",
"onAutoForward": "notify"
}
}
}
],
"errorMessage": "Must be a port number or a range of port numbers",
"additionalProperties": false
},
"remoteEnv": {
"type": "object",
"additionalProperties": {

View File

@ -33,6 +33,63 @@
"minimum": 0
}
},
"portsAttributes": {
"type": "object",
"patternProperties": {
"^\\d+(\\-\\d+)?$": {
"type": "object",
"description": "A port, or range of ports (ex. \"40000-55000\") that the attributes should apply to",
"properties": {
"onAutoForward": {
"type": "string",
"enum": [
"notify",
"openBrowser",
"openPreview",
"silent",
"ignore"
],
"enumDescriptions": [
"Shows a notification when a port is automatically forwarded.",
"Opens the browser when the port is automatically forwarded. Depending on your settings, this could open an embedded browser.",
"Opens a preview in the same window when the port is automatically forwarded.",
"Shows no notification and takes no action when this port is automatically forwarded.",
"This port will not be automatically forwarded."
],
"description": "Defines the action that occurs when the port is discovered for automatic forwarding",
"default": "notify"
},
"elevateIfNeeded": {
"type": "boolean",
"description": "Automatically prompt for elevation (if needed) when this port is forwarded. Elevate is required if the local port is a privileged port.",
"default": false
},
"label": {
"type": "string",
"description": "Label that will be shown in the UI for this port.",
"default": "Labeled Port"
}
},
"default": {
"label": "Labeled Port",
"onAutoForward": "notify"
}
}
},
"markdownDescription": "Set default properties that are applied when a specific port number is forwarded. For example:\n\n```\n\"3000\": {\n \"label\": \"Labeled Port\"\n},\n\"40000-55000\": {\n \"onAutoForward\": \"ignore\"\n}\n```",
"defaultSnippets": [
{
"body": {
"${1:3000}": {
"label": "${2:My Port}",
"onAutoForward": "notify"
}
}
}
],
"errorMessage": "Must be a port number or a range of port numbers",
"additionalProperties": false
},
"remoteEnv": {
"type": "object",
"additionalProperties": {
@ -205,7 +262,7 @@
"$ref": "#/definitions/buildOptions"
}
]
}
}
},
"required": [
"build"

View File

@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { getLocation, parse, visit } from 'jsonc-parser';
import { getLocation, JSONPath, parse, visit } from 'jsonc-parser';
import * as vscode from 'vscode';
import * as nls from 'vscode-nls';
import { SettingsDocument } from './settingsDocumentHelper';
@ -22,6 +22,9 @@ export function activate(context: vscode.ExtensionContext): void {
// task.json variable suggestions
context.subscriptions.push(registerVariableCompletions('**/tasks.json'));
// keybindings.json/package.json context key suggestions
context.subscriptions.push(registerContextKeyCompletions());
}
function registerSettingsCompletions(): vscode.Disposable {
@ -136,3 +139,83 @@ vscode.languages.registerDocumentSymbolProvider({ pattern: '**/launch.json', lan
return result;
}
}, { label: 'Launch Targets' });
function registerContextKeyCompletions(): vscode.Disposable {
type ContextKeyInfo = { key: string, type?: string, description?: string };
const paths = new Map<vscode.DocumentFilter, JSONPath[]>([
[{ language: 'jsonc', pattern: '**/keybindings.json' }, [
['*', 'when']
]],
[{ language: 'json', pattern: '**/package.json' }, [
['contributes', 'menus', '*', '*', 'when'],
['contributes', 'views', '*', '*', 'when'],
['contributes', 'viewsWelcome', '*', 'when'],
['contributes', 'keybindings', '*', 'when'],
['contributes', 'keybindings', 'when'],
]]
]);
return vscode.languages.registerCompletionItemProvider(
[...paths.keys()],
{
async provideCompletionItems(document: vscode.TextDocument, position: vscode.Position, token: vscode.CancellationToken) {
const location = getLocation(document.getText(), document.offsetAt(position));
if (location.isAtPropertyKey) {
return;
}
let isValidLocation = false;
for (const [key, value] of paths) {
if (vscode.languages.match(key, document)) {
if (value.some(location.matches.bind(location))) {
isValidLocation = true;
break;
}
}
}
if (!isValidLocation) {
return;
}
// for JSON everything with quotes is a word
const jsonWord = document.getWordRangeAtPosition(position);
if (!jsonWord || jsonWord.start.isEqual(position) || jsonWord.end.isEqual(position)) {
// we aren't inside a "JSON word" or on its quotes
return;
}
let replacing: vscode.Range | undefined;
if (jsonWord.end.character - jsonWord.start.character === 2 || document.getWordRangeAtPosition(position, /\s+/)) {
// empty json word or on whitespace
replacing = new vscode.Range(position, position);
} else {
replacing = document.getWordRangeAtPosition(position, /[a-zA-Z.]+/);
}
if (!replacing) {
return;
}
const inserting = replacing.with(undefined, position);
const data = await vscode.commands.executeCommand<ContextKeyInfo[]>('getContextKeyInfo');
if (token.isCancellationRequested || !data) {
return;
}
const result = new vscode.CompletionList();
for (const item of data) {
const completion = new vscode.CompletionItem(item.key, vscode.CompletionItemKind.Constant);
completion.detail = item.type;
completion.range = { replacing, inserting };
completion.documentation = item.description;
result.items.push(completion);
}
return result;
}
}
);
}