Giter VIP home page Giter VIP logo

Comments (14)

arichiardi avatar arichiardi commented on June 14, 2024 1

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.

alexander-yakushev avatar alexander-yakushev commented on June 14, 2024 1

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.

arichiardi avatar arichiardi commented on June 14, 2024 1

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.

alexander-yakushev avatar alexander-yakushev commented on June 14, 2024

Sure! It probably involves rewriting the code to cljc first, right?

from compliment.

EwenG avatar EwenG commented on June 14, 2024

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.

arichiardi avatar arichiardi commented on June 14, 2024

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.

alexander-yakushev avatar alexander-yakushev commented on June 14, 2024

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.

EwenG avatar EwenG commented on June 14, 2024

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.

alexander-yakushev avatar alexander-yakushev commented on June 14, 2024

Is self-hosted CLJS implies it running only on Node.js/Nashorn/etc.?

from compliment.

EwenG avatar EwenG commented on June 14, 2024

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.

arichiardi avatar arichiardi commented on June 14, 2024

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.

arichiardi avatar arichiardi commented on June 14, 2024

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.

arichiardi avatar arichiardi commented on June 14, 2024

This has been started #62

from compliment.

bbatsov avatar bbatsov commented on June 14, 2024

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)

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.