Skip to content

Commit

Permalink
Merge branch dev into published
Browse files Browse the repository at this point in the history
  • Loading branch information
PEZ committed Nov 10, 2022
2 parents a8f4395 + 7936c04 commit 3294140
Show file tree
Hide file tree
Showing 13 changed files with 64 additions and 14 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ Changes to Calva.

## [Unreleased]

## [2.0.319] - 2022-11-10

- Fix: [The indenter fails matching cljfmt rules on qualified symbols](https://github.com/BetterThanTomorrow/calva/issues/1956)
- [Add info about cider-nrepl docs to calva.io/connect](https://github.com/BetterThanTomorrow/calva/issues/1955)
- [Inform about Calva version on startup](https://github.com/BetterThanTomorrow/calva/issues/1954)
- Fix: [Calva docs site theme color not used](https://github.com/BetterThanTomorrow/calva/issues/1960)

## [2.0.318] - 2022-11-08

- Fix: [Calva doesn't show action buttons in error message boxes](https://github.com/BetterThanTomorrow/calva/issues/1949)
Expand Down
4 changes: 4 additions & 0 deletions docs/site/connect.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ All this said, I still recommend you challenge the conclusion that you can't use
!!! Note
There is a Calva command for copying the Jack-in command line to the clipboard.

### Starting the REPL from application code?

If your project is setup so that the REPL server is started by the application code, you will need to get the cider-nrepl middleware in place. See the cider-nrepl docs about [embedding nREPL in your application](https://docs.cider.mx/cider-nrepl/usage.html#via-embedding-nrepl-in-your-application).

## Monorepos / multiple Clojure projects in one workspace

If the workspace is a monorepo, Polylith repo or just a repository with more than one Clojure project, Calva will start the connect sequence with prompting for which project to start/connect to.
Expand Down
2 changes: 1 addition & 1 deletion docs/site/stylesheets/extra.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
:root {
[data-md-color-scheme="default"] {
--md-primary-fg-color: rgb(219, 149, 80);
--md-accent-fg-color: rgb(144, 180, 254);
}
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "Calva: Clojure & ClojureScript Interactive Programming",
"description": "Integrated REPL, formatter, Paredit, and more. Powered by cider-nrepl and clojure-lsp.",
"icon": "assets/calva.png",
"version": "2.0.318",
"version": "2.0.319",
"publisher": "betterthantomorrow",
"author": {
"name": "Better Than Tomorrow",
Expand Down
3 changes: 2 additions & 1 deletion src/cljs-lib/src/calva/fmt/formatter.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
[calva.js-utils :refer [jsify cljify]]
[calva.fmt.util :as util]
[calva.parse :refer [parse-clj-edn]]
[clojure.string]))
[clojure.string]
[clojure.core :as c]))

(defn- merge-default-indents
"Merges onto default-indents.
Expand Down
4 changes: 2 additions & 2 deletions src/cursor-doc/indent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export function collectIndents(

const pattern =
isList &&
_.find(_.keys(rules), (pattern) => pattern === token || testCljRe(pattern, token));
_.find(_.keys(rules), (p) => testCljRe(`#"^(.*/)?${p}$"`, token) || testCljRe(p, token));
const indentRule = pattern ? rules[pattern] : [];
indents.unshift({
first: token,
Expand Down Expand Up @@ -140,7 +140,7 @@ export function collectIndents(

const testCljRe = (re, str) => {
const matches = re.match(/^#"(.*)"$/);
return matches && RegExp(matches[1]).test(str);
return matches && RegExp(matches[1]).test(str.replace(/^.*\//, ''));
};

/** Returns the expected newline indent for the given position, in characters. */
Expand Down
1 change: 0 additions & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,6 @@ async function activate(context: vscode.ExtensionContext) {
greetings.activationGreetings(chan);

if (vimExtension) {
chan.appendLine(`VIM Extension detected. Please read: ${VIM_DOC_URL} now and then.\n`);
if (!context.globalState.get(VIEWED_VIM_DOCS)) {
void vscode.window
.showInformationMessage(
Expand Down
8 changes: 4 additions & 4 deletions src/greet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ export function activationGreetings(chan: vscode.OutputChannel) {
chan.appendLine(` clojure-lsp version configured: ${clojureLspVersion}`);
}
chan.appendLine('');
chan.appendLine('If you are new to Calva, please consider starting with the command:');
chan.appendLine(' **Calva: Fire up the Getting Started REPL**');
chan.appendLine(' https://calva.io/getting-started/');
chan.appendLine('If you are new to Calva, please see: https://calva.io/getting-started/');
chan.appendLine(' And please consider the command: **Calva: Fire up the Getting Started REPL**');
chan.appendLine('');
chan.appendLine(
'(See `showCalvaSaysOnStart` in Settings to control the auto-showing of this message panel.)'
'Calva version used: v' +
vscode.extensions.getExtension('betterthantomorrow.calva').packageJSON.version
);
}
1 change: 0 additions & 1 deletion src/lsp/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,6 @@ function quickPick(message: string, actions: { title: string }[]): Promise<{ tit
function sayClientVersionInfo(serverVersion: string, serverInfo: any) {
const cljKondoVersion = serverInfo['clj-kondo-version'];
const calvaSaysChannel = state.outputChannel();
calvaSaysChannel.appendLine('');
calvaSaysChannel.appendLine(`clojure-lsp version used: ${serverVersion}`);
calvaSaysChannel.appendLine(`clj-kondo version used: ${cljKondoVersion}`);
}
Expand Down
2 changes: 1 addition & 1 deletion test-data/.vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@
"titleBar.inactiveBackground": "#90B4FEd5",
"titleBar.inactiveForeground": "#13172299"
},
"calva.fmt.configPath": "projects/pirate-lang/.cljfmt.edn"
"calva.fmt.configPath": "cljfmt.edn"
}
1 change: 1 addition & 0 deletions test-data/cljfmt.edn
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{:indents {inner-0-form [[:inner 0]]}}
39 changes: 39 additions & 0 deletions test-data/indenter-cases.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#_:clj-kondo/ignore
(ns foo
{:clj-kondo/config '{:linters {:unresolved-symbol {:level :off}
:unused-bindings {:level :off}}}})

; Should indent like `(def ...`
(foo/defbars body
[:body {}])

; Should not indent like `(def ...`

(foo/ddefbars body
[:body {}])


; Should indent like `(let ...`
(clojure.core/let [x :x]
x)

; Should not indent like `(let ...`
(clojure.core-let [x :x]
x)

; Should indent using `[[:inner 0]]`
; Assuming a custom `cljfmt.edn` is used and it has:
; `{:indents {inner-0-form [[:inner 0]]}}`
(foo/inner-0-form :a
ss
:foo)

; Should not indent using `[[:inner 0]]`
(foo-inner-0-form :a
ss
:foo)

; Should indent like
(deftype MyType [arg1 arg2]
IMyProto
(method1 [this] |(print "hello")))

0 comments on commit 3294140

Please sign in to comment.