Skip to content

Commit e9b70f7

Browse files
committed
Merge branch 'dev' into published
2 parents 7afc80c + 0863958 commit e9b70f7

File tree

10 files changed

+46
-14
lines changed

10 files changed

+46
-14
lines changed

.circleci/config.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,6 @@ jobs:
118118
environment:
119119
# Required:
120120
DISPLAY: ':99'
121-
# Configurable
122-
ATOM_LINT_WITH_BUNDLED_NODE: 'true'
123-
APM_TEST_PACKAGES: ''
124-
ATOM_CHANNEL: 'stable'
125121
docker:
126122
- image: arcanemagus/atom-docker-ci
127123
steps:
@@ -367,6 +363,7 @@ jobs:
367363
name: Install mkdocs and mkdocs-material
368364
command: |
369365
pip install -r requirements.txt
366+
# Overwrite with insiders version of mkdocs-material
370367
pip install git+https://${GITHUB_MKDOCS_MATERIAL_TOKEN}@github.com/squidfunk/mkdocs-material-insiders.git
371368
- run:
372369
name: Deploy docs

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ Changes to Calva.
44

55
## [Unreleased]
66

7+
## [2.0.311] - 2022-10-27
8+
9+
- Fix: [Drag sexps in value part of doseq sometimes jumps 2 sexps instead of 1](https://github.com/BetterThanTomorrow/calva/issues/1914)
10+
- Fix: [Can't do formatting code from Calva: Fire up the Getting Started REPL on hello_repl.clj](https://github.com/BetterThanTomorrow/calva/issues/1918)
11+
- Fix: [Calva: Open REPL snippets User config.edn couldn't create the file if parent folders doesn't exist](https://github.com/BetterThanTomorrow/calva/issues/1916)
12+
- Calva development: [Use requirements.txt in CI for publishing docs](https://github.com/BetterThanTomorrow/calva/issues/1913)
13+
- Bump deps.clj to v1.11.1.1182
14+
715
## [2.0.310] - 2022-10-24
816

917
- Calva development: [Refactor `extension.ts` for less boilerplate and improved readability](https://github.com/BetterThanTomorrow/calva/issues/1906)

deps-clj-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v1.11.1.1165
1+
v1.11.1.1182

deps.clj.jar

13.1 KB
Binary file not shown.

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"displayName": "Calva: Clojure & ClojureScript Interactive Programming",
44
"description": "Integrated REPL, formatter, Paredit, and more. Powered by cider-nrepl and clojure-lsp.",
55
"icon": "assets/calva.png",
6-
"version": "2.0.310",
6+
"version": "2.0.311",
77
"publisher": "betterthantomorrow",
88
"author": {
99
"name": "Better Than Tomorrow",

src/config.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import * as vscode from 'vscode';
22
import * as os from 'os';
33
import * as fs from 'fs';
4+
import * as path from 'path';
45
import { customREPLCommandSnippet } from './evaluate';
56
import { ReplConnectSequence } from './nrepl/connectSequence';
67
import { PrettyPrintingOptions } from './printer';
@@ -42,13 +43,13 @@ const userConfigFileUri = vscode.Uri.joinPath(
4243
);
4344

4445
async function openCalvaConfigEdn() {
45-
const configPath = state.resolvePath('.calva/config.edn');
4646
return fs.promises
4747
.access(userConfigFileUri.fsPath, fs.constants.F_OK)
4848
.then(async () => await vscode.window.showTextDocument(userConfigFileUri))
4949
.catch(async (error) => {
5050
if (error.code === 'ENOENT') {
5151
try {
52+
await fs.promises.mkdir(path.dirname(userConfigFileUri.fsPath), { recursive: true });
5253
await fs.promises.writeFile(
5354
userConfigFileUri.fsPath,
5455
'{:customREPLHoverSnippets []\n :customREPLCommandSnippets []}'
@@ -58,9 +59,7 @@ async function openCalvaConfigEdn() {
5859
console.error('Error creating user config.edn', error);
5960
}
6061
} else {
61-
void vscode.window.showErrorMessage(
62-
'Could not find a config.edn file in the workspace. Please create one and try again.'
63-
);
62+
void vscode.window.showErrorMessage('Could not open user config.edn. ' + error.message);
6463
}
6564
});
6665
}

src/cursor-doc/paredit.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1181,7 +1181,7 @@ function isInPairsList(cursor: LispTokenCursor, pairForms: string[]): boolean {
11811181
if (opening.endsWith('[')) {
11821182
probeCursor.backwardUpList();
11831183
probeCursor.backwardList();
1184-
if (probeCursor.getPrevToken().raw.endsWith('{')) {
1184+
if (!probeCursor.getPrevToken().raw.endsWith('(')) {
11851185
return false;
11861186
}
11871187
const fn = probeCursor.getFunctionName();

src/extension-test/unit/cursor-doc/paredit-test.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -830,6 +830,34 @@ describe('paredit', () => {
830830
await paredit.dragSexprBackward(a);
831831
expect(textAndSelection(a)).toEqual(textAndSelection(b));
832832
});
833+
834+
it('drags single sexpr forward in bound vectors', async () => {
835+
const a = docFromTextNotation(`(b [x [1| 2 3]])`);
836+
const b = docFromTextNotation(`(b [x [2 1| 3]])`);
837+
await paredit.dragSexprForward(a, ['b']);
838+
expect(textAndSelection(a)).toEqual(textAndSelection(b));
839+
});
840+
841+
it('drags single sexpr backward in bound vectors', async () => {
842+
const a = docFromTextNotation(`(b [x [1 2 |3]])`);
843+
const b = docFromTextNotation(`(b [x [1 |3 2]])`);
844+
await paredit.dragSexprBackward(a, ['b']);
845+
expect(textAndSelection(a)).toEqual(textAndSelection(b));
846+
});
847+
848+
it('drags single sexpr forward in bound lists', async () => {
849+
const a = docFromTextNotation(`(b [x (1 2| 3)])`);
850+
const b = docFromTextNotation(`(b [x (1 3 2|)])`);
851+
await paredit.dragSexprForward(a, ['b']);
852+
expect(textAndSelection(a)).toEqual(textAndSelection(b));
853+
});
854+
855+
it('drags single sexpr backward in bound lists', async () => {
856+
const a = docFromTextNotation(`(b [x (1 2 |3)])`);
857+
const b = docFromTextNotation(`(b [x (1 |3 2)])`);
858+
await paredit.dragSexprBackward(a, ['b']);
859+
expect(textAndSelection(a)).toEqual(textAndSelection(b));
860+
});
833861
});
834862

835863
describe('backwardUp - one line', () => {

src/state.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ export async function initProjectDir(uri?: vscode.Uri): Promise<void> {
184184
export function resolvePath(filePath?: string): vscode.Uri {
185185
const root = getProjectWsFolder();
186186

187-
if (root.uri.scheme !== 'file') {
187+
if (root && root.uri.scheme !== 'file') {
188188
return vscode.Uri.joinPath(root.uri, filePath);
189189
}
190190

0 commit comments

Comments
 (0)