Skip to content

Commit d5d592b

Browse files
committed
fix: fix compatibility verification problems: Scheduled for removal methods usages
1 parent e75f215 commit d5d592b

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

src/main/java/com/tang/intellij/lua/codeInsight/LuaLineMarkerNavigator.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ public void navigate(MouseEvent mouseEvent, T t) {
4040
if (search != null) {
4141
search.forEach(t1 -> {
4242
navElements.add((NavigatablePsiElement) t1);
43+
return true;
4344
});
4445
PsiElementListNavigator.openTargets(mouseEvent,
4546
navElements.toArray(new NavigatablePsiElement[0]),

src/main/java/com/tang/intellij/lua/codeInsight/inspection/RemoveUnusedLocal.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import com.intellij.openapi.util.TextRange
2323
import com.intellij.psi.PsiElementVisitor
2424
import com.intellij.psi.search.searches.ReferencesSearch
2525
import com.intellij.refactoring.RefactoringFactory
26+
import com.intellij.util.Processor
2627
import com.tang.intellij.lua.Constants
2728
import com.tang.intellij.lua.comment.psi.LuaDocPsiElement
2829
import com.tang.intellij.lua.psi.LuaLocalDef
@@ -44,12 +45,12 @@ class RemoveUnusedLocal : LocalInspectionTool() {
4445
return
4546
val search = ReferencesSearch.search(o, o.useScope)
4647
var found = false
47-
for (reference in search) {
48+
search.forEach(Processor { reference ->
4849
if (reference.element !is LuaDocPsiElement) {
4950
found = true
50-
break
5151
}
52-
}
52+
!found
53+
})
5354
if (!found) {
5455
holder.registerProblem(o,
5556
"Unused parameter : '${o.name}'",

src/main/java/com/tang/intellij/lua/project/LuaSourceRootManager.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class LuaSourceRootManager(val project: Project) : PersistentStateComponent<LuaS
3737
val TOPIC: Topic<LuaSourceRootListener> = Topic.create("lua project source root changes", LuaSourceRootListener::class.java)
3838

3939
fun getInstance(project: Project): LuaSourceRootManager {
40-
return project.getComponent(LuaSourceRootManager::class.java)
40+
return project.getService(LuaSourceRootManager::class.java)
4141
}
4242
}
4343

0 commit comments

Comments
 (0)