Skip to content

Commit

Permalink
Exclude repl from LSP analysis
Browse files Browse the repository at this point in the history
Fixes #1250
  • Loading branch information
ericdallo committed Jan 18, 2022
1 parent 44a43cb commit 72d4d53
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ Changes to Calva.
## [Unreleased]
- [Add custom commands from libraries](https://github.com/BetterThanTomorrow/calva/pull/1442)

- [Exclude REPL output window from LSP analysis](https://github.com/BetterThanTomorrow/calva/issues/1250)

## [2.0.234] - 2022-01-16
- [Improve LSP startup feedback on status bar](https://github.com/BetterThanTomorrow/calva/pull/1454)
- [Fix errors in test output when fixtures throw exceptions](https://github.com/BetterThanTomorrow/calva/issues/1456).
Expand Down
20 changes: 19 additions & 1 deletion src/lsp/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import * as path from 'path';
import * as state from '../state';
import { provideHover } from '../providers/hover';
import { provideSignatureHelp } from '../providers/signature';
import * as cider from '../nrepl/cider'
import { isResultsDoc } from '../results-output/results-doc';

const LSP_CLIENT_KEY = 'lspClient';
const RESOLVE_MACRO_AS_COMMAND = 'resolve-macro-as';
Expand Down Expand Up @@ -64,6 +64,24 @@ function createClient(clojureLspPath: string): LanguageClient {
"keep-require-at-start?": true,
},
middleware: {
didOpen: async (document, next) => {
if (isResultsDoc(document)) {
return;
}
return next(document);
},
didSave: async (document, next) => {
if (isResultsDoc(document)) {
return;
}
return next(document);
},
didChange: async (change, next) => {
if (isResultsDoc(change.document)) {
return;
}
return next(change);
},
provideLinkedEditingRange: async (_document, _position, _token, _next): Promise<vscode.LinkedEditingRanges> => {
return null;
},
Expand Down

0 comments on commit 72d4d53

Please sign in to comment.