From 5b47e14b54df54df3604bc38d382c9a4d58a17d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20Str=C3=B6mberg?= Date: Wed, 8 Dec 2021 16:56:26 +0100 Subject: [PATCH] Add warning when Clojure extension is detected Fixes #1427 Fixes #1426 --- CHANGELOG.md | 4 +++- src/extension.ts | 15 ++++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a3a24be19..47a287488 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,9 @@ Changes to Calva. ## [Unreleased] -- Fix: [ Babashka Jack-In REPL doesn't show eval errors](https://github.com/BetterThanTomorrow/calva/issues/1413) +- Fix: [Babashka Jack-In REPL doesn't show eval errors](https://github.com/BetterThanTomorrow/calva/issues/1413) +- [Inform about conflict with the Clojure extension](https://github.com/BetterThanTomorrow/calva/issues/1427) + ## [2.0.228] - 2021-12-02 - Revert: Parinfer Experimental diff --git a/src/extension.ts b/src/extension.ts index e661f2739..b3ad731d8 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -99,13 +99,14 @@ async function activate(context: vscode.ExtensionContext) { const pareEditExtension = vscode.extensions.getExtension('cospaia.paredit-revived'); const cwExtension = vscode.extensions.getExtension('tonsky.clojure-warrior'); const vimExtension = vscode.extensions.getExtension('vscodevim.vim'); - const cwConfig = vscode.workspace.getConfiguration('clojureWarrior'); + const clojureExtension = vscode.extensions.getExtension('avli.clojure'); const customCljsRepl = config.getConfig().customCljsRepl; const replConnectSequences = config.getConfig().replConnectSequences; const BUTTON_GOTO_DOC = "Open the docs"; const BUTTON_OK = "Got it"; const VIM_DOC_URL = "https://calva.io/vim/"; const VIEWED_VIM_DOCS = "viewedVimDocs"; + const DONT_SHOW_CLOJURE_EXT_NAG = "dontShowClojureExtNag"; const CONNECT_SEQUENCES_DOC_URL = "https://calva.io/connect-sequences/"; const CALVA_DOCS_URL = "https://calva.io/"; const VIEWED_CALVA_DOCS = "viewedCalvaDocs"; @@ -313,6 +314,18 @@ async function activate(context: vscode.ExtensionContext) { } } + if (clojureExtension) { + chan.appendLine(`The Clojure Extension is installed.\n`); + if (!context.globalState.get(DONT_SHOW_CLOJURE_EXT_NAG)) { + vscode.window.showWarningMessage("You have the Clojure extension installed. Please note that it will conflict with Calva.", "Don't show again", 'OK') + .then(v => { + if (v == "Don't show again") { + context.globalState.update(DONT_SHOW_CLOJURE_EXT_NAG, true); + } + }) + } + } + state.analytics().logPath("/activated").logEvent("LifeCycle", "Activated").send(); if (!cwExtension) {