Reference shortening: simplified code for getting resolve session

This commit is contained in:
Valentin Kipyatkov
2013-12-26 17:28:11 +04:00
parent c9c50e4107
commit f303b6dae5
@@ -31,16 +31,8 @@ public object ShortenReferences {
} }
private class Visitor(val file: JetFile) : JetVisitorVoid() { private class Visitor(val file: JetFile) : JetVisitorVoid() {
private var modificationCount = file.getManager()!!.getModificationTracker().getModificationCount() private val resolveSession : CancelableResolveSession
private val resolveSession : CancelableResolveSession = AnalyzerFacadeWithCache.getLazyResolveSessionForFile(file) get() = AnalyzerFacadeWithCache.getLazyResolveSessionForFile(file)
get(){
val currentModificationCount = file.getManager()!!.getModificationTracker().getModificationCount()
if (currentModificationCount != modificationCount) {
$resolveSession = AnalyzerFacadeWithCache.getLazyResolveSessionForFile(file)
modificationCount = currentModificationCount
}
return $resolveSession
}
override fun visitJetElement(element : JetElement) { override fun visitJetElement(element : JetElement) {
acceptChildren(element) acceptChildren(element)