Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

ClojureScript #16

Closed
damassi opened this issue Dec 27, 2015 · 12 comments
Closed

ClojureScript #16

damassi opened this issue Dec 27, 2015 · 12 comments
Labels

Comments

@damassi
Copy link

damassi commented Dec 27, 2015

Would it be simple to modify this plugin to support ClojureScript as well?

@Arcanemagus
Copy link
Member

Assuming the clojure.jar file supports it with the same options and the same output format it should be as simple as adding that to the list of supported scopes. Have you tried that locally?

@damassi
Copy link
Author

damassi commented Dec 28, 2015

@Arcanemagus - can you explain a little better what you mean? I'm very new to Clojure / ClojureScript development, though an experienced programmer

@Arcanemagus
Copy link
Member

In this block of code the command that gets executed is built up. First either java or the contents of javaExecutablePath is used as the command base. The the parameters get assembled. By default it looks like it runs something similar to this:

java -jar /path/to/closure-1.7.0.jar -i /path/to/file_currently_open.ext

So if you manually run a command like that on a ClojurScript file and get reasonable output, ClojustScript should work if it is added to the list of grammarScopes for this plugin.

Having said all that, now that I've checked while writing that up I see that it should already be working since source.clojurescript is in the list of allowed grammars, do you have an example file where it isn't working? What do you get when you run Editor: Log Cursor Scope (Ctrl + Shift + Alt + P) on a ClosureScript file?

@damassi
Copy link
Author

damassi commented Dec 28, 2015

Thanks for working through this :)

When I run log cursor scope this is what's returned:

Scopes at Cursor
source.clojure
meta.expression.clojure
meta.definition.global.clojure
meta.expression.clojure
meta.expression.clojure
meta.expression.clojure
meta.expression.clojure

And here's an example of a basic linting error:

screen shot 2015-12-28 at 3 20 26 pm

And one more:
screen shot 2015-12-28 at 3 25 23 pm

@Arcanemagus
Copy link
Member

Looks like it's working properly already then 😛

Were you expecting something that it isn't doing, or had you just not tried it yet?

@damassi
Copy link
Author

damassi commented Dec 28, 2015

Well what I mean about supporting ClojureScript is js->clj shouldn't be unresolved (its a common built in function in the global js namespace), and neither should defproject -- unless I am misunderstanding something?

@Arcanemagus
Copy link
Member

You'll have to ask somebody familiar with ClojureScript for that, @trevershick?

@Arcanemagus
Copy link
Member

Marking this as closed since linter-clojure is already running on ClojureScript files, feel free to continue the discussion though 😉.

@damassi
Copy link
Author

damassi commented Dec 28, 2015

Sounds good. @trevershick, any help would be appreciated. I know there is a cljs.jar file that is used to compile ClojureScript; wondering if we could leverage that somehow within the library along with the typical clojure.jar that is used for linting.

@Arcanemagus
Copy link
Member

Just to be clear, I have no experience with Clojure beyond knowing it's a language. If there are actual implementation details that need changing to get proper support in by all means please reopen this issue.

@damassi
Copy link
Author

damassi commented Dec 28, 2015

I'm assuming there is, but I honestly have no clue what they could be (total noob here). Whatever it is I imagine its trivial, though, as there are linters available for other editors.

@trevershick
Copy link
Contributor

I'll take a look. I've been ill lately but i'll look after the new year.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants