Commit 303477d
Fix slurp-action-test against newer LSP4IJ versions
The test was failing in CI because newer LSP4IJ versions broke the
test setup in two independent ways. Both are addressed here.
1. ClojureLanguageServerFactory throws UnsupportedOperationException
on plugin instantiation:
Caused by: java.lang.UnsupportedOperationException:
createLanguageServerSettingsContributor
(com.github.clojure-lsp.intellij.extension.language-server-factory/
ClojureLanguageServerFactory_createLanguageServerSettingsContributor
not defined?)
LSP4IJ added `createServerInstaller` and
`createLanguageServerSettingsContributor` as default interface
methods. Our factory uses `def-extension` (clj4intellij), which is
`gen-class`-backed; gen-class always overrides interface methods,
never falling through to the Java default. Adding explicit stubs
that return `nil` restores the upstream-default behaviour.
2. Once the factory loads, the LSP server still fails to start:
Caused by: java.lang.UnsupportedOperationException:
Failed to map temp:///src
(filesystem com.intellij.openapi.vfs.ex.temp.TempFileSystem)
into nio Path
at LanguageServerWrapper.<init>
<- FileSystemWatcherManager.getProjectBasePath
<- VirtualFile.toNioPath
LSP4IJ's `FileSystemWatcherManager` requires the project base to
resolve to a real filesystem `Path`. The previous test used
`clj4intellij.test/setup`, which builds a `LightProjectDescriptor`
exposing the project under the in-memory `TempFileSystem` — for
which `toNioPath` throws.
Bump `clj4intellij` to 0.9.0 (which adds `setup-heavy`) and switch
`test_utils/setup-test-project` to it. The heavy fixture uses
`IdeaTestFixtureFactory.createFixtureBuilder` +
`createTempDirTestFixture`, giving the project a real disk-backed
path. Also rename the test project to `clojure-sample-project`
(heavy fixtures use the name as the on-disk directory and IntelliJ
sanitizes dots to underscores).
🤖 Generated with [eca](https://eca.dev)
Co-Authored-By: eca-agent <git@eca.dev>1 parent 496350e commit 303477d
5 files changed
Lines changed: 21 additions & 3 deletions
File tree
- src
- main/clojure/com/github/clojure_lsp/intellij/extension
- test/clojure/com/github/clojure_lsp/intellij
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
5 | 8 | | |
6 | 9 | | |
7 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| |||
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
88 | 95 | | |
89 | 96 | | |
90 | 97 | | |
| |||
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
26 | 29 | | |
27 | 30 | | |
28 | 31 | | |
| |||
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
79 | 84 | | |
80 | 85 | | |
81 | 86 | | |
| |||
0 commit comments