performance question

hi there,

could it be that code completion is faster if i add type annotations to my code? if yes, couldn't the type of each symbol be cached? it has to be evaluated anyway when parsing the file, and as long as i don't change the file, the type cannot change. and if i type anything, it will be reparsed anyway.

1 comment
Comment actions Permalink

Unfortunately type can be changed by any change:

class A {
  def foo = goo

  def goo = 1 //change it to "" and type of 'foo' will be changed
}



I'm sure it's possible to handle dependencies and to do smarter caching, but I'm also sure that it's too complex to do it now.

Current plugin state of this problem is that everything will be much faster if you type code inside '{}', which cannot change anything outside this scope, for example:

class A {
  def foo: Int = {
    //everything will be faster during typing just here
  }
}



Best regards,
Alexander Podkhalyuzin.
0

Please sign in to leave a comment.