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

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,28 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as MarkdownIt from 'markdown-it';
declare const acquireNotebookRendererApi: any;
type extendMarkdownItFnType = (
(f: (md: MarkdownIt.MarkdownIt) => void) => void
);
(function () {
const markdownIt = new MarkdownIt({
html: true
});
(globalThis as any).extendMarkdownIt = ((f: (md: MarkdownIt.MarkdownIt) => void) => {
f(markdownIt);
}) as extendMarkdownItFnType;
const notebook = acquireNotebookRendererApi('notebookCoreTestRenderer');
notebook.onDidCreateMarkdown(({ element, content }: any) => {
const rendered = markdownIt.render(content);
element.innerHTML = rendered;
});
}());

View File

@ -1,340 +1,352 @@
{
"name": "markdown-language-features",
"displayName": "%displayName%",
"description": "%description%",
"version": "1.0.0",
"icon": "icon.png",
"publisher": "vscode",
"enableProposedApi": true,
"license": "MIT",
"aiKey": "AIF-d9b70cd4-b9f9-4d70-929b-a071c400b217",
"engines": {
"vscode": "^1.20.0"
},
"main": "./out/extension",
"browser": "./dist/browser/extension",
"categories": [
"Programming Languages"
],
"activationEvents": [
"onLanguage:markdown",
"onCommand:markdown.preview.toggleLock",
"onCommand:markdown.preview.refresh",
"onCommand:markdown.showPreview",
"onCommand:markdown.showPreviewToSide",
"onCommand:markdown.showLockedPreviewToSide",
"onCommand:markdown.showSource",
"onCommand:markdown.showPreviewSecuritySelector",
"onCommand:markdown.api.render",
"onWebviewPanel:markdown.preview",
"onCustomEditor:vscode.markdown.preview.editor"
],
"contributes": {
"commands": [
{
"command": "markdown.showPreview",
"title": "%markdown.preview.title%",
"category": "Markdown",
"icon": {
"light": "./media/preview-light.svg",
"dark": "./media/preview-dark.svg"
}
},
{
"command": "markdown.showPreviewToSide",
"title": "%markdown.previewSide.title%",
"category": "Markdown",
"icon": "$(open-preview)"
},
{
"command": "markdown.showLockedPreviewToSide",
"title": "%markdown.showLockedPreviewToSide.title%",
"category": "Markdown",
"icon": "$(open-preview)"
},
{
"command": "markdown.showSource",
"title": "%markdown.showSource.title%",
"category": "Markdown",
"icon": "$(go-to-file)"
},
{
"command": "markdown.showPreviewSecuritySelector",
"title": "%markdown.showPreviewSecuritySelector.title%",
"category": "Markdown"
},
{
"command": "markdown.preview.refresh",
"title": "%markdown.preview.refresh.title%",
"category": "Markdown"
},
{
"command": "markdown.preview.toggleLock",
"title": "%markdown.preview.toggleLock.title%",
"category": "Markdown"
}
],
"menus": {
"editor/title": [
{
"command": "markdown.showPreviewToSide",
"when": "editorLangId == markdown && !notebookEditorFocused",
"alt": "markdown.showPreview",
"group": "navigation"
},
{
"command": "markdown.showSource",
"when": "markdownPreviewFocus",
"group": "navigation"
},
{
"command": "markdown.preview.refresh",
"when": "markdownPreviewFocus",
"group": "1_markdown"
},
{
"command": "markdown.preview.toggleLock",
"when": "markdownPreviewFocus",
"group": "1_markdown"
},
{
"command": "markdown.showPreviewSecuritySelector",
"when": "markdownPreviewFocus",
"group": "1_markdown"
}
],
"explorer/context": [
{
"command": "markdown.showPreview",
"when": "resourceLangId == markdown",
"group": "navigation"
}
],
"editor/title/context": [
{
"command": "markdown.showPreview",
"when": "resourceLangId == markdown",
"group": "1_open"
}
],
"commandPalette": [
{
"command": "markdown.showPreview",
"when": "editorLangId == markdown && !notebookEditorFocused",
"group": "navigation"
},
{
"command": "markdown.showPreviewToSide",
"when": "editorLangId == markdown && !notebookEditorFocused",
"group": "navigation"
},
{
"command": "markdown.showLockedPreviewToSide",
"when": "editorLangId == markdown && !notebookEditorFocused",
"group": "navigation"
},
{
"command": "markdown.showSource",
"when": "markdownPreviewFocus",
"group": "navigation"
},
{
"command": "markdown.showPreviewSecuritySelector",
"when": "editorLangId == markdown && !notebookEditorFocused"
},
{
"command": "markdown.showPreviewSecuritySelector",
"when": "markdownPreviewFocus"
},
{
"command": "markdown.preview.toggleLock",
"when": "markdownPreviewFocus"
},
{
"command": "markdown.preview.refresh",
"when": "editorLangId == markdown && !notebookEditorFocused"
},
{
"command": "markdown.preview.refresh",
"when": "markdownPreviewFocus"
}
]
},
"keybindings": [
{
"command": "markdown.showPreview",
"key": "shift+ctrl+v",
"mac": "shift+cmd+v",
"when": "editorLangId == markdown && !notebookEditorFocused"
},
{
"command": "markdown.showPreviewToSide",
"key": "ctrl+k v",
"mac": "cmd+k v",
"when": "editorLangId == markdown && !notebookEditorFocused"
}
],
"configuration": {
"type": "object",
"title": "Markdown",
"order": 20,
"properties": {
"markdown.styles": {
"type": "array",
"items": {
"type": "string"
},
"default": [],
"description": "%markdown.styles.dec%",
"scope": "resource"
},
"markdown.preview.breaks": {
"type": "boolean",
"default": false,
"description": "%markdown.preview.breaks.desc%",
"scope": "resource"
},
"markdown.preview.linkify": {
"type": "boolean",
"default": true,
"description": "%markdown.preview.linkify%",
"scope": "resource"
},
"markdown.preview.fontFamily": {
"type": "string",
"default": "-apple-system, BlinkMacSystemFont, 'Segoe WPC', 'Segoe UI', system-ui, 'Ubuntu', 'Droid Sans', sans-serif",
"description": "%markdown.preview.fontFamily.desc%",
"scope": "resource"
},
"markdown.preview.fontSize": {
"type": "number",
"default": 14,
"description": "%markdown.preview.fontSize.desc%",
"scope": "resource"
},
"markdown.preview.lineHeight": {
"type": "number",
"default": 1.6,
"description": "%markdown.preview.lineHeight.desc%",
"scope": "resource"
},
"markdown.preview.scrollPreviewWithEditor": {
"type": "boolean",
"default": true,
"description": "%markdown.preview.scrollPreviewWithEditor.desc%",
"scope": "resource"
},
"markdown.preview.markEditorSelection": {
"type": "boolean",
"default": true,
"description": "%markdown.preview.markEditorSelection.desc%",
"scope": "resource"
},
"markdown.preview.scrollEditorWithPreview": {
"type": "boolean",
"default": true,
"description": "%markdown.preview.scrollEditorWithPreview.desc%",
"scope": "resource"
},
"markdown.preview.doubleClickToSwitchToEditor": {
"type": "boolean",
"default": true,
"description": "%markdown.preview.doubleClickToSwitchToEditor.desc%",
"scope": "resource"
},
"markdown.preview.openMarkdownLinks": {
"type": "string",
"default": "inPreview",
"description": "%configuration.markdown.preview.openMarkdownLinks.description%",
"scope": "resource",
"enum": [
"inPreview",
"inEditor"
],
"enumDescriptions": [
"%configuration.markdown.preview.openMarkdownLinks.inPreview%",
"%configuration.markdown.preview.openMarkdownLinks.inEditor%"
]
},
"markdown.links.openLocation": {
"type": "string",
"default": "currentGroup",
"description": "%configuration.markdown.links.openLocation.description%",
"scope": "resource",
"enum": [
"currentGroup",
"beside"
],
"enumDescriptions": [
"%configuration.markdown.links.openLocation.currentGroup%",
"%configuration.markdown.links.openLocation.beside%"
]
},
"markdown.trace": {
"type": "string",
"enum": [
"off",
"verbose"
],
"default": "off",
"description": "%markdown.trace.desc%",
"scope": "window"
}
}
},
"configurationDefaults": {
"[markdown]": {
"editor.wordWrap": "on",
"editor.quickSuggestions": false
}
},
"jsonValidation": [
{
"fileMatch": "package.json",
"url": "./schemas/package.schema.json"
}
],
"markdown.previewStyles": [
"./media/markdown.css",
"./media/highlight.css"
],
"markdown.previewScripts": [
"./media/index.js"
],
"customEditors": [
{
"viewType": "vscode.markdown.preview.editor",
"displayName": "Markdown Preview (Experimental)",
"priority": "option",
"selector": [
{
"filenamePattern": "*.md"
}
]
}
]
},
"scripts": {
"compile": "gulp compile-extension:markdown-language-features && npm run build-preview",
"watch": "npm run build-preview && gulp watch-extension:markdown-language-features",
"vscode:prepublish": "npm run build-ext && npm run build-preview",
"build-ext": "node ../../node_modules/gulp/bin/gulp.js --gulpfile ../../build/gulpfile.extensions.js compile-extension:markdown-language-features ./tsconfig.json",
"build-preview": "webpack --mode production",
"compile-web": "npx webpack-cli --config extension-browser.webpack.config --mode none",
"watch-web": "npx webpack-cli --config extension-browser.webpack.config --mode none --watch --info-verbosity verbose"
},
"dependencies": {
"highlight.js": "^10.4.1",
"markdown-it": "^12.0.3",
"markdown-it-front-matter": "^0.2.1",
"vscode-extension-telemetry": "0.1.1",
"vscode-nls": "^4.0.0"
},
"devDependencies": {
"@types/highlight.js": "10.1.0",
"@types/lodash.throttle": "^4.1.3",
"@types/markdown-it": "0.0.2",
"@types/node": "^12.19.9",
"lodash.throttle": "^4.1.1"
}
"name": "markdown-language-features",
"displayName": "%displayName%",
"description": "%description%",
"version": "1.0.0",
"icon": "icon.png",
"publisher": "vscode",
"enableProposedApi": true,
"license": "MIT",
"aiKey": "AIF-d9b70cd4-b9f9-4d70-929b-a071c400b217",
"engines": {
"vscode": "^1.20.0"
},
"main": "./out/extension",
"browser": "./dist/browser/extension",
"categories": [
"Programming Languages"
],
"activationEvents": [
"onLanguage:markdown",
"onCommand:markdown.preview.toggleLock",
"onCommand:markdown.preview.refresh",
"onCommand:markdown.showPreview",
"onCommand:markdown.showPreviewToSide",
"onCommand:markdown.showLockedPreviewToSide",
"onCommand:markdown.showSource",
"onCommand:markdown.showPreviewSecuritySelector",
"onCommand:markdown.api.render",
"onWebviewPanel:markdown.preview",
"onCustomEditor:vscode.markdown.preview.editor"
],
"contributes": {
"notebookMarkdownRenderer": [
{
"id": "markdownItRenderer",
"displayName": "Markdown it renderer",
"entrypoint": "./notebook-out/index.js"
}
],
"commands": [
{
"command": "markdown.showPreview",
"title": "%markdown.preview.title%",
"category": "Markdown",
"icon": {
"light": "./media/preview-light.svg",
"dark": "./media/preview-dark.svg"
}
},
{
"command": "markdown.showPreviewToSide",
"title": "%markdown.previewSide.title%",
"category": "Markdown",
"icon": "$(open-preview)"
},
{
"command": "markdown.showLockedPreviewToSide",
"title": "%markdown.showLockedPreviewToSide.title%",
"category": "Markdown",
"icon": "$(open-preview)"
},
{
"command": "markdown.showSource",
"title": "%markdown.showSource.title%",
"category": "Markdown",
"icon": "$(go-to-file)"
},
{
"command": "markdown.showPreviewSecuritySelector",
"title": "%markdown.showPreviewSecuritySelector.title%",
"category": "Markdown"
},
{
"command": "markdown.preview.refresh",
"title": "%markdown.preview.refresh.title%",
"category": "Markdown"
},
{
"command": "markdown.preview.toggleLock",
"title": "%markdown.preview.toggleLock.title%",
"category": "Markdown"
}
],
"menus": {
"editor/title": [
{
"command": "markdown.showPreviewToSide",
"when": "editorLangId == markdown && !notebookEditorFocused",
"alt": "markdown.showPreview",
"group": "navigation"
},
{
"command": "markdown.showSource",
"when": "markdownPreviewFocus",
"group": "navigation"
},
{
"command": "markdown.preview.refresh",
"when": "markdownPreviewFocus",
"group": "1_markdown"
},
{
"command": "markdown.preview.toggleLock",
"when": "markdownPreviewFocus",
"group": "1_markdown"
},
{
"command": "markdown.showPreviewSecuritySelector",
"when": "markdownPreviewFocus",
"group": "1_markdown"
}
],
"explorer/context": [
{
"command": "markdown.showPreview",
"when": "resourceLangId == markdown",
"group": "navigation"
}
],
"editor/title/context": [
{
"command": "markdown.showPreview",
"when": "resourceLangId == markdown",
"group": "1_open"
}
],
"commandPalette": [
{
"command": "markdown.showPreview",
"when": "editorLangId == markdown && !notebookEditorFocused",
"group": "navigation"
},
{
"command": "markdown.showPreviewToSide",
"when": "editorLangId == markdown && !notebookEditorFocused",
"group": "navigation"
},
{
"command": "markdown.showLockedPreviewToSide",
"when": "editorLangId == markdown && !notebookEditorFocused",
"group": "navigation"
},
{
"command": "markdown.showSource",
"when": "markdownPreviewFocus",
"group": "navigation"
},
{
"command": "markdown.showPreviewSecuritySelector",
"when": "editorLangId == markdown && !notebookEditorFocused"
},
{
"command": "markdown.showPreviewSecuritySelector",
"when": "markdownPreviewFocus"
},
{
"command": "markdown.preview.toggleLock",
"when": "markdownPreviewFocus"
},
{
"command": "markdown.preview.refresh",
"when": "editorLangId == markdown && !notebookEditorFocused"
},
{
"command": "markdown.preview.refresh",
"when": "markdownPreviewFocus"
}
]
},
"keybindings": [
{
"command": "markdown.showPreview",
"key": "shift+ctrl+v",
"mac": "shift+cmd+v",
"when": "editorLangId == markdown && !notebookEditorFocused"
},
{
"command": "markdown.showPreviewToSide",
"key": "ctrl+k v",
"mac": "cmd+k v",
"when": "editorLangId == markdown && !notebookEditorFocused"
}
],
"configuration": {
"type": "object",
"title": "Markdown",
"order": 20,
"properties": {
"markdown.styles": {
"type": "array",
"items": {
"type": "string"
},
"default": [],
"description": "%markdown.styles.dec%",
"scope": "resource"
},
"markdown.preview.breaks": {
"type": "boolean",
"default": false,
"description": "%markdown.preview.breaks.desc%",
"scope": "resource"
},
"markdown.preview.linkify": {
"type": "boolean",
"default": true,
"description": "%markdown.preview.linkify%",
"scope": "resource"
},
"markdown.preview.fontFamily": {
"type": "string",
"default": "-apple-system, BlinkMacSystemFont, 'Segoe WPC', 'Segoe UI', system-ui, 'Ubuntu', 'Droid Sans', sans-serif",
"description": "%markdown.preview.fontFamily.desc%",
"scope": "resource"
},
"markdown.preview.fontSize": {
"type": "number",
"default": 14,
"description": "%markdown.preview.fontSize.desc%",
"scope": "resource"
},
"markdown.preview.lineHeight": {
"type": "number",
"default": 1.6,
"description": "%markdown.preview.lineHeight.desc%",
"scope": "resource"
},
"markdown.preview.scrollPreviewWithEditor": {
"type": "boolean",
"default": true,
"description": "%markdown.preview.scrollPreviewWithEditor.desc%",
"scope": "resource"
},
"markdown.preview.markEditorSelection": {
"type": "boolean",
"default": true,
"description": "%markdown.preview.markEditorSelection.desc%",
"scope": "resource"
},
"markdown.preview.scrollEditorWithPreview": {
"type": "boolean",
"default": true,
"description": "%markdown.preview.scrollEditorWithPreview.desc%",
"scope": "resource"
},
"markdown.preview.doubleClickToSwitchToEditor": {
"type": "boolean",
"default": true,
"description": "%markdown.preview.doubleClickToSwitchToEditor.desc%",
"scope": "resource"
},
"markdown.preview.openMarkdownLinks": {
"type": "string",
"default": "inPreview",
"description": "%configuration.markdown.preview.openMarkdownLinks.description%",
"scope": "resource",
"enum": [
"inPreview",
"inEditor"
],
"enumDescriptions": [
"%configuration.markdown.preview.openMarkdownLinks.inPreview%",
"%configuration.markdown.preview.openMarkdownLinks.inEditor%"
]
},
"markdown.links.openLocation": {
"type": "string",
"default": "currentGroup",
"description": "%configuration.markdown.links.openLocation.description%",
"scope": "resource",
"enum": [
"currentGroup",
"beside"
],
"enumDescriptions": [
"%configuration.markdown.links.openLocation.currentGroup%",
"%configuration.markdown.links.openLocation.beside%"
]
},
"markdown.trace": {
"type": "string",
"enum": [
"off",
"verbose"
],
"default": "off",
"description": "%markdown.trace.desc%",
"scope": "window"
}
}
},
"configurationDefaults": {
"[markdown]": {
"editor.wordWrap": "on",
"editor.quickSuggestions": false
}
},
"jsonValidation": [
{
"fileMatch": "package.json",
"url": "./schemas/package.schema.json"
}
],
"markdown.previewStyles": [
"./media/markdown.css",
"./media/highlight.css"
],
"markdown.previewScripts": [
"./media/index.js"
],
"customEditors": [
{
"viewType": "vscode.markdown.preview.editor",
"displayName": "Markdown Preview (Experimental)",
"priority": "option",
"selector": [
{
"filenamePattern": "*.md"
}
]
}
]
},
"scripts": {
"compile": "gulp compile-extension:markdown-language-features && npm run build-preview && npm run build-notebook",
"watch": "npm run build-preview && gulp watch-extension:markdown-language-features",
"vscode:prepublish": "npm run build-ext && npm run build-preview",
"build-ext": "node ../../node_modules/gulp/bin/gulp.js --gulpfile ../../build/gulpfile.extensions.js compile-extension:markdown-language-features ./tsconfig.json",
"build-preview": "npx webpack-cli --mode production",
"build-notebook": "npx webpack-cli --config webpack.notebook --mode production",
"compile-web": "npx webpack-cli --config extension-browser.webpack.config --mode none",
"watch-web": "npx webpack-cli --config extension-browser.webpack.config --mode none --watch --info-verbosity verbose"
},
"dependencies": {
"highlight.js": "^10.4.1",
"markdown-it": "^12.0.3",
"markdown-it-front-matter": "^0.2.1",
"vscode-extension-telemetry": "0.1.1",
"vscode-nls": "^4.0.0"
},
"devDependencies": {
"@types/highlight.js": "10.1.0",
"@types/lodash.throttle": "^4.1.3",
"@types/markdown-it": "0.0.2",
"@types/node": "^12.19.9",
"lodash.throttle": "^4.1.1"
},
"repository": {
"type": "git",
"url": "https://github.com/microsoft/vscode.git"
}
}

View File

@ -439,6 +439,9 @@ class MarkdownPreview extends Disposable implements WebviewResourceProvider {
if (hrefPath[0] !== '/') {
// Fix #93691, use this.resource.fsPath instead of this.resource.path
hrefPath = path.join(path.dirname(this.resource.fsPath), hrefPath);
} else {
// Handle any normalized file paths
hrefPath = vscode.Uri.parse(hrefPath.replace('/file', '')).fsPath;
}
const config = vscode.workspace.getConfiguration('markdown', this.resource);

View File

@ -216,7 +216,7 @@ export class MarkdownEngine {
const src = token.attrGet('src');
if (src) {
env.containingImages.push({ src });
env.containingImages?.push({ src });
const imgHash = hash(src);
token.attrSet('id', `image-hash-${imgHash}`);
}

View File

@ -0,0 +1,27 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
const path = require('path');
module.exports = {
entry: {
index: './notebook/index.ts'
},
module: {
rules: [
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /node_modules/
}
]
},
resolve: {
extensions: ['.tsx', '.ts', '.js']
},
output: {
filename: '[name].js',
path: path.resolve(__dirname, 'notebook-out')
}
};