question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

import regions not computed for .class files

See original GitHub issue

When opening a .class file, the import statements are not folded by default, with "editor.foldingImportsByDefault": true. Seems you can’t even fold the import block manually. Something’s fishy here. I noticed that in https://github.com/redhat-developer/vscode-java/pull/2132#issuecomment-927960228

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
rgrunbercommented, Oct 24, 2022

Instead of using the AST parsing facility, @JessicaJHee went with using the scanner’s ITerminalSymbols.TokenNameimport to detect the import range. We do use the scanner for other parts of the folding range computations. This should work as expected now.

0reactions
baincdcommented, Mar 26, 2022

As a workaround, I have created a VS Code extension that adds a folding region for imports on .class files: https://marketplace.visualstudio.com/items?itemName=baincd.java-class-imports-folding

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to select classes from a GeoTIFF world map and compute ...
My "output" would then be a CSV with region name (from fileRegions), total area, share of aggregate land use. My main problem is...
Read more >
Some JavaFX Imports Cannot Be Resolved in Eclipse
In the one class I have so far, I am importing these JavaFX classes: import javafx.application.Platform; import javafx.geometry.Pos; import ...
Read more >
Using Statement: Import PowerShell Classes from Modules
I can use Import-Module to import the ImportTester module and explicitly import version 1.0.0.0. The module is imported and its function is ...
Read more >
Lesson 7: Packages and Java Archive File Format - Oracle
This lesson shows you how to organize the program files from Part 2, Lesson 6: Internationalization into packages and deploy the executable and...
Read more >
How to add a jar file to application to use in runtime? - IBM
Most of the time people face Java.Lang.NoClassDefFoundError error in runtime because their application is dependent on .jar file that is missing in runtime....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found