Code Monkey home page Code Monkey logo

clojurevscode's People

Contributors

abogoyavlensky avatar alek-sys avatar alessandrod avatar avli avatar biesiad avatar dependabot[bot] avatar dijonkitchen avatar fachammer avatar fasfsfgs avatar jylhis avatar katsuyan avatar m90 avatar marcomorain avatar mhansen avatar mikeball avatar tonsky avatar vganshin avatar yurtaev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

clojurevscode's Issues

Possible Support for Both CLJ and CLJS Repls in single project?

This is just a preliminary thought, but I wanted to post here for discussion.

It might very nice to have the ability to run both a clj and cljs repl in a single project. I know this is probably a complex/big feature, but it seems like it would effect the architecture of the entire extension so it might make sense to start thinking about it early.

Having 2 repls brings up some hard questions like how to handle .cljc files? Should they be sent to one or should they be sent to both repls on evaluation? What about errors coming back?

Or perhaps it should simply be 1 repl per editor and the clj and cljs editing should be separate?

Embed lumo as the inbuilt clojurescript repl

Hi @avli ,

I'd like to suggest that the self-hosted Clojurescript in clojureVSCode should be based on lumo .

This will enable the package to be developed in a proper and almost complete implementation of Clojurescript.

Show the embedded nREPL output to the VSCode output channel

We should think if we want to wire the embedded nREPL output with the VSCode output channel. I can see both pros and cons in this approach.

Pros:

  • Some users may found it useful to see the embedded nREPL output in the VSCode output channel. * This also makes the debugging easier.

Cons:

  • Leiningen prints a lot of service information on start which may be confusing and distracting.

Automatically evaluate NSs on save

Hi!

This is tangentially related to a few recent issues, namely #70 and #59 - I'd like to get automatic evaluation of all code in project source files mainly to enable IntelliSense navigation immediately in the following two cases:

  • When I open VSCode
  • Whenever file is saved, either automatically due to focus loss or by hand

The main idea here is to keep code navigation as up to date as possible and the nice side effect of course is that it becomes really easy to check whether what I've just written makes sense or not. I'm sure there's some alternate route I could take and create a two-command macro in VSCode itself but I'd rather have this as add-on feature so that I can also turn it off at times if I'm, for example, working on such a humongous project that VSCode would grind to halt if it was autoevaluated.

