Git Product home page Git Product logo

bsp-pants's People

Forkers

jastice wiwa

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

Screenshot 2020-01-24 at 12 05 09

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

Screenshot 2020-01-24 at 12 08 11

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.

Screenshot 2020-01-24 at 12 08 53

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

Screenshot 2020-02-24 at 18 08 17

Run the "New Scala class" action to create a file "MissingPackage.scala". The generated file has no package bsp statement

Screenshot 2020-02-24 at 18 08 29

I expected the generated file to have the contents

package bsp

class MissingPackage { ... }

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

Screenshot 2020-02-04 at 12 14 24

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.

Screenshot 2020-02-04 at 12 15 16

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

Screenshot 2019-12-19 at 17 33 52

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

I don't have concrete steps to reproduce but after importing an IntelliJ project I restarted the bloop server and when I tried to build from IntelliJ it got stuck like this

Screenshot 2020-01-08 at 15 29 29

There is no stop button to cancel the build.

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

Screenshot 2020-01-07 at 19 39 15

The "Project files tree" is not any more helpful

Screenshot 2020-01-07 at 19 41 43

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:

Screenshot 2020-01-07 at 19 39 36

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"

Screenshot 2020-01-07 at 19 45 32

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.