From 370ac1aab4bf9b2cf02e833bb80a18cc81a7595e Mon Sep 17 00:00:00 2001 From: "Walied K. Yassen" Date: Fri, 6 Oct 2023 14:44:40 +0300 Subject: [PATCH] Fix invalid symbol file inspection reporting an error for commands.sym --- CHANGELOG.md | 1 + .../ide/inspections/RuneScriptInvalidSymbolFileInspection.kt | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 138172d..e9fe441 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## [Unreleased] ### Fixed - Fix regular expressions not being allowed in hook transmits list. +- Fix invalid symbol file inspection reporting an error for "commands.sym". ### Changed - Inspections that require symbols will no longer run on files outside the project. diff --git a/src/main/kotlin/io/runescript/plugin/ide/inspections/RuneScriptInvalidSymbolFileInspection.kt b/src/main/kotlin/io/runescript/plugin/ide/inspections/RuneScriptInvalidSymbolFileInspection.kt index 29c3cf1..8f5f4ac 100644 --- a/src/main/kotlin/io/runescript/plugin/ide/inspections/RuneScriptInvalidSymbolFileInspection.kt +++ b/src/main/kotlin/io/runescript/plugin/ide/inspections/RuneScriptInvalidSymbolFileInspection.kt @@ -25,6 +25,10 @@ class RuneScriptInvalidSymbolFileInspection : LocalInspectionTool() { } val name = file.containingFile.name val typeName = name.substring(0, name.indexOf('.')) + if (typeName == "commands") { + // Technically this is not a type, but is required by the compiler. + return null; + } if (RsPrimitiveType.lookupOrNull(typeName) == null) { return arrayOf( manager.createProblemDescriptor(