File tree Expand file tree Collapse file tree 3 files changed +42
-0
lines changed
kotlin/io/runescript/plugin/ide/refactoring Expand file tree Collapse file tree 3 files changed +42
-0
lines changed Original file line number Diff line number Diff line change 5
5
### Fixed
6
6
7
7
- Fix project opening not working as expected in IntelliJ 2023 builds.
8
+ - Fix name validation when renaming symbols.
9
+
10
+ ## Changed
11
+
12
+ - Do not apply spell checking inspection for RuneScript keywords.
8
13
9
14
## [ 1.6.0] - 2024-08-30
10
15
Original file line number Diff line number Diff line change
1
+ package io.runescript.plugin.ide.refactoring
2
+
3
+ import com.intellij.lang.refactoring.NamesValidator
4
+ import com.intellij.openapi.project.Project
5
+ import io.runescript.plugin.ide.config.RsConfig
6
+
7
+ class RsNamesValidator : NamesValidator {
8
+ private val keywords = hashSetOf<String >(
9
+ " if" ,
10
+ " else" ,
11
+ " while" ,
12
+ " case" ,
13
+ " default" ,
14
+ " return" ,
15
+ " calc" ,
16
+ " return" ,
17
+ " true" ,
18
+ " false" ,
19
+ " null" ,
20
+ * RsConfig .getPrimitiveTypes().map { " def_$it " }.toTypedArray(),
21
+ * RsConfig .getPrimitiveTypes().map { " switch_$it " }.toTypedArray(),
22
+ * RsConfig .getPrimitiveTypes().map { " ${it} array" }.toTypedArray(),
23
+ )
24
+
25
+ override fun isKeyword (name : String , project : Project ? ): Boolean {
26
+ return keywords.contains(name)
27
+ }
28
+
29
+ override fun isIdentifier (name : String , project : Project ? ): Boolean {
30
+ return name.matches(Regex (" [a-zA-Z0-9_+.:]+" ))
31
+ }
32
+ }
Original file line number Diff line number Diff line change 34
34
<lang .findUsagesProvider language =" RuneScriptSymbol" implementationClass =" io.runescript.plugin.ide.usages.RsFindUsagesProvider" />
35
35
<readWriteAccessDetector id =" runescript" implementation =" io.runescript.plugin.ide.usages.RsReadWriteAccessDetector" />
36
36
<lang .refactoringSupport language =" RuneScript" implementationClass =" io.runescript.plugin.ide.refactoring.RsRefactoringSupportProvider" />
37
+
38
+ <!-- Rename Handler -->
37
39
<renameHandler implementation =" io.runescript.plugin.ide.refactoring.RsMemberInplaceRenameHandler" />
40
+ <lang .namesValidator language =" RuneScript" implementationClass =" io.runescript.plugin.ide.refactoring.RsNamesValidator" />
41
+ <lang .namesValidator language =" RuneScriptSymbol" implementationClass =" io.runescript.plugin.ide.refactoring.RsNamesValidator" />
42
+
38
43
<lang .quoteHandler language =" RuneScript" implementationClass =" io.runescript.plugin.ide.RsQuoteHandler" />
39
44
<lang .braceMatcher language =" RuneScript" implementationClass =" io.runescript.plugin.ide.RsBraceMatcher" />
40
45
<lang .commenter language =" RuneScript" implementationClass =" io.runescript.plugin.ide.RsCommenter" />
You can’t perform that action at this time.
0 commit comments