Skip to content

Commit

Permalink
Add warning when Clojure extension is detected
Browse files Browse the repository at this point in the history
Fixes #1427
Fixes #1426
  • Loading branch information
PEZ committed Dec 8, 2021
1 parent 8656298 commit 5b47e14
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 14 additions & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 5b47e14

Please sign in to comment.