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 0877850 commit 2210547
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Changes to Calva.

## [Unreleased]

- [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
18 changes: 18 additions & 0 deletions src/lsp/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,24 @@ function createClient(clojureLspPath: string): LanguageClient {
"keep-require-at-start?": true,
},
middleware: {
didOpen: async (document, next) => {
if (document.uri.path.endsWith(config.REPL_FILE_EXT)) {
return;
}
return next(document);
},
didSave: async (document, next) => {
if (document.uri.path.endsWith(config.REPL_FILE_EXT)) {
return;
}
return next(document);
},
didChange: async (change, next) => {
if (change.document.uri.path.endsWith(config.REPL_FILE_EXT)) {
return;
}
return next(change);
},
provideLinkedEditingRange: async (_document, _position, _token, _next): Promise<vscode.LinkedEditingRanges> => {
return null;
},
Expand Down

0 comments on commit 2210547

Please sign in to comment.