Skip to content

Commit dbf884c

Browse files
committed
修复override hint 无法跳转的bug
1 parent 1399c70 commit dbf884c

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

EmmyLua-LS/src/main/kotlin/com/tang/vscode/LuaTextDocumentService.kt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -276,11 +276,8 @@ class LuaTextDocumentService(private val workspace: LuaWorkspaceService) : TextD
276276
if (range != null && sourceFile != null)
277277
list.add(Location(sourceFile.uri.toString(), range.toRange(sourceFile)))
278278
} else if (target != null) {
279-
val query = ReferencesSearch.search(target)
280-
query.forEach { ref ->
281-
val luaFile = ref.element.containingFile.virtualFile as LuaFile
282-
list.add(Location(luaFile.uri.toString(), ref.getRangeInFile(luaFile)))
283-
}
279+
val luaFile = psiFile.virtualFile as LuaFile
280+
list.add(Location(luaFile.uri.toString(), target.textRange.toRange(luaFile)))
284281
}
285282
}
286283
}

EmmyLua-LS/src/main/kotlin/com/tang/vscode/documentation/DocRenderer.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,12 @@ internal fun renderFieldDef(sb: StringBuilder, def: LuaDocTagField) {
176176
internal fun renderDocParam(sb: StringBuilder, child: LuaDocTagParam) {
177177
val paramNameRef = child.paramNameRef
178178
val commentString = child.commentString
179-
if (paramNameRef != null && commentString != null && commentString.text.isNotEmpty()) {
179+
if (paramNameRef != null && commentString != null) {
180180
sb.appendLine("(parameter) `${paramNameRef.text}${if (child.isNullable) "?" else ""}`: ")
181181
renderTypeUnion(null, null, sb, child.ty)
182-
renderCommentString(" ", null, sb, commentString)
182+
if(commentString.text.isNotEmpty()) {
183+
renderCommentString(" ", null, sb, commentString)
184+
}
183185
}
184186
}
185187

0 commit comments

Comments
 (0)