mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-28 04:23:32 +01:00
Markdown: Open Preview - doesn't work for *.prompt.md files (#270417)
This commit is contained in:
committed by
GitHub
parent
0f5bcca45d
commit
cf1a93be3f
@@ -21,6 +21,7 @@ import { ExtensionContentSecurityPolicyArbiter } from './preview/security';
|
||||
import { loadDefaultTelemetryReporter } from './telemetryReporter';
|
||||
import { MdLinkOpener } from './util/openDocumentLink';
|
||||
import { registerUpdatePastedLinks } from './languageFeatures/updateLinksOnPaste';
|
||||
import { markdownLanguageIds } from './util/file';
|
||||
|
||||
export function activateShared(
|
||||
context: vscode.ExtensionContext,
|
||||
@@ -54,7 +55,7 @@ function registerMarkdownLanguageFeatures(
|
||||
commandManager: CommandManager,
|
||||
parser: IMdParser,
|
||||
): vscode.Disposable {
|
||||
const selector: vscode.DocumentSelector = { language: 'markdown', scheme: '*' };
|
||||
const selector: vscode.DocumentSelector = markdownLanguageIds;
|
||||
return vscode.Disposable.from(
|
||||
// Language features
|
||||
registerDiagnosticSupport(selector, commandManager),
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
import * as vscode from 'vscode';
|
||||
import { CommandManager } from '../commandManager';
|
||||
import { isMarkdownFile } from '../util/file';
|
||||
|
||||
|
||||
// Copied from markdown language service
|
||||
@@ -88,7 +89,7 @@ function registerMarkdownStatusItem(selector: vscode.DocumentSelector, commandMa
|
||||
|
||||
const update = () => {
|
||||
const activeDoc = vscode.window.activeTextEditor?.document;
|
||||
const markdownDoc = activeDoc?.languageId === 'markdown' ? activeDoc : undefined;
|
||||
const markdownDoc = activeDoc && isMarkdownFile(activeDoc) ? activeDoc : undefined;
|
||||
|
||||
const enabled = vscode.workspace.getConfiguration('markdown', markdownDoc).get(enabledSettingId);
|
||||
if (enabled) {
|
||||
|
||||
Reference in New Issue
Block a user