Coder Social home page Coder Social logo

Comments (15)

pat-s avatar pat-s commented on August 21, 2024 2

This would be really great to have. Saving some keystrokes in the long run :)

from radian.

dylanjm avatar dylanjm commented on August 21, 2024 1

@randy3k This is great. I really appreciate you doing that. I wanted to say though that my original idea was that when you TAB-ENTER to autocomplete a function it would also provide the open and closing brackets for that function and place your cursor in-between those brackets. The console in Rstudio does this and I've posted a gif of what I mean below:

Autocomplete Function Brackets

Currently, rice will auto complete the function name but not provide the opening and closing brackets.

rice currently

Thanks for your time, and I understand if that's a little bigger than intended.

from radian.

dylanjm avatar dylanjm commented on August 21, 2024 1

Hi Randy! It's been a few years and I love this tool you have created. I wanted to check in and see if there have been any changes to the codebase that would allow this functionality?

from radian.

francisbarton avatar francisbarton commented on August 21, 2024 1

I have the same issue as @dylanjm and it is a breaker for me as I am so used to using autocomplete at the RStudio console and having the brackets added automatically. Muscle memory!

from radian.

randy3k avatar randy3k commented on August 21, 2024

Do you mean pairing opening brackets and close brackets?

from radian.

dylanjm avatar dylanjm commented on August 21, 2024

Yes

from radian.

randy3k avatar randy3k commented on August 21, 2024

There is no such feature right now. It should not be hard to implement it in a similar fashion of the auto match feature of Rstudio. 😎 AFAIK, other repls such as julia and IPython also do not auto match brackets. It keeps me wonder why....

from radian.

dylanjm avatar dylanjm commented on August 21, 2024

I can see why developers might want to limit bracket matching, sometimes they can be a pain when you don't need a second bracket. Especially the case for quotations though.

from radian.

randy3k avatar randy3k commented on August 21, 2024

Ah, I understand why other repls do not support auto bracketing. It is mostly because a terminal, in general, cannot distinguish between typing and pasting. For example, copying and pasting foo( may end up with foo() unless the terminal supports bracketed paste mode and the user triggers BPM correctly. There are more bizarre situations when multiple lines are involved.

Yes, it is possible to support auto bracketing. But there are also use cases that auto bracketing becomes problematic.

from radian.

randy3k avatar randy3k commented on August 21, 2024

With that said, I have added a new setting rice.auto_match with the default value set as FALSE.
Check out the dev version and try.

from radian.

randy3k avatar randy3k commented on August 21, 2024

Oic, rice uses R internal completion system and the system tells nothing about what is being suggested, eg whether the suggestion is a variable or a function.

I am afraid that it is impossible by now unless we implement a new completion system, which won’t happen any time soon.

from radian.

dylanjm avatar dylanjm commented on August 21, 2024

ahhh I see, well great. Thanks for implementing the bracket auto-complete

from radian.

randy3k avatar randy3k commented on August 21, 2024

unfortunately, there were not many changes in the completion system to allow this.

from radian.

egoipse avatar egoipse commented on August 21, 2024

Great solution!!!

It works fine with these settings in VS code:

R version 4.2.3 (2023-03-15)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 22.04.2 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.10.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.10.0

locale:
 [1] LC_CTYPE=es_ES.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=es_CL.UTF-8        LC_COLLATE=es_ES.UTF-8    
 [5] LC_MONETARY=es_CL.UTF-8    LC_MESSAGES=es_ES.UTF-8   
 [7] LC_PAPER=es_CL.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=es_CL.UTF-8 LC_IDENTIFICATION=C       

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

from radian.

henningsway avatar henningsway commented on August 21, 2024

is this supposed to work now? do I just have to update radian? :)

from radian.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.