Skip to content

Unable to format document #218

@CodingKoopa

Description

@CodingKoopa

I have a Gradle project that I would like to format using this extension. This is my build.gradle, with the spotless configuration at the end of the file.

When I run gradle spotlessApply outside of VSCode, Gradle is successful, and issues in the files are fixed.

When I run the spotlessApply task using the Gradle Tasks extension, it is successful and works.

When I format the document, though, the issues are not fixed. I get this notification in VSCode:
image
The following is logged to the Gradle Tasks output:

[info] Completed build: spotlessApply -PspotlessIdeHook=/home/koopa/Documents/Projects/Java/Robot/Robot2021/src/main/java/frc/robot/Robot.java -PspotlessIdeHookUseStdIn -PspotlessIdeHookUseStdOut --quiet

The following is logged to the Spotless Gradle output:

[info] Running spotlessApply on Robot.java
[error] Unable to apply formatting: No status received from Spotless

Some other notes:

  • If this is the first time I'm formatting since reloading VSCode, the notification goes away in a second.
  • When formatting for the second time, the notification does not seem to go away. It seems that the build hangs after the first attempt. When cancelling this task, the following is logged to Gradle Tasks:
[info] Cancel build: Cancel build requested
[info] Build cancelled: spotlessApply -PspotlessIdeHook=/home/koopa/Documents/Projects/Java/Robot/Robot2021/src/main/java/frc/robot/Robot.java -PspotlessIdeHookUseStdIn -PspotlessIdeHookUseStdOut --quiet: Could not execute build using Gradle distribution 'https://services.gradle.org/distributions/gradle-6.0.1-bin.zip'.
  • After cancelling the second format, it's inconsistent as to whether or not it hangs.
  • When manually running the command from the Gradle Tasks output, the issues in the code are not fixed.

OS: Arch Linux
Gradle Version: 6.0.1
Gradle Tasks Version: 3.5.2
Spotless Gradle Version: 1.1.3

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions