[FE] Support analyzable files throughout all 'KtPsiFactory' API
Before, the only way of getting analyzable elements was to create an analyzable file by using 'createAnalyzableFile()'. So made all utilities available in 'KtPsiFactory' useless as they delegate to 'createFile()' that always set the 'doNotAnalyze' flag. The new behavior is to pass the 'analysisContext' instead if it is passed to the 'KtPsiFactory' constructor. The newly appeared API is going to be used in the Kotlin's UAST implementation.
This commit is contained in:
+1
-1
@@ -34,7 +34,7 @@ open class KtLightPsiLiteral(
|
||||
|
||||
override fun replace(newElement: PsiElement): PsiElement {
|
||||
val value = (newElement as? PsiLiteral)?.value as? String ?: return this
|
||||
kotlinOrigin.replace(KtPsiFactory(this).createExpression("\"${StringUtil.escapeStringCharacters(value)}\""))
|
||||
kotlinOrigin.replace(KtPsiFactory(project).createExpression("\"${StringUtil.escapeStringCharacters(value)}\""))
|
||||
return this
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user