Skip to content

Quick fixes for Scala IDE

kaptoxic edited this page Jul 30, 2012 · 20 revisions

Smart Quick Fixes for Scala IDE for Eclipse

This project is about implementing a 'QuickFix' functionality for Scala development within the Eclipse. The implemented mechanism should be used to provide automatic suggestions for fixing compilation errors, code completion proposals, and refactoring suggestions.

The basic ideas for the project are to implement the officially suggested "quick fixes" for Scala in Eclipse which include suggested code modifications after a compilation error (e.g. if a required type is List[T] but found is List[List[T]], one suggestion could be to add a flatten method call to an expression of type List[List[T]]), syntactic transformations which are semantically equivalent (e.g. from foreach/map/flatmap to for-yield construct transforms) and investigate some other possibilities (like the mentioned scalagen tool application).

Additionally one of the ideas of the project would be to involve InSynth software, an interactive synthesis piece of software which uses theorem proving to synthesize code fragments (more info about InSynth can be found at link). InSynth is developed at the LARA EPFL lab and represents a tool for interactive synthesis of code snippets. It synthesizes code applying polymorphic type constraints as well as code behavior. This would bring a top-notch improvement into Eclipse when compared to other IDEs (e.g. synthesis of expressions which can be provided as method call parameters based on the method definitions could be one of such usefull mechanisms, not found in other IDEs at the moment).

  • DONE Meet with Iulian and discuss about the project
  • DONE Subscribe for the scala-lang, scala-ide, scala-ide-dev mailing lists
  • DONE Read a Eclipse documentation on plugin development ('Platform Plug-in Development Guide', 'JDT Plug-in Development Guide')
  • DONE Read the Startup guide
  • DONE Make the developer environment ready (done after having some annoying issues)
  • PENDING Sign the CLA for the Scala-IDE team
  • DONE Meet with Iulian and Tihomir about the InSynth tool integration
  • DONE Discuss and adopt an intermediate representation of InSynth proof trees for the code generation module
  • DONE Implement the first phase for the code generation, weighted combination tree extraction
  • DONE Adopt an intermediate representation for the code generation module (trees similar to the lambda calculus terms)
  • DONE Implement the second phase for the code generation, translation of extracted trees into the intermediate representation
  • DONE Implement the third phase for the code generation, translation of intermediate representation trees and generation of Scala code
  • DONE Test the code generation module in isolation
  • DONE Merge the code generation module with the resolution module
  • DONE Artifacts presenting the InSynth tool and its code generation: report and presentation
  • DONE Integrate the initial version of InSynth into Scala IDE
  • DONE Join the Scala IDE developers meeting
  • DONE Have an additional meeting with Iulian and discuss about further steps
  • DONE Test InSynth on real-world examples (large proof trees)
  • DONE Finish the implementation of ranking of snippets according to weights in InSynth plugin
  • DONE Package InSynth plugin
  • DONE Make a maven build with an appropriate structure (feature, update-site, ...) - link to the repository location
  • DONE Add support for Equinox JUnit testing of InSynth
  • PENDING Add wiki and issue tracker (wiki, issues)
  • DONE Fix the tests build process
  • DONE Added readme explaining the build and link to user documentation to the build project
  • PENDING Support method arguments
  • DONE Add a settings page
  • DONE Publish short user documentation on InSynth
  • PENDING Getting weights statistics from existing Scala projects
  • DONE Added support for setting maximum response time and number of solutions
  • PENDING Return method type declarations (check imports for full qualification)
  • PENDING Fix compiler (possibly race-conditions) bugs
  • PENDING Add build profiles and integrate them into Jenkins
  • PENDING Pull requests for quick fixes and return type specification
  • PENDING To be discussed...
  • "implements all undefined methods in this class", for the error "class Child needs to be abstract since method xyz in class Parent is not defined"
  • drill down approach to completion - would require incremental approach to InSynth resolution
  • modify the implementation of first phase of code generation to allow customizing proof tree exploration according to different contexts in a modular way (useful for quick fixes when we want to get snippets which contain parts of user input)
  • InSynth support for generics
  • InSynth support for type variance
  • pattern search for better weight assignment to InSynth