Skip to content

Commit

Permalink
Merge branch 'master' into pr/108913
Browse files Browse the repository at this point in the history
  • Loading branch information
joaomoreno committed Oct 23, 2020
2 parents 039f26d + 5c01372 commit 42e920a
Show file tree
Hide file tree
Showing 428 changed files with 6,992 additions and 3,240 deletions.
4 changes: 2 additions & 2 deletions .github/classifier.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
"context-keys": {"assign": []},
"css-less-scss": {"assign": ["aeschli"]},
"custom-editors": {"assign": ["mjbvz"]},
"debug": {"assign": ["connor4312 "]},
"debug-console": {"assign": ["connor4312 "]},
"debug": {"assign": ["weinand"]},
"debug-console": {"assign": ["weinand"]},
"dialogs": {"assign": ["sbatten"]},
"diff-editor": {"assign": []},
"dropdown": {"assign": []},
Expand Down
6 changes: 5 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,10 @@
}
},
{
"type": "chrome",
"type": "pwa-chrome",
"request": "launch",
"outFiles": [],
"perScriptSourcemaps": "yes",
"name": "VS Code (Web, Chrome)",
"url": "http://localhost:8080",
"preLaunchTask": "Run web",
Expand All @@ -282,6 +284,8 @@
{
"type": "pwa-msedge",
"request": "launch",
"outFiles": [],
"perScriptSourcemaps": "yes",
"name": "VS Code (Web, Edge)",
"url": "http://localhost:8080",
"pauseForSourceMap": false,
Expand Down
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@
},
"gulp.autoDetect": "off",
"files.insertFinalNewline": true,
"[plaintext]": {
"files.insertFinalNewline": false,
},
"[typescript]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
},
Expand Down
5 changes: 4 additions & 1 deletion build/azure-pipelines/upload-cdn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ function main() {
account: process.env.AZURE_STORAGE_ACCOUNT,
key: process.env.AZURE_STORAGE_ACCESS_KEY,
container: process.env.VSCODE_QUALITY,
prefix: commit + '/'
prefix: commit + '/',
contentSettings: {
cacheControl: 'max-age=31536000, public'
}
}));
}

