bsp-pants's People
bsp-pants's Issues
Duplicate content root causes java.lang.ClassNotFoundException when testing
To reproduce:
git clone -b duplicate-content-root https://github.com/olafurpg/intellij-bsp-pants
cd intellij-bsp-pants
./setup-bsp.sh
Once the setup-bsp.sh command completes, it should automatically launch IntelliJ with the imported BSP project. Open "B.scala" and click run in IntelliJ
I'm able to run the test correctly from the terminal with bloop
❯ cd ../intellij-bsp/duplicate/duplicate
❯ bloop test duplicate:b
b.B:
FOO
a.A@3a89cca1
+ b.B.foo 0.026s
BAR
a.A@66a0703c
+ b.B.bar 0.001s
Execution took 27ms
2 tests, 2 passed
All tests in b.B passed
===============================================
Total duration: 27ms
All 1 test suites passed.
===============================================
The IntelliJ event log contains the following line
12:03 Duplicate content roots detected: Path [/Users/lgeirsson/dev/intellij-bsp-pants/duplicate] of module [duplicate-project-root] was removed from modules [shared:]
The module that is used for the classpath in the run configuration is incorrect
When I select the ":shared" module it warns that the class "b.B" is not defined and I'm unable to run tests. There are no other modules that I can use to run tests.
BSP Run Configurations don't work
Package names doesn't correspond to directories structure, this may cause problems with resolve to classes from this file
Currently, IntelliJ warns that the package declaration does not correspond to the filename. This causes problems when creating new files because IntelliJ is unable to infer the correct package ...
statement. The only workaround is to manually type out the package statement when creating new files or refactoring.
Steps to reproduce
git clone -b package-filename https://github.com/olafurpg/bsp-pants
cd intellij-bsp-pants
./setup-bsp.sh
Open file "Main.scala" in IntelliJ and see the warning in IntelliJ
Run the "New Scala class" action to create a file "MissingPackage.scala". The generated file has no package bsp
statement
I expected the generated file to have the contents
package bsp
class MissingPackage { ... }
Failing to test BSP project with a long classpath in IntelliJ
Reproduce: https://github.com/olafurpg/intellij-bsp-pants/tree/hanging-build
Run: ./setup-bsp.sh
, it should automatically launch IntelliJ. If not, run "import project" in the directory ../intellij-bsp/src/src
Open MySuite.scala and click run
Worksheets don't compile when referencing symbols in the project
Repro: https://github.com/olafurpg/intellij-bsp-pants/tree/worksheets
Create a "scratch file" and write new foo.MySuite().x
and click "run". It fails with a compile error
I expected it to use the classpath from the BSP server.
Inner target depends on outer target
Highlighting issue for Java references to symbols in same directory
git clone -b wrong-module https://github.com/olafurpg/intellij-bsp-pants
cd intellij-bsp-pants
./setup-bsp.sh
Open the file "Helper2.java", see errors
I expected there to be no highlighting issues since the two files belong to the same module which has the enclosing directory as a source content root.
"Show bytecode" does not work with BSP project
To reproduce: Run "Show bytecode" command in any BSP project and get the following error
Reported in YouTrack https://youtrack.jetbrains.com/issue/SCL-16927
Working directory is incorrect when testing via IntelliJ
Reproduce: https://github.com/olafurpg/intellij-bsp-pants/tree/working-directory
Run
./setup-bsp.sh
cd ../intellji-bsp/src/src
Testing with Bloop in terminal
Works as expected with fix from scalameta/metals#1209 (requires changing the version of metals in setup-bsp.sh
)
bloop test src/test/scala/foo:foo
Compiling src/test/scala/foo:foo (1 Scala source)
Compiled src/test/scala/foo:foo (255ms)
MySuite:
Working directory: /Users/lgeirsson/dev/intellij-bsp-pants
Testing with IntelliJ via BSP project
It may be that we need to add more information to the BSP spec in order to fix this issue 🤔
BSP build is hanging and cannot be stopped
Bloop IO scheduler gets shut down after successful test run
First setup the repo like this
git clone -b io-scheduler https://github.com/olafurpg/intellij-bsp-pants
cd intellij-bsp-pants
./setup-bsp.sh
Next, reproduce the issue
❯ bloop test src/test/scala/foo:foo
Compiling src/test/scala/foo:foo (1 Scala source)
Compiled src/test/scala/foo:foo (2916ms)
foo.MySuite:
Auto-test!
+ auto-test works 0.031s
Execution took 31ms
1 tests, 1 passed
All tests in foo.MySuite passed
===============================================
Total duration: 31ms
All 1 test suites passed.
===============================================
❯ bloop test src/test/scala/foo:foo
error: Unexpected error forces client exit!
java.io.EOFException
at java.io.DataInputStream.readInt(DataInputStream.java:397)
at bloop.shaded.snailgun.protocol.Protocol.$anonfun$processChunkFromServer$1(Protocol.scala:181)
at scala.util.Try$.apply(Try.scala:213)
at bloop.shaded.snailgun.protocol.Protocol.processChunkFromServer(Protocol.scala:180)
at bloop.shaded.snailgun.protocol.Protocol.sendCommand(Protocol.scala:108)
at bloop.shaded.snailgun.TcpClient.run(TcpClient.scala:34)
at bloop.bloopgun.BloopgunCli.executeCmd$1(Bloopgun.scala:255)
at bloop.bloopgun.BloopgunCli.fireCommand(Bloopgun.scala:261)
at bloop.bloopgun.BloopgunCli.run(Bloopgun.scala:216)
at bloop.bloopgun.Bloopgun$.main(Bloopgun.scala:560)
at bloop.bloopgun.Bloopgun.main(Bloopgun.scala)
File explorer is not helpful
To reproduce, go to an empty directory and run the following commands
git clone -b project-files-tree https://github.com/olafurpg/intellij-bsp-pants
cd intellij-bsp-pants
./setup-bsp.sh
After the command complete, it should automatically launch IntelliJ in the correct directory and show a "Project" view that looks like this
The "Project files tree" is not any more helpful
I would like to have a file tree view of the files
directory. It's normal that the file tree doesn't show this directory right now because there is no module that points to this directory:
I made an attempt to fix this issue by generating a Bloop project with empty sources and a base directory at files
. The generate project has no "content root"
When I add the files
directory to the sources of the generated project then it works as expected in IntelliJ but it fails the bloop compilation.
bloop compile `bloop projects`
Compiling files/ (2 Scala sources) // <- should not happen
Compiling files/src/main/inner:inner (1 Scala source)
Compiled files/ (2352ms)
Compiled files/src/main/inner:inner (4947ms)
Compiling files/src/test/inner:inner (1 Scala source)
Compiled files/src/test/inner:inner (628ms)
[E] Unexpected error when compiling files/: 'object scala in compiler mirror not found.'
[E] Failed to compile 'files/'
When I add the files
directory to the resources of the generated project then it works as expected in IntelliJ and it also works as expected in Bloop. This issue is therefore fixed but I'm opening it anyways to document this hacky workaround.
IntelliJ auto-test does not work
Branch: https://github.com/olafurpg/intellij-bsp-pants/tree/auto-test
Make sure to have "build file on save" enabled when importing via IntelliJ
IntelliJ issue: https://youtrack.jetbrains.com/issue/SCL-16630
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.