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.

Optimize imports on file generation

See original GitHub issue

I have realized that when I import an avdl file into another, the result statement looks like this:

import domain.{HTTPError, CredentialsError, Response, Request, TimeOutError, ParseError, ValidationError}

Too many times a lot of them are unused which cause a huge list of unused imports. So my question is: Is it possible to import only the necessary fields? or Could we change that statement by import domain._ or something like that?

Thank you so much for your attention.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
AdrianRaFocommented, Aug 19, 2019

For the meantime, as a workaround, I’m using the silencer plugin:

addCompilerPlugin("com.github.ghik" % "silencer-plugin"     % V.silencer cross CrossVersion.full),
libraryDependencies += "com.github.ghik" % "silencer-lib" % V.silencer % Provided cross CrossVersion.full

with a scalacOption

"-P:silencer:pathFilters=target"

to silent all the warning from code under the target folder (usually generated code)

3reactions
julianpeeterscommented, Aug 6, 2018

Apologies for the delayed response @AdrianRaFo.

Is it possible to import only the necessary fields? or Could we change that statement by import domain._ or something like that?

I would certainly be in favor of the first option, and although my shedule is tight for the time being, I’ll try to prioritize this over the next couple weeks. Thanks for pointing this out. Time for sbt-tpolecat in the scripted tests.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Auto import | IntelliJ IDEA Documentation - JetBrains
To optimize imports in a file, you can also press Ctrl+Alt+Shift+L , select Optimize imports, and click Run. Optimize imports when committing ...
Read more >
ide - How to optimize imports automatically after each save in ...
I think the import option "optimize on the fly" will optimise when you import new types, and when you paste code, but it...
Read more >
Auto import - Help | IntelliJ IDEA - JetBrains
The Optimize Imports feature helps you remove unused imports and organize import statements in the current file or in all files in a ......
Read more >
VS Code tips — Organize imports - YouTube
Today's VS Code tip: Organize ImportsUse the organize imports command to sort imports and remove unused ones for JavaScript and TypeScript.
Read more >
EMF » How to trigger 'organize imports' from Ant build file
I'm using an Ant build file to automatically generate code for all .genmodel files in a project. Unfortunately, EMF resists on generating ......
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