Liam
10/16/2023, 11:36 PMFirDeclarationGenerationExtension
, and I'm trying to "complete and import" it from a source file. I've been browsing/debugging through the IntelliJ/Kotlin compiler code, and the relevant place in the IDE code seems to be here: FirClassifierCompletionContributor.kt
Completions there are gathered from two places:
1. The result of getAvailableClassifiersCurrentScope
, which ultimately ends up using the tower context here: KtFirScopeProvider.kt
2. The index built from the source files
When I actually put the source file I'm completing "from" into the same package as the generated class, or manually import it, I can actually complete it, because its in the tower context and 1. covers it. But when its in a different package, it doesn't work.
I'm assuming the appropriate place for my class to show up here would be in 2., since that is how its handled for sources as well, and its probably better to not check every single generated declaration ever. I also see that there is this line here in: KtSymbolFromIndexProvider.kt, which ends up looking for and using this resolve extension thing here: KtResolveExtension.kt.
Do I have to somehow provide my own resolve extension if I want to be able to have completion for my generated top level declarations if they are not in the current scope already? (I see that there is an extension point for KtResolveExtensionProvider
, but I can't find any example of it being extended).dmitriy.novozhilov
10/17/2023, 6:28 AMRoman Golyshev
10/17/2023, 9:02 AMLiam
10/17/2023, 2:12 PMRoman Golyshev
10/30/2023, 1:16 PM