This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # adventofcode (135)
- # announcements (1)
- # beginners (192)
- # boot (5)
- # calva (130)
- # cider (42)
- # cljdoc (4)
- # cljs-dev (6)
- # cljsrn (3)
- # clojure (222)
- # clojure-europe (2)
- # clojure-greece (5)
- # clojure-italy (24)
- # clojure-nl (23)
- # clojure-russia (1)
- # clojure-spec (6)
- # clojure-uk (67)
- # clojurescript (35)
- # cursive (39)
- # datomic (61)
- # emacs (17)
- # figwheel (3)
- # figwheel-main (2)
- # fulcro (12)
- # hyperfiddle (10)
- # juxt (3)
- # leiningen (10)
- # nrepl (35)
- # off-topic (34)
- # onyx (3)
- # pathom (6)
- # quil (5)
- # re-frame (29)
- # reitit (6)
- # ring (1)
- # ring-swagger (8)
- # shadow-cljs (37)
- # spacemacs (9)
- # sql (9)
- # tools-deps (24)
- # unrepl (1)
- # vim (1)
Friends of Calva. I need some help testing this build of Calva Formatter. It should be about exactly the same as the currently released one, but it is built in a quite different manner. The formatting library is published as an NPM module and then required by the TS code. The idea is that all Calva extensions should be able to share the same library. From what I can see this version of Calva Formatter works fine, but I had all sorts of problem getting it there so I'd like some help in testing it.
12/12/2018 12:15:45 - Microsoft VSIX Installer 12/12/2018 12:15:45 - ------------------------------------------- 12/12/2018 12:15:45 - vsixinstaller.exe version: 12/12/2018 12:15:45 - 15.5.99+g87f89a485e 12/12/2018 12:15:45 - ------------------------------------------- 12/12/2018 12:15:45 - Command line parameters: 12/12/2018 12:15:45 - C:\Program Files (x86)\Microsoft Visual Studio\Installer\resources\app\ServiceHub\Services\Microsoft.VisualStudio.Setup.Service\VSIXInstaller.exe,C:\Users\Me\Downloads\calva-fmt-0.0.30-calva-lib.vsix 12/12/2018 12:15:45 - ------------------------------------------- 12/12/2018 12:15:45 - Microsoft VSIX Installer 12/12/2018 12:15:45 - ------------------------------------------- 12/12/2018 12:15:46 - Initializing Install... 12/12/2018 12:15:46 - Microsoft.VisualStudio.ExtensionManager.InvalidExtensionManifestException: Element 'Identity' has invalid value for attribute 'Version' ---> System.FormatException: Input string was not in a correct format. at System.Version.VersionResult.SetFailure(ParseFailureKind failure, String argument) at System.Version.TryParseComponent(String component, String componentName, VersionResult& result, Int32& parsedComponent) at System.Version.TryParseVersion(String version, VersionResult& result) at System.Version.Parse(String input) at System.Version..ctor(String version) at Microsoft.VisualStudio.ExtensionManager.ExtensionImpl.<>c.<ExtractManifestData>b__64_1(String s) at Microsoft.VisualStudio.ExtensionManager.ExtensionImpl.VerifyStringValue[T](String value, ErrorInfo info, Func`2 selector, Boolean isRequired, Int32 maxLength, T defaultValue) --- End of inner exception stack trace --- at Microsoft.VisualStudio.ExtensionManager.ExtensionImpl.VerifyStringValue[T](String value, ErrorInfo info, Func`2 selector, Boolean isRequired, Int32 maxLength, T defaultValue) at Microsoft.VisualStudio.ExtensionManager.ExtensionImpl.ExtractManifestData(PackageManifest manifest) at Microsoft.VisualStudio.ExtensionManager.ExtensionImpl.ReadPackageManifest(XmlReader reader) at Microsoft.VisualStudio.ExtensionManager.ExtensionImpl.ReadManifest(Stream manifestStream) at Microsoft.VisualStudio.ExtensionManager.InstallableExtensionImpl.ReadVSIXManifestFromPackage(Stream stream, CultureInfo preferredCulture) at Microsoft.VisualStudio.ExtensionManager.InstallableExtensionImpl..ctor(String path, CultureInfo preferredCulture) at Microsoft.VisualStudio.ExtensionManager.ExtensionEngineImpl.CreateInstallableExtension(String extensionPath, CultureInfo preferredCulture) at Microsoft.VisualStudio.ExtensionManager.ExtensionEngineImpl.CreateInstallableExtension(String extensionPath) at VSIXInstaller.App.GetInstallableData(String vsixPath, Boolean isRepairSupported, IEnumerable`1& skuData) at VSIXInstaller.App.Initialize(Boolean isRepairSupported) at VSIXInstaller.App.Initialize() at System.Threading.Tasks.Task`1.InnerInvoke() at System.Threading.Tasks.Task.Execute()
I may be doing this wrong, first time I've installed something outside of the store... 🙂
Ah, yes, they have the same extension probably. Install it from within VS Code's extensions panel. There's a metballs-menu at the top with the option to install VSIX packages.
it seems to mostly work? there seem to be some toplevel forms that it sticks the silly indent on newline after when it should be at column 0
Cool. Let me know how it fares. I do think this branch has come a tad out of sync with the main one so might be some new things that are missing.
My code is a bit too complicated. I think it will be easier to fix if I can manage to simplify it some.
hmm, yeah definitely getting some funky indents at the end of anything but very simple forms..
I've been in emacs mostly for the past week or so, so perhaps i don't have the latest updates, let me check
so e.g. if I write
(defn foo  (cond (= x 5) (println "Hello") (= y 6) (println "hi")))
again this is under wind0wz so there may be some fun here, are you running linux or macos?
but that fixes itself as I add new lines, presumably because you call cljfmt and it fixes up the previous bits
The particular bug here is that it indents
because yeah, it would make sense to dedent that )) if cljfmt was looking at a complete text file
It's a bug. I think this PR might have introduced it: https://github.com/weavejester/cljfmt/pull/156
It really should indent those trailing parens the same as if there was a symbol on the line before them.
does clojureVSCode use cljfmt incrementally, or does it just expose it as a 'reformat file' feature?
I only invoke cljfmt directly in one place. But indirectly at a few more places, of course.
yeah I need to spend a bit of time learning about where vscode event hooks take place
just looked in his codebase- it's just a "reformat file" and "reformat on save" feature
The -calva-lib version has a bit of a special dev setup. Where the calva-lib library is it's own project, cljs-only.
It builds an npm module that extension code (TypeScript) requires from the npmjs repository.
There I can have the repl attached to the running extension. Which is good. With the new dev setup I lose that. I do have a repl, but can't attach it to the running extension.
But with the current dev setup it is hard to share the code, or at least I didn't find a good way to do it.
That has less to do with vscode than that I don't want to force Calva on people who need a formatter or paredit.
Another thing with the current dev process is that it makes the API to the library a bit funny and also a bit hard to maintain.
hmm. yeah okay. I wonder if there is a way to build a monolithic calva extension, but also publish paredit and cljfmt separately from the same codebase.
That is partly what I try to do today, but if I understand your idea correctly it would be more like one vscode-extension project where the extensions can share code much more directly.
but then two other projects including just what they need and some extension specific other stuff
I think I must try it. Even though it has taken me two weeks to get this calva-lib thing done…
i need to actually take shadow-cljs out for a spin, and work with vscode extensions for a week
I've only recently returned to clojure so I am all oldschool leiningen and emacs for the most part...
There is still that thing with the library API getting a bit strange, that would increase with this setup. But having the repl attached to the running extension is a really good thing.
I doubt everyone at MIT and BBN etc would have put up with gc's that took 10 minutes without one...
but okay, I will try to get a dumb typescript plugin running connected to the repl over the next week or so...
Me neither. My reason for using both is that I like to be able to use the debugger at the integration level with VS Code. It also helps my thinking to keep the object oriented stuff in TS so that I can use data structures an functions more purely in the CLJS end of things.
btw- for keyword highlighting out of the box, couldn't you override the default configurations with https://code.visualstudio.com/docs/extensionAPI/extension-points#_contributesconfigurationdefaults?
I think I can provide a new grammar. But I have found no way of contributing the keyword highlighting. Would be happy if that was just me.
I have a PR rotting against the Atom Clojure grammar, because that is what VS Code uses and they track the Atom repo for it.
Here's the issue you found for me, @mseddon: https://github.com/weavejester/cljfmt/issues/159
thanks! I just installed your extension in vscode, as the previous extension was no longer working (was dabbling at a project that I last touched a year ago)
and now I'm yak shaving to figure out why my
lein repl command line is throwing an assertion 😉
which, I'm not sure based off your doc comment, was that what you forked originally?
it used to work well but the author isn't doing Clojure anymore and well you know how that goes
okay I've got repl going. Does Calva yet support the Debug interface in vscode? if so, is there a launch.json config I should use?
looking closely at the Calva readme it seems it doesn't support Debug yet. It's probably a huge lift, but that is something I'd find to be awesome in the future (but for now nREPL will work just fine, and thanks again for the extension)