Merge from vscode merge-base (#22780)

* Revert "Revert "Merge from vscode merge-base (#22769)" (#22779)"

This reverts commit 47a1745180.

* Fix notebook download task

* Remove done call from extensions-ci
This commit is contained in:
Karl Burtram
2023-04-19 21:48:46 -07:00
committed by GitHub
parent decbe8dded
commit e7d3d047ec
2389 changed files with 92155 additions and 42602 deletions

View File

@@ -5,8 +5,9 @@
import * as vscode from 'vscode';
import { Command } from '../commandManager';
import { MarkdownEngine } from '../markdownEngine';
import { MdTableOfContentsProvider } from '../tableOfContents';
import { openDocumentLink } from '../util/openDocumentLink';
import { Schemes } from '../util/schemes';
type UriComponents = {
readonly scheme?: string;
@@ -48,18 +49,18 @@ export class OpenDocumentLinkCommand implements Command {
}
public constructor(
private readonly engine: MarkdownEngine
private readonly tocProvider: MdTableOfContentsProvider,
) { }
public async execute(args: OpenDocumentLinkArgs) {
const fromResource = vscode.Uri.parse('').with(args.fromResource);
const targetResource = reviveUri(args.parts).with({ fragment: args.fragment });
return openDocumentLink(this.engine, targetResource, fromResource);
return openDocumentLink(this.tocProvider, targetResource, fromResource);
}
}
function reviveUri(parts: any) {
if (parts.scheme === 'file') {
if (parts.scheme === Schemes.file) {
return vscode.Uri.file(parts.path);
}
return vscode.Uri.parse('').with(parts);

View File

@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import { Command } from '../commandManager';
import { MarkdownEngine } from '../markdownEngine';
import { MarkdownItEngine } from '../markdownEngine';
import { MarkdownPreviewManager } from '../preview/previewManager';
export class RefreshPreviewCommand implements Command {
@@ -12,7 +12,7 @@ export class RefreshPreviewCommand implements Command {
public constructor(
private readonly webviewManager: MarkdownPreviewManager,
private readonly engine: MarkdownEngine
private readonly engine: MarkdownItEngine
) { }
public execute() {

View File

@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import { Command } from '../commandManager';
import { MarkdownEngine } from '../markdownEngine';
import { MarkdownItEngine } from '../markdownEngine';
import { MarkdownPreviewManager } from '../preview/previewManager';
export class ReloadPlugins implements Command {
@@ -12,7 +12,7 @@ export class ReloadPlugins implements Command {
public constructor(
private readonly webviewManager: MarkdownPreviewManager,
private readonly engine: MarkdownEngine,
private readonly engine: MarkdownItEngine,
) { }
public execute(): void {

View File

@@ -4,17 +4,17 @@
*--------------------------------------------------------------------------------------------*/
import { Command } from '../commandManager';
import { MarkdownEngine } from '../markdownEngine';
import { SkinnyTextDocument } from '../workspaceContents';
import { MarkdownItEngine } from '../markdownEngine';
import { ITextDocument } from '../types/textDocument';
export class RenderDocument implements Command {
public readonly id = 'markdown.api.render';
public constructor(
private readonly engine: MarkdownEngine
private readonly engine: MarkdownItEngine
) { }
public async execute(document: SkinnyTextDocument | string): Promise<string> {
public async execute(document: ITextDocument | string): Promise<string> {
return (await (this.engine.render(document))).html;
}
}