Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Signature help not show up in if-else branch #530

Closed
renkun-ken opened this issue Mar 10, 2022 · 1 comment · Fixed by #541
Closed

Signature help not show up in if-else branch #530

renkun-ken opened this issue Mar 10, 2022 · 1 comment · Fixed by #541
Labels

Comments

@renkun-ken
Copy link
Member

Consider the following code:

if (sum()) {

} else if (sum()) {

}

In the if (sum()) branch, the signature help of sum() works while it does not work in the else if (sum()) branch when I type sum(.

@renkun-ken renkun-ken added the bug label Mar 14, 2022
@randy3k
Copy link
Member

randy3k commented Apr 18, 2022

It is due to a bug in the function find_unbalanced_bracket:

languageserver:::find_unbalanced_bracket("if (sum())", 0, 7)
[[1]]
[1] 0 7

[[2]]
[1] "("

# it finds a wrong `(` when there is a leading brace `}`
languageserver:::find_unbalanced_bracket("} if (sum())", 0, 9)
[[1]]
[1] 0 5

[[2]]
[1] "("

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants