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

Ctrl+click to go to function definition doesn't work if a comment contains the name of the function #4886

Open
etiennebacher opened this issue Oct 3, 2024 · 2 comments
Labels
bug Something isn't working lang: r

Comments

@etiennebacher
Copy link

etiennebacher commented Oct 3, 2024

System details:

Positron and OS details:

Positron Version: 2024.09.0 build 77
Code - OSS Version: 1.93.0
Commit: 9b6f7c0
Date: 2024-09-23T02:37:45.666Z
Electron: 30.4.0
Chromium: 124.0.6367.243
Node.js: 20.15.1
V8: 12.4.254.20-electron.0
OS: Linux x64 6.8.0-45-generic

Interpreter details:

R 4.4.1

Describe the issue:

In some cases, holding Ctrl and clicking on the name of a function doesn't go to the function definition, for instance if a comment has the same name as the function. In the example below, the cursor is moved to the comment instead of the function definition. This only occurs if the comment has 4 dashes or more (maybe because it's recognized as a section?):

my_function <- function() 1

# my_function ----

my_function(1)

Steps to reproduce the issue:

  1. Put this code in a file:
my_function <- function() 1

# my_function ----

my_function(1)
  1. Ctrl+click on my_function(1)

Expected or desired behavior:

Cursor should go to the function definition on the first line.

Were there any error messages in the UI, Output panel, or Developer Tools console?

No

@timtmok
Copy link
Contributor

timtmok commented Oct 4, 2024

Thanks for flagging this! We appreciate your help improving Positron and we’ll address it when we’re working on the next release; keep an eye on this issue for updates 🚀. Thanks again for your help!

@timtmok
Copy link
Contributor

timtmok commented Oct 4, 2024

Note that it seems to break only when ---- has been added to the comment. When it's just the function name, the navigation works.

@timtmok timtmok added lang: r bug Something isn't working labels Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working lang: r
Projects
None yet
Development

No branches or pull requests

2 participants