Comments (14)
Sorry to toss this here again but given the work I am doing here while porting the info code from cljs-tooling
to the orchard
, I was thinking that it might make sense to port the completion code to compliment
too.
The advantages would be multiple:
- One consolidated API - the
compliment
one that most of the tooling understand - One library to rule them all
- One less library to include in
cider-nrepl
I would be doing the work as I am doing it there, bringing all the tests over as well.
The code is not actually that complicated. The ClojureScript *env*
is basically a giant map containing the compiler state.
If @alexander-yakushev is ok I will queue it next.
from compliment.
Hey Andrea, I'm totally OK with Compliment supporting CLJS. I'm just the wrong person to do it because I don't use CLJS much to implement that properly, but if someone comes up with a PR I'd be happy to include it:)
from compliment.
So at the moment there is a big compliment.sources.cljs
namespace with all the sources for ClojureScript.
I saw that you have better separation in the Clojure side and I think at some point I should probably break down the different parts so that we can take advantage of the fuzzy matching.
For now though, this approach was the fastest and it works fine.
from compliment.
Sure! It probably involves rewriting the code to cljc
first, right?
from compliment.
Not for my implementation because it does not support self-hosted clojurescript. It mainly involves unifying the clojure and clojurescript namespaces. See here. Also, we need to reify the different kinds of environments (clojure and clojurescript). My implementation represents the clojure environment with nil and the clojurescript environment with replique.environment/ICljsCompilerEnv (because the clojurescript compiler env is just an atom and thus can't participate into polymorphism). I also added a parameter to all source functions to be able to pass the compiler env. This is a breaking change. I don't know how you would like to handle this.
from compliment.
It would be great to support both self-hosted and normal ClojureScript. Lumo has already a set of functions that complete, it would be really awesome to unify the api under compliment
.
from compliment.
Could someone please explain me the difference in writing a library for self-hosted ClojureScript vs not self-hosted? I have limited experience with CLJS, writing webpages and compiling it with ClojureScript compiler. cljc works there. Is self-hosted option different?
from compliment.
Making compliment to support clojurescript would require to update compliment to understand the clojurescript compiler data (cljs namespaces, vars ...). This is what I have done in replique.
Making compliment to support self-hosted clojurescript would require to use the .cljc extension and to develop alternative implementations for jvm specific code (file system io, classpath ...)
from compliment.
Is self-hosted CLJS implies it running only on Node.js/Nashorn/etc.?
from compliment.
self hosted cljs would implies that some features are platform specific (only on node.js/nashorn/etc) and other features are not (those that do not rely on platform specific code)
For example, "ns-mappings" would not be platform specific, while "resources" would
from compliment.
Hello again folks, I was looking again at completion and specifically at tern for js support. This would be probably be one of the completion providers or middleware in a potentially extensible completion engine. I haven't looked at the code here yet, but I will. Well this comment does not belong here and I don't remember why I put it in this issue 😄
from compliment.
I basically wrote a (basic) layer on top of the cljs compiler state a while ago and, while probably not really complete, it could be reused: https://github.com/Lambda-X/replumb/blob/master/src/cljs/replumb/ast.cljs
from compliment.
This has been started #62
from compliment.
I think we can close this now that we decided this belongs in https://github.com/clojure-emacs/clj-suitable, which provides Compliment sources for ClojureScript completion.
from compliment.
Related Issues (20)
- No completions for locals if context contains qualified keyword with dot in the name HOT 2
- Suggest private vars when using var-quote? HOT 2
- utils/classes-on-classpath can return non-classes HOT 5
- String literals aren't inferred as strings HOT 6
- Give `some->`/`some->>` similar treatment than that of `->`/`->>` HOT 2
- Type inference from static method calls HOT 1
- License on compliment lite HOT 1
- Good completion suggestions require extra type hints HOT 2
- compliment.sources.class-members could add the class to its candidates HOT 4
- Apply sources feature in the doc functionality as well
- Autocomplete java methods from object returned from a deref? HOT 2
- Recognise alternative let-like formats HOT 4
- is there an example how to use `compliment` within emacs but without cider? HOT 2
- Too many completions for Java objects HOT 3
- Don't offer completions for `^:deprecated` vars? HOT 7
- Some of the latest changes are missing in the released version HOT 7
- ns completions for cljc-files HOT 2
- Doc of ns via alias HOT 3
- proposal: completion and documentation with leading literals HOT 7
- var-quote completions without a ns part HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from compliment.