Various issues with "Organize Imports"

瀏覽次數:65 次
跳到第一則未讀訊息

Matthias Langer

未讀,
2015年1月6日 下午2:14:422015/1/6
收件者:scala-...@googlegroups.com
Hello everybody,

it came to my attention that there are various issues with the "Organize Imports" feature. I've created minimal examples as well as bug reports against scala-refactoring for some of them:

https://github.com/mlangc/scala-ide-experiments/tree/organize-imports-for-root-and-scala-72
https://github.com/mlangc/scala-ide-experiments/tree/organize-imports-and-type-aliases-73
https://github.com/mlangc/scala-ide-experiments/tree/organize-imports-removes-import-from-annotation-1001793

Is anyone working on this?

Regards,
Matthias

Simon Schäfer

未讀,
2015年1月6日 下午3:19:102015/1/6
收件者:scala-...@googlegroups.com
Note, that most bugs are reported in the IDE tracker on Assembla, not on Github. It would be nice if you could report them there, then we don't have to look to different sites to find out which bugs are already reported.

Tickets about Organize imports are tagged with "auto-imports": https://www.assembla.com/spaces/ae55a-oWSr36hpeJe5avMc/tickets?tickets_report_id=u1200023&tag_id=471523


Is anyone working on this?
I haven't heard of anyone.

Regards,
Matthias
--
You received this message because you are subscribed to the Google Groups "Scala IDE Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-ide-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scala-ide-dev/5320cb44-bb76-4e5a-bb96-e86f64ce058a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mirko Stocker

未讀,
2015年1月7日 凌晨2:44:432015/1/7
收件者:scala-...@googlegroups.com
Hi,


> it came to my attention that there are various issues with the "Organize
> Imports" feature. I've created minimal examples as well as bug reports
> against scala-refactoring for some of them:

Thanks!


> Is anyone working on this?

Not as far as I know. Do you want to give it a try? You could start with
adding your bug examples as tests to CompilationUnitDependenciesTest.scala, to
or to OrganizeImportsFullyRecomputeTest.scala

Cheers

Mirko

--
Mirko Stocker | m...@misto.ch
Work: http://ifs.hsr.ch | http://infoq.com
Personal: http://misto.ch | http://twitter.com/m_st

Matthias Langer

未讀,
2015年1月9日 凌晨3:12:232015/1/9
收件者:scala-...@googlegroups.com

Note, that most bugs are reported in the IDE tracker on Assembla, not on Github. It would be nice if you could report them there, then we don't have to look to different sites to find out which bugs are already reported.

Tickets about Organize imports are tagged with "auto-imports": https://www.assembla.com/spaces/ae55a-oWSr36hpeJe5avMc/tickets?tickets_report_id=u1200023&tag_id=471523

Thanks for the link; unfortunately I don't have the permissions to even comment on these issues :-/.

Matthias Langer

未讀,
2015年1月9日 凌晨3:15:062015/1/9
收件者:scala-...@googlegroups.com

> Is anyone working on this?

Not as far as I know. Do you want to give it a try? You could start with
adding your bug examples as tests to CompilationUnitDependenciesTest.scala, to
or to OrganizeImportsFullyRecomputeTest.scala

Thanks for you help! I'll see what I can do about these issues. Be prepared for additional questions though ;-).

Matthias

Mirko Stocker

未讀,
2015年1月9日 凌晨3:49:542015/1/9
收件者:scala-...@googlegroups.com
On Friday 09 January 2015 00:15:06 Matthias Langer wrote:
> Thanks for you help! I'll see what I can do about these issues. Be prepared
> for additional questions though ;-).

Sure :-) Keep them coming!

Matthias Langer

未讀,
2015年1月10日 下午5:51:302015/1/10
收件者:scala-...@googlegroups.com

Sure :-) Keep them coming!

Well, here is the first one: I'm currently working on #1001793, which is about classes used in expressions like "@AnAnnotation(classOf[Foo]) not being handled properly. The problem is, that for example "@AnAnnotation(classOf[Foo])" is represented by

Apply(
  Select(New(Ident(AnAnnotation)), termNames.CONSTRUCTOR), List(
    AssignOrNamedArg(
      Ident(TermName("value")), TypeApply(
        Ident(TermName("classOf")), List(Ident(TypeName("Foo")))
      )
    )
  )
)

The
"Ident(TypeName("Foo"))" has neither a tpe nor a symbol, and so it is not handled by the traverser in scala.tools.refactoring.analysis.CompilationUnitDependencies, that would otherwise use these properties to build a "fakeSelectTree". So my questions are:

1) Why are tpe and symbol not set in this case?
2) How can I obtain these properties?

Thanks,
Matthias



Simon Schäfer

未讀,
2015年1月10日 下午6:41:112015/1/10
收件者:scala-...@googlegroups.com
This is a bug/unsound behavior in the compiler. I can remember working on an issue about classOf literals in the past but I did not come up with a solution. Maybe someone else knows more and can think of a workaround but I doubt this can be fixed without fixing the compiler.

Generally, there are a lot of problems in the compiler that lead to bugs on the IDE side. For now the only thing we can do is to report the problems so that they are not forgotten when in a better future we get a better compiler.

Thanks,
Matthias



--
You received this message because you are subscribed to the Google Groups "Scala IDE Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-ide-de...@googlegroups.com.

Matthias Langer

未讀,
2015年1月11日 凌晨4:12:012015/1/11
收件者:scala-...@googlegroups.com
This is a bug/unsound behavior in the compiler. I can remember working on an issue about classOf literals in the past but I did not come up with a solution. Maybe someone else knows more and can think of a workaround but I doubt this can be fixed without fixing the compiler.

Generally, there are a lot of problems in the compiler that lead to bugs on the IDE side. For now the only thing we can do is to report the problems so that they are not forgotten when in a better future we get a better compiler.

Well, let's see what scala-internals has to say about this then...

iulian dragos

未讀,
2015年1月11日 清晨7:24:332015/1/11
收件者:scala-ide-dev
Do you have an Assembla account? What is your username?
 

--
You received this message because you are subscribed to the Google Groups "Scala IDE Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-ide-de...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
« Je déteste la montagne, ça cache le paysage »
Alphonse Allais

Sam Halliday

未讀,
2015年1月14日 凌晨4:30:002015/1/14
收件者:scala-...@googlegroups.com
Interesting, we have also been thinking that we'd like to make it better in ENSIME, so if scala-ide make improvements in the middleware hopefully we can get the wins for free https://github.com/ensime/ensime-server/issues/779
回覆所有人
回覆作者
轉寄
0 則新訊息