Skip to content

Commit f0a2dbe

Browse files
committed
find references in same file a keyword is defined
1 parent 7be63b2 commit f0a2dbe

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

robotcode/language_server/robotframework/parts/references.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,11 @@ def _yield_owner_and_kw_names(full_name: str) -> Iterator[Tuple[Optional[str], .
283283

284284
@_logger.call
285285
async def _find_keyword_references_in_file(
286-
self, kw_doc: KeywordDoc, lib_doc: Optional[LibraryDoc], file: Path, cancel_token: CancelationToken
286+
self,
287+
kw_doc: KeywordDoc,
288+
lib_doc: Optional[LibraryDoc],
289+
file: Path,
290+
cancel_token: CancelationToken,
287291
) -> List[Location]:
288292
from robot.parsing.lexer.tokens import Token as RobotToken
289293
from robot.parsing.model.statements import (
@@ -299,6 +303,8 @@ async def _find_keyword_references_in_file(
299303

300304
if (
301305
lib_doc is not None
306+
and lib_doc.source is not None
307+
and not Path.samefile(file, lib_doc.source)
302308
and lib_doc not in (e.library_doc for e in (await namespace.get_libraries()).values())
303309
and lib_doc not in (e.library_doc for e in (await namespace.get_resources()).values())
304310
):

0 commit comments

Comments
 (0)