(and with my track record this already exists in some form, I just couldn't find it before posting... :))

Suggestion: default the 'host' question to 'localhost'?

Hi folks, I've been using this mode for VS Code, and I love it. Thanks for all your hard work.

I have a little UX suggestion: when connecting to the nREPL, default the 'host' question box to 'localhost'. I expect 99% of the time localhost will be the answer, so perhaps it's an option to even elide the question entirely, or just have one box where you can type a port or a host:port combo?

Thanks,
Mark

Go to definition implementation

This is a must for any language support extension. As far as I can see, this feature is currently supported only with Javascript in VS Code, which leads me to believe it might be due to external support eg. Node.

Do you guys have any channel of communication, I could help with this.

Can't slurp file with repl eval

Given this code:

(defn process-file [fname]
  (slurp (clojure.java.io/resource fname)))

(process-file "hello.txt")

and this file in resources/hello.txt:

Hello Resources!

When I eval
Then I get a stacktrace:

clojure.lang.Compiler$CompilerException java.lang.IllegalArgumentException: Cannot open <nil> as a Reader.
 at null:69:22
    clojure.lang.Compiler$InvokeExpr.eval (Compiler.java:3657)
    clojure.lang.Compiler$DefExpr.eval (Compiler.java:451)
    clojure.lang.Compiler.eval (Compiler.java:6932)
    clojure.lang.Compiler.load (Compiler.java:7379)
    clojure.lang.Compiler.eval (Compiler.java:6927)
    clojure.lang.Compiler.eval (Compiler.java:6890)
    clojure.tools.nrepl.middleware.interruptible_eval$evaluate$fn__5508.invoke (interruptible_eval.clj:87)
    clojure.tools.nrepl.middleware.interruptible_eval$evaluate.invokeStatic (interruptible_eval.clj:85)
    clojure.tools.nrepl.middleware.interruptible_eval$evaluate.invoke (interruptible_eval.clj:55)
    clojure.tools.nrepl.middleware.interruptible_eval$interruptible_eval$fn__5553$fn__5556.invoke (interruptible_eval.clj:224)
    clojure.tools.nrepl.middleware.interruptible_eval$run_next$fn__5548.invoke (interruptible_eval.clj:192)

This works without issue in a lein repl.

Evaluation of 'this form'

I'd love a way to evaluate the outermost form (searching from the position of the cursor, similar to proto-repl for Atom). This way I won't have to select the whole text/form I want to evaluate.

(sorry if this is already possible, I didn't find a way to do this)

Code tooltips and navigation not working on Mac (latest version)

I'm running the latest version of VS Code (1.15.0), the clojureVSCode plugin (0.7.10), and Mac OSX (10.12.6).

I get decent intellisense for functions in the core namespace, but not for symbols in my own files. I don't get any of the doc comments on hover (or as typing) that are shown in the demos. I also can't do any code-navigation.

It does show that nrepl is connected (in the lower toolbar).

Is there something I need to do to properly configure things?

Show compilation errors?

I've searched through the old issues here and can't find anything.

Simply, how do I display what the compilation errors are? I'm getting compile errors when trying to eval some code, but I can't for the life of me figure out how to see them.

Compilation errors in "Output" panel instead of "Problems" panel

@avli
How do you feel about putting the eval compilation errors in the "Output" panel, instead of the "Problems" panel?

This is how proto-repl displays compilation errors, and I think it is more convenient, since one doesn't need to click or hotkey to the other panel for feedback.

From a workflow perspective, it just feels clunky to me to have to change panels to see all the Repl output. I don't want to move my cursor, and I don't want to memorize the hotkeys to switch between the Output and Problems panes.

Moreover, from a logical perspective, should the repl compiler errors even fall under "Problem", anyways?
The blank Problems window reads: No problems have been detected in the workspace so far.

The eval compilation may fail due to issues that are not directly related to your workspace, your code, etc. For example, when you eval a function (foo) without first evaluating (defn foo [] ()). Therefore I think that categorically speaking, Output may be a more fitting place for the repl compilation errors.

Check if the user has declared the plugin and dependency

As written on README.md from earlier versions, for this extension to function properly when using Connect to a running nREPL it's necessary for the user to add cider-nrepl plugin and tools.nrepl dependency.

If they don't do it, there are no clear warnings about it and the extension just doesn't work as intended (as seen on #30 comments).

The idea here is to check if those dependencies are correctly declared and warn the user otherwise.

Reconnect to a new nRepl

Sometimes it is necessary to restart the nrepl.
It would be convenient to drop the current connection and reconnect.
Presently, it seems like a VSCode "Reload Window" does the trick.
If that is the best approach then an update to the documentation would be nice.

where could I find console log?

I used it on my 2 macs, one is ok, the other cannot work(printing "Starting nREPL..." like, forever).
I ps grep java, and found the java process will disappear after a while, so I want to see what happened, but I cannot find any console output.
Thanks

Dev Docs

For those that might want to assist in development work on clojureVSCode, it would be very helpful to document process to setup development of, and make/test changes to the extension. Thanks!

Possible bug in clojureDefinition.ts

Hey, I totally randomly stumbled upon your extension. I was just looking for some example VS Code language support extensions :)

While reading clojureDefinition.ts I noticed there is probably a return statement missing at line 31, or maybe I'm missing something. I think the code that follows should throw if info.file is null/undefined/empty? But apparently that never happened yet?

Error 'Can't start nREPL'

I think the issue is that you're invoking lein with LEIN_ARGS, defining a bunch of libraries wanted, but I don't have those libraries installed.

Then lein prints this to stderr:
"""
Retrieving refactor-nrepl/refactor-nrepl/2.3.0-SNAPSHOT/refactor-nrepl-2.3.0-20170531.195417-17.jar from clojars
Retrieving org/clojure/clojure/1.2.0/clojure-1.2.0.jar from central
Retrieving cider/cider-nrepl/0.15.0-SNAPSHOT/cider-nrepl-0.15.0-20170720.063753-24.pom from clojars
Retrieving org/clojure/tools.nrepl/0.2.13/tools.nrepl-0.2.13.pom from central
Retrieving org/clojure/pom.contrib/0.2.2/pom.contrib-0.2.2.pom from central
Retrieving org/tcrawley/dynapath/0.2.5/dynapath-0.2.5.pom from central
"""

And we treat any data coming in off stderr as a signal to stop() and reject the start promise:
https://github.com/avli/clojureVSCode/blob/master/src/nreplController.ts#L49
Then it kills the process.

I imagine this didn't happen during development because you already have these libraries installed on your machine?

Debugging screenshot illustrating the point (see the console at the bottom, printing out the stderr data we received):
screen shot 2017-07-23 at 12 20 55

What can we do? Maybe
(a) document that these libraries are required?
(b) install these libraries? lein tries to, but it gets killed soon after.
(c) assume processes will send user-facing information to stderr (rather than it explicitly signalling an error), and only treat a non-zero exit code as actually signalling error?

(c) seems best to me. What do you think?

Unable to start nREPL

Description: When opening a lein project for the first time or choosing Clojure: start nREPL from the command palette, the nREPL is not started and the error, "Can't start nREPL." is seen. Nothing is shown in the Problems or Debug Console panel.

System info

  • macOS Sierra 10.12.6
  • VSCode 1.14.1
  • clojureVSCode 0.7.4
  • Leiningen 2.7.1
  • Clojure 1.8.0
  • REPL-y 0.3,7, nREPL 0.2.12
  • Java 1.8.0_131-b11

Steps to reproduce

  1. Start a new Clojure project with lein new app foo && cd foo
  2. Open the project in VSCode and open src/foo/core.clj
  3. Note that the error "Can't start nREPL." is shown
  4. Open command palette with Cmd+Shift+P
  5. Select Clojure: start nREPL
  6. Note that the error "Can't start nREPL." is shown

Starting a REPL in the CLI and connecting as described in #11 works perfectly, though.

Newline character breaks Format command

When I run the following code

(reduce
  (fn [acc next]
                  (str acc "\n" next))
   ""
        ["foo"
    "bar"])

against the extensions "Format" command the newline character in the string concatenation will do unecpected things and I receive the following result:

(reduce
 (fn [acc next]
   (str acc "\
" next))
 ""
 ["foo"
  "bar"])

which is invalid code. Running the original snippet against lein-cljfmts fix works as expected:

(reduce
 (fn [acc next]
   (str acc "\n" next))
 ""
 ["foo"
  "bar"])

Never having worked in the VSCode ecosystem I am slightly stumped on where to look for the cause of this, but if you could give me a hint or two, I'd be more than happy to fix this myself.

Remove dependency step in order to use the extension

coda_hale commented this in reddit

Looks like a great start, and it's awesome to see more high-quality support for Clojure!
One quick note: I'm pretty sure you can get around the manual cider-nrepl/nrepl dependencies steps if you invoke lein the same way cider does:

/usr/local/bin/lein update-in :dependencies conj \
  \[org.clojure/tools.nrepl\ \"0.2.12\"\ \:exclusions\ \
  \[org.clojure/clojure\]\] -- update-in :plugins conj \
  \[refactor-nrepl\ \"2.3.0-SNAPSHOT\"\] -- update-in :plugins conj \
  \[cider/cider-nrepl\ \"0.15.0-SNAPSHOT\"\] -- repl :headless

That also means you're not tied down to a particular version of those libraries.

Support 'def', 'defn' and 'fn' optional parameters on signature helper

As far as I know, clojure doesn't have the notion of optional parameters.

These operations ('def', 'defn' and 'fn') are widely used and their current signature have some optional parameters that are handled inside their implementation. Since the signature helper just looks at the parameter position, sometimes it shows the wrong active parameter (as already noted by @avli in #15).

It would be nice to try to provide better signature helper for them that takes into account more information than just their parameter position.

command 'clojureVSCode.manuallyConnectToNRepl' not found

PROBLEM:
cannot connect to running REPL.

REPRO:

  1. Install extension and reload per normal.
  2. Set the "clojureVSCode.autoStartNRepl" setting to false
  3. Try to attach to a running repl by Cmd+Shift+P : Clojure: connect to a running nREPL

EXPECTED:
Successful connect to running REPL

OBSERVED:
"command 'clojureVSCode.manuallyConnectToNRepl' not found"

ENVT:
Mac OSX 10.12
VSCODE 1.16.1

NOTE: Also found that the nREPL was also taking an indefinite amt of time when automatically starting-

Fewer Successful Compiled Notifications?

After you eval, a "Successfully Compiled" notification appears at top of editor.

Perhaps it should be shown after eval of the entire file to give indication that the operation was successful, but it might be nice if it faded away after a few seconds.

It probably should not be shown after "Eval and show the result" operations because indications the result was returned is shown in the output window, and the top bar notification becomes a nuisance during repeated usage.

Only 1 line of output is printed to console per eval

It looks like you're only grabbing one line of output

I have my code hooked up to a lein repl, and the following command only prints "hello" (and not "world")

(when true
(println "hello")
(println "world"))

Better Clojure syntax support

The grammar file that comes with Visual Studio Code is far from perfect especially in terms of indenting. We should consider to improve it in order to conquer the world :-)

Add an option for disabling the REPL autostart

Hi!

Due to Reasons™ I'm currently working with a project that uses the lately hyped monorepo pattern; that is, within the same repository the first level of subdirectories are each their own individual projects meaning the build configs etc. are also in those subdirectories, not the project root. In this context running the nREPL from project root doesn't really produce anything useful as it will systematically fail at loading anything without rigorous typing and it is just far easier to jump to the Terminal tab, cd sub-dir and start another REPL from there onwards.

Of course supporting monorepos could be a nice feature, especially with VSCode itself being soon able to have multi-root workspaces but that's something for the future, for immediate issue just having a switch for nREPL works the best IMHO :)

Manually connecting to nREPL should call stopLoadingAnimation()

Hello there,

First off, great work so far!

As you can probably tell from the title, when manually connecting, this doesn't stop the loading animation in the bottom of the vs code window, and it just kind of ticks over forever, occasionally distracting me and making me think I have a notification of some sort.

Please let me know if you need any more information or steps to replicate.

Thanks!
-Jordan

Syntax highlightling issue

Following code isn't highlighted correctly:

(map (fn [[k v]] (str (name k) "=\"" v \")) xs)

This breaks all further syntax highlighting.

Thanks!

Watch file system for changes to .nrepl-port

Currently, we try to updateConnectionParams() by reading the .nrepl-port file during extension activation (when a clojure file is first opened), then we try to auto-connect.

This fails when you open the clojure file first, then the repl after extension activation.

Perhaps we can setup a file watcher, and automatically connect to the repl if a .nrepl-port file becomes available?

This isn't a fully fleshed-out idea: we'll need to think a bit about how to handle a change the .nrepl-port file when we're already connected to a nrepl. Do we connect to the new one? Or keep the existing one - which may be closed, and maybe we haven't noticed it's gone? I'd propose taking the less-destructive route of staying with the existing REPL.

What do you think?

Support for boot when connecting to a running nrepl

From @pdkovacs at #47:

Hmm, after following the boot-related config steps described in https://github.com/boot-clj/boot/wiki/Cider-REPL (more specifically fixing ~/.boot/profile.boot described in A better way / point 1.), everything works nicely for me.

After working some more with VS Code, it turned out that code completion doesn't work for me with a Boot REPL after all. With the plugin's built-in REPL starter, code-completion seems to work, but as I currently have my project configurations in Boot, I cannot really use it for testing.

In addition to the user-global profile, I mentioned in my previous comment, I have my project specific Boot settings as in https://github.com/pdkovacs/clj-todo .

Thinking about what might have solved the actual issue at hand for me, I have removed something (sorry, I don't remember anymore exactly what it was) from ~/lein/profiles.clj. It is currently at the bare minimum of:

{:user
  {:dependencies [[org.clojure/tools.nrepl "0.2.13"]]}
}
Let me know if I can help any more with this.

This is also related with #31.

command not found

screen shot 2560-08-18 at 6 17 21 pm

After I installed the plugin. I can not run command to connect repl.
It displays command not found.
I've tried uninstall and reinstall but it doesn't work.

Contributing more features?

Hi, I'm not sure what features you want to include in this extension over time, but I started adding some features that are important to my workflow. So far I've added cider-nrepl's "refresh-all namespaces" and "run all tests in project". I'm sure it needs more testing and cleanup (I'm not a javascript developer). If this is something you would be interested in having contributed to the extension, just let me know!

https://github.com/matthias-margush/clojureVSCode/tree/refresh-test

Reload code with defmulti/defmethod in REPL

Thanks so much for really nice extension.

Currently, if file have defmulti/defmethod code changed, it couldn't reload (eval) in REPL. Is it limited of repl/cider-nrepl/.., or something we can improve?

Thanks,

Println output not shown?

Does println or output get shown anywhere? When selecting and evaluating the expression below, no output is show in the external repl, the output window or any other locations I checked within vscode.

(println "hi") 

CPU usage ~25%

After NRepl started, while idle in the editor, java.exe CPU usage hovers around 25% with the August 1 version of the extension. Killing Visual Studio Code results in zombie java.exe which must be killed seperately.

Windows 10 1703 build 15063.540
Visual Studio Code: version 1.15.0
Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)

Please advise on how to troubleshoot.

Show Detailed Compilation Errors

When selecting a block of code that will cause an exception, and evaluating it with "Clojure: Eval and show the result", an error notification bar is shown at top of editor, but no details on the error are displayed.

Are error details already show in some location? Perhaps error details could be show in the output window?

Better demo video

The current video is just 100% reflection of my movie director skills, in other words, it sucks :) If you can provide a better one, please, send it to me.

Good examples are vscode-go and pythonVSCode.

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.