Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Several issues with import statements #1391

Closed
eric-milles opened this issue Sep 18, 2022 · 2 comments
Closed

Several issues with import statements #1391

eric-milles opened this issue Sep 18, 2022 · 2 comments
Assignees
Labels
Milestone

Comments

@eric-milles
Copy link
Member

eric-milles commented Sep 18, 2022

A few items to clean up:

  1. Alias imports do not show alias name in Outline view

    import java.util.regex.Pattern as Regexp

    image

  2. Static imports highlight "static " in editor when selected from Outline view

    import static java.util.regex.Pattern.compile

    image

  3. Static method imports with multiple overloads display last overload in hover and navigate to first overload
    Groovy editor:
    image
    Java editor:
    image

  4. Static imports with an alias display improper first line in hover
    With an alias:
    image
    Without an alias:
    image

  5. When adding imports using compiler config script, "import declarations" shows up before package in Outline view (with or without import statements, which come after the package statement)

    withConfig(configuration) {
      imports {
        star 'java.util.function'
      }
    }

    image

  6. When adding imports using compiler config script, import statements lack collapse region
    no implicit imports:
    image
    with implicit imports:
    image

  7. When adding imports using compiler config script, Organize Imports (Ctrl+Shift+O) fails for source unit in default package

    org.eclipse.core.runtime.AssertionFailedException: assertion failed: 
    at org.eclipse.core.runtime.Assert.isTrue(Assert.java:113)
    at org.eclipse.core.runtime.Assert.isTrue(Assert.java:99)
    at org.eclipse.text.edits.TextEdit.<init>(TextEdit.java:153)
    at org.eclipse.text.edits.ReplaceEdit.<init>(ReplaceEdit.java:39)
    at org.eclipse.jdt.internal.core.dom.rewrite.imports.ImportEditor.createTextEdit(ImportEditor.java:200)
    at org.eclipse.jdt.internal.core.dom.rewrite.imports.ImportRewriteAnalyzer.analyzeRewrite(ImportRewriteAnalyzer.java:568)
    at org.eclipse.jdt.core.dom.rewrite.ImportRewrite.rewriteImports(ImportRewrite.java:1359)
    at org.codehaus.groovy.eclipse.refactoring.actions.OrganizeGroovyImports.calculateMissingImports(OrganizeGroovyImports.java:258)
    at org.codehaus.groovy.eclipse.refactoring.actions.OrganizeGroovyImports.calculateAndApplyMissingImports(OrganizeGroovyImports.java:112)
    at org.codehaus.groovy.eclipse.refactoring.actions.OrganizeGroovyImportsAction.run(OrganizeGroovyImportsAction.java:68)
    at org.eclipse.jdt.ui.actions.OrganizeImportsAction.run(OrganizeImportsAction.java:206)
    
@eric-milles
Copy link
Member Author

image

@eric-milles
Copy link
Member Author

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant