diff --git a/.github/workflows/no-yarn-lock-changes.yml b/.github/workflows/no-yarn-lock-changes.yml index 7bceb299030..ac37eaa61ea 100644 --- a/.github/workflows/no-yarn-lock-changes.yml +++ b/.github/workflows/no-yarn-lock-changes.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest steps: - id: file_changes - uses: trilom/file-changes-action@v1.2.4 + uses: trilom/file-changes-action@ce38c8ce2459ca3c303415eec8cb0409857b4272 - name: Check for yarn.lock changes run: | cat $HOME/files.json | jq -e '.[] | test("yarn\\.lock$") | not' \ diff --git a/.vscode/notebooks/api.github-issues b/.vscode/notebooks/api.github-issues index c0154336692..ebb916bf795 100644 --- a/.vscode/notebooks/api.github-issues +++ b/.vscode/notebooks/api.github-issues @@ -9,7 +9,7 @@ { "kind": 2, "language": "github-issues", - "value": "$repo=repo:microsoft/vscode\n$milestone=milestone:\"February 2021\"", + "value": "$repo=repo:microsoft/vscode\n$milestone=milestone:\"March 2021\"", "editable": true, "outputs": [] }, diff --git a/.vscode/notebooks/my-work.github-issues b/.vscode/notebooks/my-work.github-issues index 4cb58bad7a6..bc9aa8dcac6 100644 --- a/.vscode/notebooks/my-work.github-issues +++ b/.vscode/notebooks/my-work.github-issues @@ -9,7 +9,7 @@ { "kind": 2, "language": "github-issues", - "value": "// list of repos we work in\n$repos=repo:microsoft/vscode repo:microsoft/vscode-remote-release repo:microsoft/vscode-js-debug repo:microsoft/vscode-pull-request-github repo:microsoft/vscode-github-issue-notebooks repo:microsoft/vscode-internalbacklog\n\n// current milestone name\n$milestone=milestone:\"February 2021\"", + "value": "// list of repos we work in\n$repos=repo:microsoft/vscode repo:microsoft/vscode-remote-release repo:microsoft/vscode-js-debug repo:microsoft/vscode-pull-request-github repo:microsoft/vscode-github-issue-notebooks repo:microsoft/vscode-internalbacklog\n\n// current milestone name\n$milestone=milestone:\"March 2021\"", "editable": true, "outputs": [] }, diff --git a/build/.moduleignore b/build/.moduleignore index d1f9194ba2a..98bca26eafe 100644 --- a/build/.moduleignore +++ b/build/.moduleignore @@ -80,13 +80,11 @@ node-pty/scripts/** !node-pty/build/Release/*.dll !node-pty/build/Release/*.node -vscode-nsfw/binding.gyp -vscode-nsfw/build/** -vscode-nsfw/src/** -vscode-nsfw/openpa/** -vscode-nsfw/includes/** -!vscode-nsfw/build/Release/*.node -!vscode-nsfw/**/*.a +nsfw/binding.gyp +nsfw/build/** +nsfw/src/** +nsfw/includes/** +!nsfw/build/Release/*.node vsda/build/** vsda/ci/** diff --git a/build/lib/i18n.js b/build/lib/i18n.js index 7a529824a5a..50ec3f3f45a 100644 --- a/build/lib/i18n.js +++ b/build/lib/i18n.js @@ -237,14 +237,14 @@ XLF.parse = function (xlfString) { } let val = unit.target[0]; if (typeof val !== 'string') { - val = val._; + // We allow empty source values so support them for translations as well. + val = val._ ? val._ : ''; } - if (key && val) { - messages[key] = decodeEntities(val); - } - else { - reject(new Error(`XLF parsing error: XLIFF file ${originalFilePath} does not contain full localization data. ID or target translation for one of the trans-unit nodes is not present.`)); + if (!key) { + reject(new Error(`XLF parsing error: trans-unit ${JSON.stringify(unit, undefined, 0)} defined in file ${originalFilePath} is missing the ID attribute.`)); + return; } + messages[key] = decodeEntities(val); }); files.push({ messages: messages, originalFilePath: originalFilePath, language: language.toLowerCase() }); } diff --git a/build/lib/i18n.ts b/build/lib/i18n.ts index a23b58ccd3d..746c481b262 100644 --- a/build/lib/i18n.ts +++ b/build/lib/i18n.ts @@ -339,13 +339,14 @@ export class XLF { let val = unit.target[0]; if (typeof val !== 'string') { - val = val._; + // We allow empty source values so support them for translations as well. + val = val._ ? val._ : ''; } - if (key && val) { - messages[key] = decodeEntities(val); - } else { - reject(new Error(`XLF parsing error: XLIFF file ${originalFilePath} does not contain full localization data. ID or target translation for one of the trans-unit nodes is not present.`)); + if (!key) { + reject(new Error(`XLF parsing error: trans-unit ${JSON.stringify(unit, undefined, 0)} defined in file ${originalFilePath} is missing the ID attribute.`)); + return; } + messages[key] = decodeEntities(val); }); files.push({ messages: messages, originalFilePath: originalFilePath, language: language.toLowerCase() }); } diff --git a/build/package.json b/build/package.json index cb70e42902d..c717a1585da 100644 --- a/build/package.json +++ b/build/package.json @@ -52,7 +52,7 @@ "p-limit": "^3.1.0", "plist": "^3.0.1", "source-map": "0.6.1", - "typescript": "^4.3.0-dev.20210216", + "typescript": "^4.3.0-dev.20210226", "vsce": "1.48.0", "vscode-universal": "deepak1556/universal#61454d96223b774c53cda10f72c2098c0ce02d58" }, diff --git a/build/yarn.lock b/build/yarn.lock index 67dd26a7624..b73eb19d249 100644 --- a/build/yarn.lock +++ b/build/yarn.lock @@ -1884,10 +1884,10 @@ typescript@^4.1.3: resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.1.3.tgz#519d582bd94cba0cf8934c7d8e8467e473f53bb7" integrity sha512-B3ZIOf1IKeH2ixgHhj6la6xdwR9QrLC5d1VKeCSY4tvkqhF2eqd9O7txNlS0PO3GrBAFIdr3L1ndNwteUbZLYg== -typescript@^4.3.0-dev.20210216: - version "4.3.0-dev.20210216" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.3.0-dev.20210216.tgz#233327e6094008c02265ba140f8d9ece9133421e" - integrity sha512-pJLcC/kqnE+0rftTRc2/gYBkz9nl+kJfaU8sSOLYnzUvD8p+LOZMzXfaLoKPdGFJ6U9+Ox/sYV9HBTJVEjSTYg== +typescript@^4.3.0-dev.20210226: + version "4.3.0-dev.20210226" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.3.0-dev.20210226.tgz#e754283dfaa01d79cea9df6d0f8a18114ace41ec" + integrity sha512-jxqKjVQsHkEMbyacr5CFpWnU3pv7H9QBljjORr3ct7qq+Q7ynHHmmFd5zQjU8HgHZYOMapIBhLsZSeqUeduQGQ== uc.micro@^1.0.1, uc.micro@^1.0.5: version "1.0.5" diff --git a/extensions/emmet/package.json b/extensions/emmet/package.json index 4d26781cfd2..119dd6fd4e6 100644 --- a/extensions/emmet/package.json +++ b/extensions/emmet/package.json @@ -84,12 +84,11 @@ "description": "%emmetExclude%" }, "emmet.extensionsPath": { - "type": [ - "string", - "array", - "null" - ], - "default": null, + "type": "array", + "items": { + "type": "string" + }, + "default": [], "description": "%emmetExtensionsPath%" }, "emmet.triggerExpansionOnTab": { diff --git a/extensions/emmet/src/abbreviationActions.ts b/extensions/emmet/src/abbreviationActions.ts index 97ba3ac73a5..3ec42d4ae49 100644 --- a/extensions/emmet/src/abbreviationActions.ts +++ b/extensions/emmet/src/abbreviationActions.ts @@ -440,10 +440,18 @@ export function isValidLocationForEmmetAbbreviation(document: vscode.TextDocumen return true; } + // Get the abbreviation right now + // Fixes https://github.com/microsoft/vscode/issues/74505 + // Stylesheet abbreviations starting with @ should bring up suggestions + // even at outer-most level + const abbreviation = document.getText(new vscode.Range(abbreviationRange.start.line, abbreviationRange.start.character, abbreviationRange.end.line, abbreviationRange.end.character)); + if (abbreviation.startsWith('@')) { + return true; + } + // Fix for https://github.com/microsoft/vscode/issues/34162 // Other than sass, stylus, we can make use of the terminator tokens to validate position if (syntax !== 'sass' && syntax !== 'stylus' && currentNode.type === 'property') { - // Fix for upstream issue https://github.com/emmetio/css-parser/issues/3 if (currentNode.parent && currentNode.parent.type !== 'rule' @@ -451,7 +459,6 @@ export function isValidLocationForEmmetAbbreviation(document: vscode.TextDocumen return false; } - const abbreviation = document.getText(new vscode.Range(abbreviationRange.start.line, abbreviationRange.start.character, abbreviationRange.end.line, abbreviationRange.end.character)); const propertyNode = currentNode; if (propertyNode.terminatorToken && propertyNode.separator diff --git a/extensions/emmet/src/defaultCompletionProvider.ts b/extensions/emmet/src/defaultCompletionProvider.ts index bb9226c59b0..f78b3af40c4 100644 --- a/extensions/emmet/src/defaultCompletionProvider.ts +++ b/extensions/emmet/src/defaultCompletionProvider.ts @@ -6,7 +6,7 @@ import * as vscode from 'vscode'; import { Node, Stylesheet } from 'EmmetFlatNode'; import { isValidLocationForEmmetAbbreviation, getSyntaxFromArgs } from './abbreviationActions'; -import { getEmmetHelper, getMappingForIncludedLanguages, parsePartialStylesheet, getEmmetConfiguration, getEmmetMode, isStyleSheet, getFlatNode, allowedMimeTypesInScriptTag, toLSTextDocument, getHtmlFlatNode } from './util'; +import { getEmmetHelper, getMappingForIncludedLanguages, parsePartialStylesheet, getEmmetConfiguration, getEmmetMode, isStyleSheet, getFlatNode, allowedMimeTypesInScriptTag, toLSTextDocument, getHtmlFlatNode, getEmbeddedCssNodeIfAny } from './util'; import { Range as LSRange } from 'vscode-languageserver-textdocument'; import { getRootNode } from './parseDocument'; @@ -137,6 +137,20 @@ export class DefaultCompletionItemProvider implements vscode.CompletionItemProvi currentNode = getFlatNode(rootNode, offset, true); } + // Fix for https://github.com/microsoft/vscode/issues/107578 + // Validate location if syntax is of styleSheet type to ensure that location is valid for emmet abbreviation. + // For an html document containing a