Skip to content

Commit 4f92e0c

Browse files
committed
Add varchook to valid types list
1 parent 66005b0 commit 4f92e0c

File tree

5 files changed

+5
-0
lines changed

5 files changed

+5
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
### Added
66

77
- Add inspection and quick fix for unused local variables.
8+
- Add varchook to valid types.
89

910
## [1.5.0] - 2023-11-27
1011

src/main/kotlin/io/runescript/plugin/ide/config/RsConfig.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ object RsConfig {
6262
"varphook",
6363
"stathook",
6464
"invhook",
65+
"varchook",
6566
"any"
6667
)
6768

src/main/kotlin/io/runescript/plugin/lang/psi/RsPsiExtensions.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ fun RsStringLiteralContent.isHookExpression(): Boolean = CachedValuesManager.get
3636
fun RsType.isHookType() = when (this) {
3737
RsPrimitiveType.HOOK,
3838
RsPrimitiveType.VARPHOOK,
39+
RsPrimitiveType.VARCHOOK,
3940
RsPrimitiveType.STATHOOK,
4041
RsPrimitiveType.INVHOOK -> true
4142

src/main/kotlin/io/runescript/plugin/lang/psi/type/RsPrimitiveType.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ enum class RsPrimitiveType(val literal: String, val referencable: Boolean = true
5555
NULL("null", referencable = false),
5656
HOOK("hook", referencable = false),
5757
VARPHOOK("varphook", referencable = false),
58+
VARCHOOK("varchook", referencable = false),
5859
STATHOOK("stathook", referencable = false),
5960
INVHOOK("invhook", referencable = false),
6061
CONSTANT("constant", referencable = false),

src/main/kotlin/io/runescript/plugin/lang/psi/type/inference/RsTypeInferenceVisitor.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ class RsTypeInferenceVisitor(private val myInferenceData: RsTypeInference) : RsV
218218
o.argumentList?.let { checkArgumentList(it, parameterTypes) }
219219
val expectedType = when (typeHint) {
220220
RsPrimitiveType.VARPHOOK -> RsPrimitiveType.VARP
221+
RsPrimitiveType.VARCHOOK -> RsPrimitiveType.VARC
221222
RsPrimitiveType.STATHOOK -> RsPrimitiveType.STAT
222223
RsPrimitiveType.INVHOOK -> RsPrimitiveType.INV
223224
else -> null

0 commit comments

Comments
 (0)