Expand Down
4 changes: 4 additions & 0 deletions build/lib/i18n.resources.json
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,10 @@
"name": "vs/workbench/contrib/webviewPanel",
"project": "vscode-workbench"
},
{
"name": "vs/workbench/contrib/workspaces",
"project": "vscode-workbench"
},
{
"name": "vs/workbench/contrib/customEditor",
"project": "vscode-workbench"
Expand Down
2 changes: 1 addition & 1 deletion build/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"minimist": "^1.2.3",
"request": "^2.85.0",
"terser": "4.3.8",
"typescript": "^4.1.0-dev.20200924",
"typescript": "^4.1.0-dev.20201018",
"vsce": "1.48.0",
"vscode-telemetry-extractor": "^1.6.0",
"xml2js": "^0.4.17"
Expand Down
8 changes: 4 additions & 4 deletions build/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2535,10 +2535,10 @@ typescript@^3.0.1:
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.5.3.tgz#c830f657f93f1ea846819e929092f5fe5983e977"
integrity sha512-ACzBtm/PhXBDId6a6sDJfroT2pOWt/oOnk4/dElG5G33ZL776N3Y6/6bKZJBFpd+b05F3Ct9qDjMeJmRWtE2/g==

typescript@^4.1.0-dev.20200924:
version "4.1.0-dev.20200924"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.1.0-dev.20200924.tgz#d8b2aaa6f94ec22725eafcadf0b9a17aae9c32b9"
integrity sha512-AXwqVrp2AeVZ3jaZ/gcvxb0nnvqEbDFuFFjvV5/9wfcyz7KZx5KvyJENUgGoJHywCvl1PHKasQKYjzjk1QixnQ==
typescript@^4.1.0-dev.20201018:
version "4.1.0-dev.20201018"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.1.0-dev.20201018.tgz#1a4b8e3f9b640218a44299773371354d75bcfa34"
integrity sha512-cOFYP1I+IrMWa6ZfefxcacZha1pQMxrq8DGMBLkvrl8k3CqIdD8APq9LXaMj/PWrB8IPgDprY6jHwqiHg0/oGA==

typical@^4.0.0:
version "4.0.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
"settings": {
"$ref": "vscode://schemas/settings/machine",
"description": "Machine specific settings that should be copied into the container."
"description": "Machine specific settings that should be copied into the container. These are only copied when connecting to the container for the first time."
},
"remoteEnv": {
"type": "object",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
"settings": {
"$ref": "vscode://schemas/settings/machine",
"description": "Machine specific settings that should be copied into the container."
"description": "Machine specific settings that should be copied into the container. These are only copied when connecting to the container for the first time, rebuilding the container then triggers it again."
},
"forwardPorts": {
"type": "array",
Expand Down Expand Up @@ -298,7 +298,7 @@
},
"workspaceFolder": {
"type": "string",
"description": "The path of the workspace folder inside the container."
"description": "The path of the workspace folder inside the container. This is typically the target path of a volume mount in the docker-compose.yml."
},
"shutdownAction": {
"type": "string",
Expand Down
42 changes: 21 additions & 21 deletions extensions/emmet/src/abbreviationActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function doWrapping(individualLines: boolean, args: any) {
const helper = getEmmetHelper();

// Fetch general information for the succesive expansions. i.e. the ranges to replace and its contents
let rangesToReplace: PreviewRangesWithContent[] = editor.selections.sort((a: vscode.Selection, b: vscode.Selection) => { return a.start.compareTo(b.start); }).map(selection => {
const rangesToReplace: PreviewRangesWithContent[] = editor.selections.sort((a: vscode.Selection, b: vscode.Selection) => { return a.start.compareTo(b.start); }).map(selection => {
let rangeToReplace: vscode.Range = selection.isReversed ? new vscode.Range(selection.active, selection.anchor) : selection;
if (!rangeToReplace.isSingleLine && rangeToReplace.end.character === 0) {
const previousLine = rangeToReplace.end.line - 1;
Expand All @@ -88,7 +88,7 @@ function doWrapping(individualLines: boolean, args: any) {
rangeToReplace = new vscode.Range(rangeToReplace.start.line, rangeToReplace.start.character + extraWhitespaceSelected, rangeToReplace.end.line, rangeToReplace.end.character);

let textToWrapInPreview: string[];
let textToReplace = editor.document.getText(rangeToReplace);
const textToReplace = editor.document.getText(rangeToReplace);
if (individualLines) {
textToWrapInPreview = textToReplace.split('\n').map(x => x.trim());
} else {
Expand Down Expand Up @@ -144,7 +144,7 @@ function doWrapping(individualLines: boolean, args: any) {
const oldPreviewLines = oldPreviewRange.end.line - oldPreviewRange.start.line + 1;
const newLinesInserted = expandedTextLines.length - oldPreviewLines;

let newPreviewLineStart = oldPreviewRange.start.line + totalLinesInserted;
const newPreviewLineStart = oldPreviewRange.start.line + totalLinesInserted;
let newPreviewStart = oldPreviewRange.start.character;
const newPreviewLineEnd = oldPreviewRange.end.line + totalLinesInserted + newLinesInserted;
let newPreviewEnd = expandedTextLines[expandedTextLines.length - 1].length;
Expand Down Expand Up @@ -177,19 +177,19 @@ function doWrapping(individualLines: boolean, args: any) {
return inPreview ? revertPreview().then(() => { return false; }) : Promise.resolve(inPreview);
}

let extractedResults = helper.extractAbbreviationFromText(inputAbbreviation);
const extractedResults = helper.extractAbbreviationFromText(inputAbbreviation);
if (!extractedResults) {
return Promise.resolve(inPreview);
} else if (extractedResults.abbreviation !== inputAbbreviation) {
// Not clear what should we do in this case. Warn the user? How?
}

let { abbreviation, filter } = extractedResults;
const { abbreviation, filter } = extractedResults;
if (definitive) {
const revertPromise = inPreview ? revertPreview() : Promise.resolve();
return revertPromise.then(() => {
const expandAbbrList: ExpandAbbreviationInput[] = rangesToReplace.map(rangesAndContent => {
let rangeToReplace = rangesAndContent.originalRange;
const rangeToReplace = rangesAndContent.originalRange;
let textToWrap: string[];
if (individualLines) {
textToWrap = rangesAndContent.textToWrapInPreview;
Expand Down Expand Up @@ -270,17 +270,17 @@ export function expandEmmetAbbreviation(args: any): Thenable<boolean | undefined
return fallbackTab();
}

let abbreviationList: ExpandAbbreviationInput[] = [];
const abbreviationList: ExpandAbbreviationInput[] = [];
let firstAbbreviation: string;
let allAbbreviationsSame: boolean = true;
const helper = getEmmetHelper();

let getAbbreviation = (document: vscode.TextDocument, selection: vscode.Selection, position: vscode.Position, syntax: string): [vscode.Range | null, string, string] => {
const getAbbreviation = (document: vscode.TextDocument, selection: vscode.Selection, position: vscode.Position, syntax: string): [vscode.Range | null, string, string] => {
position = document.validatePosition(position);
let rangeToReplace: vscode.Range = selection;
let abbr = document.getText(rangeToReplace);
if (!rangeToReplace.isEmpty) {
let extractedResults = helper.extractAbbreviationFromText(abbr);
const extractedResults = helper.extractAbbreviationFromText(abbr);
if (extractedResults) {
return [rangeToReplace, extractedResults.abbreviation, extractedResults.filter];
}
Expand All @@ -293,23 +293,23 @@ export function expandEmmetAbbreviation(args: any): Thenable<boolean | undefined
// Expand cases like <div to <div></div> explicitly
// else we will end up with <<div></div>
if (syntax === 'html') {
let matches = textTillPosition.match(/<(\w+)$/);
const matches = textTillPosition.match(/<(\w+)$/);
if (matches) {
abbr = matches[1];
rangeToReplace = new vscode.Range(position.translate(0, -(abbr.length + 1)), position);
return [rangeToReplace, abbr, ''];
}
}
let extractedResults = helper.extractAbbreviation(toLSTextDocument(editor.document), position, false);
const extractedResults = helper.extractAbbreviation(toLSTextDocument(editor.document), position, { lookAhead: false });
if (!extractedResults) {
return [null, '', ''];
}

let { abbreviationRange, abbreviation, filter } = extractedResults;
const { abbreviationRange, abbreviation, filter } = extractedResults;
return [new vscode.Range(abbreviationRange.start.line, abbreviationRange.start.character, abbreviationRange.end.line, abbreviationRange.end.character), abbreviation, filter];
};

let selectionsInReverseOrder = editor.selections.slice(0);
const selectionsInReverseOrder = editor.selections.slice(0);
selectionsInReverseOrder.sort((a, b) => {
const posA = a.isReversed ? a.anchor : a.active;
const posB = b.isReversed ? b.anchor : b.active;
Expand All @@ -322,7 +322,7 @@ export function expandEmmetAbbreviation(args: any): Thenable<boolean | undefined
return rootNode;
}

let usePartialParsing = vscode.workspace.getConfiguration('emmet')['optimizeStylesheetParsing'] === true;
const usePartialParsing = vscode.workspace.getConfiguration('emmet')['optimizeStylesheetParsing'] === true;
if (editor.selections.length === 1 && isStyleSheet(editor.document.languageId) && usePartialParsing && editor.document.lineCount > 1000) {
rootNode = parsePartialStylesheet(editor.document, editor.selection.isReversed ? editor.selection.anchor : editor.selection.active);
} else {
Expand All @@ -333,8 +333,8 @@ export function expandEmmetAbbreviation(args: any): Thenable<boolean | undefined
}

selectionsInReverseOrder.forEach(selection => {
let position = selection.isReversed ? selection.anchor : selection.active;
let [rangeToReplace, abbreviation, filter] = getAbbreviation(editor.document, selection, position, syntax);
const position = selection.isReversed ? selection.anchor : selection.active;
const [rangeToReplace, abbreviation, filter] = getAbbreviation(editor.document, selection, position, syntax);
if (!rangeToReplace) {
return;
}
Expand Down Expand Up @@ -578,7 +578,7 @@ function expandAbbreviationInRange(editor: vscode.TextEditor, expandAbbrList: Ex
// Snippet to replace at multiple cursors are not the same
// `editor.insertSnippet` will have to be called for each instance separately
// We will not be able to maintain multiple cursors after snippet insertion
let insertPromises: Thenable<boolean>[] = [];
const insertPromises: Thenable<boolean>[] = [];
if (!insertSameSnippet) {
expandAbbrList.sort((a: ExpandAbbreviationInput, b: ExpandAbbreviationInput) => { return b.rangeToReplace.start.compareTo(a.rangeToReplace.start); }).forEach((expandAbbrInput: ExpandAbbreviationInput) => {
let expandedText = expandAbbr(expandAbbrInput);
Expand All @@ -596,8 +596,8 @@ function expandAbbreviationInRange(editor: vscode.TextEditor, expandAbbrList: Ex
// We can pass all ranges to `editor.insertSnippet` in a single call so that
// all cursors are maintained after snippet insertion
const anyExpandAbbrInput = expandAbbrList[0];
let expandedText = expandAbbr(anyExpandAbbrInput);
let allRanges = expandAbbrList.map(value => {
const expandedText = expandAbbr(anyExpandAbbrInput);
const allRanges = expandAbbrList.map(value => {
return new vscode.Range(value.rangeToReplace.start.line, value.rangeToReplace.start.character, value.rangeToReplace.end.line, value.rangeToReplace.end.character);
});
if (expandedText) {
Expand All @@ -614,7 +614,7 @@ function walk(root: any, fn: ((node: any) => boolean)): boolean {
let ctx = root;
while (ctx) {

let next = ctx.next;
const next = ctx.next;
if (fn(ctx) === false || walk(ctx.firstChild, fn) === false) {
return false;
}
Expand Down Expand Up @@ -653,7 +653,7 @@ function expandAbbr(input: ExpandAbbreviationInput): string | undefined {
// Expand the abbreviation

if (input.textToWrap) {
let parsedAbbr = helper.parseAbbreviation(input.abbreviation, expandOptions);
const parsedAbbr = helper.parseAbbreviation(input.abbreviation, expandOptions);
if (input.rangeToReplace.isSingleLine && input.textToWrap.length === 1) {

// Fetch rightmost element in the parsed abbreviation (i.e the element that will contain the wrapped text).
Expand Down
5 changes: 4 additions & 1 deletion extensions/emmet/src/defaultCompletionProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,10 @@ export class DefaultCompletionItemProvider implements vscode.CompletionItemProvi
}
}

const extractAbbreviationResults = helper.extractAbbreviation(lsDoc, position, !isStyleSheet(syntax));
const expandOptions = isStyleSheet(syntax) ?
{ lookAhead: false, syntax: 'stylesheet' } :
{ lookAhead: true, syntax: 'markup' };
const extractAbbreviationResults = helper.extractAbbreviation(lsDoc, position, expandOptions);
if (!extractAbbreviationResults || !helper.isAbbreviationValid(syntax, extractAbbreviationResults.abbreviation)) {
return;
}
Expand Down
Loading

0 comments on commit 42e920a

Please sign in to comment.