rstudio / rstudio

RStudio is an integrated development environment (IDE) for R
https://posit.co/products/open-source/rstudio/
Other
4.59k stars 1.08k forks source link

Path completion in R Markdown files does't respect "Evalute chunks in directory" option #14710

Open lockjs opened 4 weeks ago

lockjs commented 4 weeks ago

System details

RStudio Edition : Desktop
RStudio Version : Version 2024.04.1+748 (2024.04.1+748)
OS Version      :  macOS 14.4.1 (23E224)
R Version       :  4.3.2 (2023-10-31) -- "Eye Holes"

Steps to reproduce the problem

Open RStudio and change the "R markdown > Evalute chunks in directory" option to "project" Create a new project in R studio In the project directory create the subdirectories "data" and "R" Create a new R markdown file in the "R" directory Create a new file (for example: data.csv) in the "data" directory In the R markdown file insert a code cunk and add the function call read.csv("

Describe the problem in detail

When attempting to specify the path to data.csv file created in the steps above the suggested autocomplete will be resolved from the location of the R markdown file ("./R") rather than the project directory (./) and so no results will be returned. Providing the path ../ will begin to suggest files as expected.

Note, when knitted or run the code chunk is executed correctly, it's only the autocomplete pop-over that uses the incorrect working directory

Describe the behavior you expected

Autocomplete should respect the value of the "Evalute chunks in directory" option and resolve file paths based on the project rather than document root