Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue 391 #392

Merged
merged 5 commits into from
Oct 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
Changes to Calva.

## [Unreleased]
- [Remove warning that extensions use the `vscode-resource:` scheme directly](https://github.com/BetterThanTomorrow/calva/issues/391)
- [Use of undeclared var in REPL window resets the namespace](https://github.com/BetterThanTomorrow/calva/issues/257)
- [calva.evalCurrentTopLevelFormInREPLWindow fails in specific condition](https://github.com/BetterThanTomorrow/calva/issues/374)
- [Fix bugs in comment form selection](https://github.com/BetterThanTomorrow/calva/issues/374)

## [2.0.47] - 10.10.2019
- [Support Jack-in without file open for single-rooted workspace](https://github.com/BetterThanTomorrow/calva/issues/366)
Expand Down
223 changes: 6 additions & 217 deletions package-lock.json

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

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1391,8 +1391,7 @@
"release": "npm i && npm run clean && npm run update-grammar && npm run release-cljs && webpack --mode production",
"postrelease": "rimraf ./out/cljs-lib",
"vscode:prepublish": "npm run release",
"bump-version": "npm set git-tag-version false && npm version patch",
"postinstall": "node ./node_modules/vscode/bin/install"
"bump-version": "npm set git-tag-version false && npm version patch"
},
"dependencies": {
"@types/escape-html": "0.0.20",
Expand Down Expand Up @@ -1444,7 +1443,7 @@
"typescript": "^3.5.1",
"url-loader": "^1.1.2",
"vsce": "^1.67.1",
"vscode": "^1.1.34",
"@types/vscode": "^1.30.0",
"webpack": "^4.33.0",
"webpack-cli": "^3.3.5"
}
Expand Down
18 changes: 4 additions & 14 deletions src/calva-fmt/src/docmirror/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ let documents = new Map<vscode.TextDocument, model.LineInputModel>();

let registered = false;

function processChanges(document: vscode.TextDocument, contentChanges: vscode.TextDocumentContentChangeEvent[]) {
let model = documents.get(document)
for(let change of contentChanges) {
function processChanges(event: vscode.TextDocumentChangeEvent) {
let model = documents.get(event.document)
for(let change of event.contentChanges) {
// vscode may have a \r\n marker, so it's line offsets are all wrong.
let myStartOffset = model.getOffsetForLine(change.range.start.line)+change.range.start.character
let myEndOffset = model.getOffsetForLine(change.range.end.line)+change.range.end.character
Expand All @@ -21,16 +21,6 @@ function processChanges(document: vscode.TextDocument, contentChanges: vscode.Te
model.dirtyLines = []
model.insertedLines.clear()
model.deletedLines.clear();

// this is an important diagnostic check to ensure the models haven't de-synced, but it MUST be removed before release.
// let mtext = model.getText(0, model.maxOffset)
// let dtext = document.getText().replace(/\r\n/g,"\n");
// if(mtext != dtext) {
// vscode.window.showErrorMessage("document hozed")
// console.error(mtext)
// console.error("vs")
// console.error(dtext)
// }
}

export function getDocument(doc: vscode.TextDocument) {
Expand Down Expand Up @@ -82,7 +72,7 @@ export function activate() {

vscode.workspace.onDidChangeTextDocument(e => {
if (addDocument(e.document)) {
processChanges(e.document, e.contentChanges)
processChanges(e);
}
});
}
Loading