Skip to content

Commit 7f2cceb

Browse files
committed
Add more logging to R/hover.R to trace SYMBOL_SUB
1 parent 8546de9 commit 7f2cceb

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

R/hover.R

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@ hover_reply <- function(id, uri, workspace, document, point) {
9696
# function parameter
9797
funct <- xml_text(xml_find_first(token,
9898
"preceding-sibling::expr/SYMBOL_FUNCTION_CALL/text()"))
99+
package <- xml_text(xml_find_first(token,
100+
"preceding-sibling::expr/SYMBOL_PACKAGE/text()"))
101+
logger$info("SYMBOL_SUB detected, funct:", funct, "package:", package)
99102
if (!is.na(funct)) {
100103
package <- xml_text(xml_find_first(token,
101104
"preceding-sibling::expr/SYMBOL_PACKAGE/text()"))
@@ -105,7 +108,9 @@ hover_reply <- function(id, uri, workspace, document, point) {
105108
row, col, top = TRUE)
106109
xpath <- glue(signature_xpath, row = row,
107110
token_quote = xml_single_quote(funct))
111+
logger$info("signature_xpath:", xpath)
108112
all_defs <- xml_find_all(enclosing_scopes, xpath)
113+
logger$info("all_defs length:", length(all_defs))
109114
if (length(all_defs)) {
110115
last_def <- all_defs[[length(all_defs)]]
111116
func_line1 <- as.integer(xml_attr(last_def, "line1"))

0 commit comments

Comments
 (0)