From ded366609b6187f03cc959164bc7fbe575ca222b Mon Sep 17 00:00:00 2001 From: Dmitrii Naumenko Date: Wed, 5 Jun 2024 19:20:23 +0200 Subject: [PATCH] process only directories and jar files in `plugins` directory --- .../jetbrains/sbtidea/download/plugin/PluginIndexImpl.scala | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ideaSupport/src/main/scala/org/jetbrains/sbtidea/download/plugin/PluginIndexImpl.scala b/ideaSupport/src/main/scala/org/jetbrains/sbtidea/download/plugin/PluginIndexImpl.scala index 0a2f0ca..12f3dba 100644 --- a/ideaSupport/src/main/scala/org/jetbrains/sbtidea/download/plugin/PluginIndexImpl.scala +++ b/ideaSupport/src/main/scala/org/jetbrains/sbtidea/download/plugin/PluginIndexImpl.scala @@ -115,7 +115,10 @@ class PluginIndexImpl(ideaRoot: Path) extends PluginIndex { } private def buildFromPluginsDir: Map[PluginId, (Path, PluginDescriptor)] = { - val pluginDirs = Files.list(ideaRoot.resolve("plugins")).collect(Collectors.toList[Path]).asScala + val pluginDirs = Files.list(ideaRoot.resolve("plugins")).collect(Collectors.toList[Path]).asScala.filter { file => + //extra filtering of unexpected extensions (e.g., some strange file plugin-classpath.txt) + file.isDir || file.toString.endsWith(".jar") + } pluginDirs.flatMap { pluginDir => val pluginMetaData = extractPluginMetaData(pluginDir) pluginMetaData match {