clojure-emacs / cljs-tooling Goto Github PK
View Code? Open in Web Editor NEW[DEPRECATED] Tooling support for ClojureScript
[DEPRECATED] Tooling support for ClojureScript
I want to push out cider-nrepl
0.6.0 (to be in sync with CIDER's own version), but I need a stable release of cljs-tooling
to do so.
In order to provide a similar experience for users of both Clojure and ClojureScript it'd be nice if the completion handling code supported several compliment features:
I guess those should be straightforward to port?
Putting the caret at |
:
(ns withering-spell.views
(:require [re-frame.core :as re-frame]))
(defn main-panel []
(let [name (re-frame/subscribe [:name])]
(fn []
[:div
[:h1.lion "Headline"]
[:ul
(for [x (range 1 4)]
[:li x])]
[:div "Hi"]
[:ul
[:li "Cat is coming"]]
[:button {:on-click #(re-frame/|)}]
"I am your Death. Hello from " @name]
)))
And pressing tab
returns no completions. The ns form is loaded. Is this expected behavior? Default clojure.core things do auto-complete (like map
).
In order not only to solve clojure-emacs/cider#2523 but also to have more consistency between the Clojure and ClojureScript tooling world, I have started porting the cljs-tooling.info
namespace to orchard
.
When a source file does't have a single def form, cljs-tooling.util.analysis/find-ns return value has {} for the key :defs. Since cider.nrepl.middleware.ns/ns-path checks this through cljs-tooling.info/info to find the source file path, cider utilities like cider-find-keyword fails with message "Can't find namespace".
Usually it should not be an issue. Just in the particular case of a re-frame project, it is common to have separate files for just the subscriptions and/or event registrations. They won't be having any def form otherwise. Looking up the event and subscription definitions is very helpful and easy with cider-find-keyword. However, due to lack of def forms, this doesn't work. Workaround is to just remember to add at least one def form (dummy).
It would be very convinient if the library can be enhanced to tackle this case and at least the :file be present instead of just the empty map {}.
If i'm in cljs.user
, I can find information about vars in my namespace, but I can't find info about vars brought in from clojurescript core.
Ie,
(-->
op "info"
session "846fed44-d63a-4dc1-b123-48f51d506853"
ns "cljc-bug.core"
symbol "def"
id "44"
)
(<--
id "44"
session "846fed44-d63a-4dc1-b123-48f51d506853"
status ("done" "no-info")
)
Ideally, I'd like for this to find the info. Raised in an issue on CIDER here issue 1358
Like in lumo
for a start: https://github.com/anmonteiro/lumo/blob/master/src/cljs/snapshot/lumo/repl.cljs#L1240
If I remember correctly there was a problem with that implementation, still a good start.
Emacs has a feature that allows you to annotate a completion candidate with addition information - e.g. the type of the candidate (function, macro, interface, etc). You can see the feature in action for Emacs Lisp completions. For this to effectively used, however, it'd be beneficial if one could retrieve a completion candidate together with some metadata regarding it (perhaps the type and the ns/package of the candidate, maybe others make sense as well), so avoid having to do one of two things:
retrieve the metadata for each candidate individually (which is slow)
retrieve all candidates and then do a second function call to retrieve the metadata for all of them
Obviously this is not a must-have feature, but it'd be nice to have something like this in tools like CIDER. I'm also not quite sure if packages like compliment should handle this or their clients, but I wanted to start a discussion on the subject.
I've opened a similar issue for compliment (alexander-yakushev/compliment#16).
The info op, for cljs, now returns {}
when nothing is found. I think we should be consistent with the return value for the clojure info op, which returns nil
. Using nil
allows us to use when-let
and friends to better effect.
I'm hoping to release CIDER 0.9 soon, so a new cljs-tooling release would be handy.
Running into issues with 0.3.0 with navigating to a var's definition. To recreate, attempt to navigate to a var defined in the same namespace. Getting "user-error: Symbol ‘thing’ not resolved" and no-info back in the nrepl logs.
I built cider-nrepl and pointed cljs-tooling back at 0.2.0 (currently went through 0.3.0-snapshot and 0.3.0) and the navigation is restored.
I was gonna jump into this myself but I see that there was a lot of work around self-hosted so I was wondering if @arichiardi might point me in the right direction first.
When type:
(js/THR
Expected complete list:
(js/THREE
...
I think a enhancement required here
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.