Skip to content

Commit

Permalink
Automatically open QMD files in visual/source editor if specified (#577)
Browse files Browse the repository at this point in the history
* auto open in default or specified viewer

* clean up for clarity

* use onDidChangeActiveTextEditor

* Apply suggestions from code review

Co-authored-by: Davis Vaughan <[email protected]>

* changes from review

* move listener to VisualEditorProvider

* only have one editor listener

* check if this is a diff

* track editor associations

* fix typing error

* update from review

* move everything to Tab API

* clean up unused code

* linting

* only watch opened tabs

* preserve focus on tab swaps

* Apply suggestions from code review

Co-authored-by: Davis Vaughan <[email protected]>

* add comments

---------

Co-authored-by: Davis Vaughan <[email protected]>
  • Loading branch information
isabelizimm and DavisVaughan authored Oct 30, 2024
1 parent 914c4db commit 227af78
Show file tree
Hide file tree
Showing 6 changed files with 214 additions and 108 deletions.
2 changes: 1 addition & 1 deletion apps/vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1383,7 +1383,7 @@
"@types/semver": "^7.3.13",
"@types/tmp": "^0.2.3",
"@types/uuid": "^9.0.0",
"@types/vscode": "1.66.0",
"@types/vscode": "1.75.0",
"@types/which": "^2.0.2",
"@typescript-eslint/eslint-plugin": "^5.45.0",
"@typescript-eslint/parser": "^5.45.0",
Expand Down
6 changes: 3 additions & 3 deletions apps/vscode/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import { activateQuartoAssistPanel } from "./providers/assist/panel";
import { activateCommon } from "./extension";
import { activatePreview } from "./providers/preview/preview";
import { activateRender } from "./providers/render";
import { initQuartoContext, quartoContextUnavailable } from "quarto-core";
import { activateStatusBar } from "./providers/statusbar";
import { walkthroughCommands } from "./providers/walkthrough";
import { activateLuaTypes } from "./providers/lua-types";
Expand All @@ -33,11 +32,12 @@ import { activateEditor } from "./providers/editor/editor";
import { activateCopyFiles } from "./providers/copyfiles";
import { activateZotero } from "./providers/zotero/zotero";;
import { extensionHost } from "./host";
import { initQuartoContext } from "quarto-core";
import { configuredQuartoPath } from "./core/quarto";
import { activateDenoConfig } from "./providers/deno-config";

export async function activate(context: vscode.ExtensionContext) {

// create extension host
const host = extensionHost();

Expand Down Expand Up @@ -129,5 +129,5 @@ export async function activate(context: vscode.ExtensionContext) {

export async function deactivate() {
return deactivateLsp();
}
}

Loading

0 comments on commit 227af78

Please sign in to comment.