Giter Site home page Giter Site logo

Comments (8)

trevor-brandt avatar trevor-brandt commented on July 20, 2024 1

Hi Peter! Thanks for the reply. You're right that I hadn't seen the update before I filed the issue.

After updating and coming back to the plugin, the Reconnect command does indeed do what I'm looking for, so I'm a happy camper! I'll close this issue out.

I've been considering abandoning VSCode for my Clojure work because it seems to miss some important features that Atom supports, but I don't like Atom nearly as much as an editor. However, the inline evaluation of forms and the "evaluate and send to REPL" functions of your extension help tremendously with my VSCode satisfaction!

If I were to choose the one big thing that bothers me about Clojure in VSCode (besides the fact that the parinfer extension is a little buggy and isn't actively supported), it would be auto-indent support that follows the style-guide. Maybe something you could potentially put on your to-do list if you're taking requests 😄

from calva.

PEZ avatar PEZ commented on July 20, 2024

Hello! Very nice to hear from you. I have been dying to get some feedback on how the extension works out there.

I am not sure I understand the process described completely, so please bear with me if I seem to answer it with nonsense. =) This is the process I have intended to support:

  1. Start the REPL from a terminal somewhere.
  2. Open the project in VS Code
  3. Notice that clojure4vscode connects to the REPL.
  4. Start bending reality with the power of Clojure.

The reason I've not put effort into starting the real from VS Code is that the project I work most on takes a while to start, and if I need to restart VS Code I don't like the penalty to wait for it to start the REPL again.

I think your desired process is almost supported if you use the Reconnect command. And I can certainly make it so that if no .nrepl-port file is found, the connection label in the status bar is clickable.

This all said. Just a few hours before you filed this issue I updated the plugin so that it automatically starts a REPL in the terminal connected to the REPL started from a terminal somewhere. And I am thinking that maybe you haven't/hadn't seen that update yet? With this version you get some more commands that helps working with the terminal REPL together with the code being edited, such as switching to the edited namespace, and evaluating code being edited in the terminal REPL.

Please let me know if you have tried version 1.2 yet and what you think about it, if so.

Hoping you will keep finding this extension useful. And will put in work to make it so. 🤠

from calva.

PEZ avatar PEZ commented on July 20, 2024

Glad your workflow is working again! Still curious about you think of the integrated Terminal REPL support, please feel invited to file more issues or just comment on that in this thread.

I haven't noticed the auto-indent thing. Can you tell a way or two it fails? (I mostly use Paredit to get things indented, and haven't studied the style guide very closely.)

Didn't know the parinfer extension was abandonware. That is not good and explains some of the pain it deals out, but it still is delivering much more bliss so still using it. Maybe you should make ourself available as the maintainer? 🤠

from calva.

PEZ avatar PEZ commented on July 20, 2024

One more thing. I think your way of starting the REPL would benefit from configuring the extension to not autoconnect to the REPL:

"clojure4vscode.autoConnect": false

(I also think starting the REPL from the internal terminal will get a bit confusing with the internal terminal REPL that the extension starts upon connecting, but anyway. 😀)

from calva.

trevor-brandt avatar trevor-brandt commented on July 20, 2024

Oh yeah, turning off autoConnect does work for me. Thanks for that tip!

For formatting/identing, a good example is using a let form.

Consider the following snippet:

(let [x :first-val
      y :second-val]
  (println x y))

As you're typing that out, hitting the return key after :first-val should, if honoring the style guide, put your cursor directly below x, so that when you then type y, the x and y should be vertically aligned. However, VSCode instead either puts you back at the beginning of the next line (if auto-indent is off) or indents you only 2 spaces (if auto-indent is on).

But then, hitting return after typing the closing bracket ] after :second-val, the cursor should then be placed on the next line and indented two spaces, according to the style guide. But VSCode "intelligently" decides that you're trying to indent everything at the same indentation as the last couple variables, so it then puts you directly under the y, even though this time that's not what you wanted.

I think the parinfer plugin takes care of some of this if you're using the right setting, but I type pretty fast, and parinfer becomes very unpredictable with fast typing because it has slow response time. And personally, I'd rather have to manually format stuff than have to manually undo unpredictable plugin behavior.

Being a maintainer is a good suggestion, but I'm already struggling to finish projects I'm already committed to :(

from calva.

PEZ avatar PEZ commented on July 20, 2024

Thanks. I'll have a look at how these things are determined in VS Code. The responsibilities among the different plugins and core VS Code are unclear to me. But it makes some sense that this plugin should try take care of autoindenting.

from calva.

trevor-brandt avatar trevor-brandt commented on July 20, 2024

And just to follow-up about the parinfer extension... suddenly it's working a lot better, even though there hasn't been any updates. I wonder if something about VSCode got updated or maybe turning paredit back on somehow makes it interact and work better, though I don't see how. But it's suddenly feeling very usable to me, which is awesome! Honestly, if all this keeps working in conjunction with your plugin, the only Clojure integration that I would really feel like VSCode is missing is the auto-indentation issue. That would be amazing. If you decide to tackle it sometime, I'd be happy to help you test and give suggestions for different indentation cases. (Least I could do, of course, given that you're doing the heavy lifting.)

from calva.

PEZ avatar PEZ commented on July 20, 2024

Hello. Started a new issue, #3, for this auto-indentation business. Please feel invited to add more examples.

See also #4.

from calva.

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.