User: rednesto Date: 16 Dec 23 09:58 Revision: c742de452a80ee7d5a48cbf46a2da6ef24c20da8 Summary: Ignore mod_id placeholder in mods.toml TeamCity URL: https://ci.mcdev.io/viewModification.html?tab=vcsModificationFiles&modId=8884&personal=false Index: src/main/kotlin/toml/platform/forge/inspections/ModsTomlValidationInspection.kt =================================================================== --- src/main/kotlin/toml/platform/forge/inspections/ModsTomlValidationInspection.kt (revision 2968496da530d193800b74257e2b4236d814a58e) +++ src/main/kotlin/toml/platform/forge/inspections/ModsTomlValidationInspection.kt (revision c742de452a80ee7d5a48cbf46a2da6ef24c20da8) @@ -72,7 +72,9 @@ "modId" -> { val value = keyValue.value ?: return val modId = value.stringValue() ?: return - if (modId != "\"" && !ForgeConstants.MOD_ID_REGEX.matches(modId)) { + if (modId != "\"" && !(modId.startsWith("\${") && modId.endsWith("}")) && + !ForgeConstants.MOD_ID_REGEX.matches(modId) + ) { val endOffset = if (value.text.endsWith('"')) modId.length + 1 else modId.length holder.registerProblem(value, TextRange(1, endOffset), "Mod ID is invalid") } Index: src/main/kotlin/toml/platform/forge/reference/ModsTomlReferenceContributor.kt =================================================================== --- src/main/kotlin/toml/platform/forge/reference/ModsTomlReferenceContributor.kt (revision 2968496da530d193800b74257e2b4236d814a58e) +++ src/main/kotlin/toml/platform/forge/reference/ModsTomlReferenceContributor.kt (revision c742de452a80ee7d5a48cbf46a2da6ef24c20da8) @@ -117,6 +117,11 @@ object ModsTomlModIdReferenceProvider : PsiReferenceProvider() { override fun getReferencesByElement(element: PsiElement, context: ProcessingContext): Array { val value = element as? TomlValue ?: return PsiReference.EMPTY_ARRAY + val stringValue = value.stringValue() + if (stringValue != null && stringValue.startsWith("\${") && stringValue.endsWith("}")) { + return PsiReference.EMPTY_ARRAY + } + return arrayOf(ModsTomlModIdReference(value)) } }