Skip to content

Commit

Permalink
fix: open standard alone file failed, close #98
Browse files Browse the repository at this point in the history
  • Loading branch information
0x-jerry committed Oct 6, 2024
1 parent 38fe9b5 commit d0615fb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/extension.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
// The module 'vscode' contains the VS Code extensibility API
// Import the module and reference it with the alias vscode in your code below
import { type ExtensionContext, languages, window } from 'vscode';
import { type ExtensionContext, languages, window, workspace } from 'vscode';
import { registerCommands } from './commands';
import { HexoCompletionProvider } from './hexoCompletionProvider';
import MarkdownIt from 'markdown-it';
import plugin from './markdownItHexoResource';
import { getConfig, ConfigProperties } from './configs';
import { registerTreeViews } from './treeViews';

export function activate(context: ExtensionContext) {
// Only activate when open with a workspace folder, close #98.
if (!workspace.workspaceFolders?.length) {
return;
}

const selectors = [
{ language: 'markdown', scheme: 'file' },
{ language: 'markdown', scheme: 'untitled' },
Expand Down

0 comments on commit d0615fb

Please sign in to comment.