New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom toml files not working #20
Comments
Unable to reproduce. Can you provide a minimal sample project? |
hey, @F43nd1r After reading the source code and debugging, I found that the main cause of this problem is the If we need to resolve this, we can customize the search method, but it depends on whether it aligns with your original design intentions. However, this is indeed a practical use case. Do you have any better suggestions or implementation solutions? |
Can you solve this by just using a different location and .gitignoring it there? Or would that also lead to intelliJ excluding it from indexing? |
Finally, I found a solution. In the fun Project.findInVersionsTomlKeyValues(getKeyValues: (TomlFile) -> List<TomlKeyValue>, search: String): List<TomlKeyValue> {
val tomlFiles = FilenameIndex.getAllFilesByExt(this, "toml").apply {
if (basePath != null) {
add(VfsUtil.findFile(Path.of(basePath!!, ".gradle", "libs.versions.toml"), true))
}
}
return tomlFiles
.filter { it.name.endsWith("versions.toml") }
.map { it.toPsiFile(this) }
.filterIsInstance<TomlFile>()
.flatMap { file -> getKeyValues(file).filter { it.key.textMatches(search) } }
} |
If we use a file named xxx.versions.toml to define our own dependency library, only the custom prompt will be displayed, and the dependency prompt of libs.versions.toml will not work.
AS:
The text was updated successfully, but these errors were encountered: