Hi,
I’m in trouble for testing my plugin (Postgres debugger), this fails
val psiFile = createLightFile("dummy.sql", PgDialect.INSTANCE, sql)
I’ve found this returns null in PsiFileFactoryImpl
public @Nullable PsiFile trySetupPsiForFile(@NotNull LightVirtualFile lightVirtualFile,
@NotNull Language language,
boolean physical, boolean markAsCopy) {
FileViewProviderFactory factory = LanguageFileViewProviders.INSTANCE.forLanguage(language);
FileViewProvider viewProvider = factory != null ? factory.createFileViewProvider(lightVirtualFile, language, myManager, physical) : null;
if (viewProvider == null) viewProvider = new SingleRootFileViewProvider(myManager, lightVirtualFile, physical);
language = viewProvider.getBaseLanguage();
ParserDefinition parserDefinition = LanguageParserDefinitions.INSTANCE.forLanguage(language);
if (parserDefinition != null) {
PsiFile psiFile = viewProvider.getPsi(language);
if (psiFile != null) {
if (markAsCopy) {
if (psiFile.getNode() == null) {
throw new AssertionError("No node for file " + psiFile + "; language=" + language);
}
markGenerated(psiFile);
}
return psiFile;
}
}
return null;
}
Build conf
intellijPlatform {
intellijIdeaUltimate(version = providers.gradleProperty("platformVersion"))
bundledPlugins(providers.gradleProperty("platformBundledPlugins").map { it.split(',') })
plugins(providers.gradleProperty("platformPlugins").map { it.split(',') })
pluginVerifier()
zipSigner()
testFramework(TestFrameworkType.Platform)
testBundledPlugin(providers.gradleProperty("platformBundledPlugins"))
}
Plugin conf
platformType = IU
platformVersion = 2025.1.2
platformPlugins =
platformBundledPlugins = com.intellij.database
Gradle 8.13
kotlin = “2.1.20”
intelliJPlatform = “2.6.0”