This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-06-21
Channels
- # aws (2)
- # aws-lambda (1)
- # beginners (62)
- # cider (31)
- # cljs-dev (16)
- # cljsrn (8)
- # clojure (115)
- # clojure-greece (3)
- # clojure-israel (2)
- # clojure-italy (13)
- # clojure-nl (8)
- # clojure-russia (5)
- # clojure-spec (3)
- # clojure-uk (146)
- # clojurescript (108)
- # clojutre (5)
- # code-reviews (3)
- # cursive (48)
- # datomic (22)
- # editors (20)
- # emacs (7)
- # fulcro (16)
- # graphql (10)
- # mount (2)
- # off-topic (47)
- # onyx (22)
- # re-frame (100)
- # reagent (5)
- # reitit (7)
- # ring-swagger (6)
- # rum (5)
- # shadow-cljs (51)
- # specter (2)
- # tools-deps (95)
- # vim (10)
- # yada (7)
Is there a way to make Cursive not fully open a file when you are just browsing files?
In VS Code, Atom, and Sublime (probably others too), clicking on a file doesn't fully open it, it opens it in a tab but with an italicised filename
If you edit the file then the file is 'fully opened'
But if you click on a different file, then that file is closed and replaced with the new file
It means that if you're scanning through a bunch of files, you don't end up with tons of editor tabs
@danielcompton Not that I know of, no
Do you just hide the tab bar?
What does Cmd-D do?
IntelliJ can do multi-select with the mouse?
Or is that different
Option + Click/drag
if you do Cmd-F in intellij and then click on “Select All Occurences” that’s basically what it does, except that it is iterative. each time you hit Cmd-D in atom/sublime/vscode it selects one more instance
hitting it once selects the word under the current cursor. and it’s purely text based, so it can help you fix strings and whatnot.
IntelliJ has "Edit->Find->Add Selection for Next Occurrence" (which I have mapped to ^G), works the same as Cmd-D in Sublime.
@cfleming slightly off-topic question: i somehow stumbled upon your talk about using parsers in macros and then i watched two other talks about the same topic instead of working. but now i’m curious: did this work go anywhere? i was looking around for libraries but couldn’t find any. it seems like such a great idea.
@lee.justin.m Yeah, Cursive uses it internally
I never got around to exposing the error marking in the editor, since it seemed after my talk like there might have been a solution coming in core. But I’m now planning once more to do that.
I actually re-implemented the parser recently, it’s way faster and has some other nice features like the ability to mark multiple errors in a single form.
I remember reading in one of the complain-o-ramas somewhere something like “all we wanted were better error messages in macros and instead we got spec”
cool. well I certainly wouldn’t expect you to necessarily be releasing something that is important for your livelihood, but I thought I would ask to see where all that went.
I did open source part of it, but it wasn’t very useful since it was in an experimental stage, and I now consider that approach a failed experiment: https://github.com/cursive-ide/error-test
My new parser uses regexps rather than PEGs, so the semantics match spec’s better. But I don’t use the derivative parsing technique that spec does, I use a VM approach similar to https://github.com/cgrand/seqexp
I based it on this article here: https://swtch.com/~rsc/regexp/regexp2.html
that’s very interesting. i would have thought the PEG approach would have been much more robust
Interestingly, it’s way faster than spec, 7-14x in the tests I did: https://gist.github.com/cursive-ide/d7e490bd875d575ff485518195aa1e19
And since presumably macros will be developed using spec at some point, they’re likely to match those semantics well.
The main blocker on actually integrating the new work is that I’m going to have to fix up all the extensions I have currently to make them robust to partial parses. Currently the parser either parses the whole form, or fails, so the extensions can rely on all the data being there when they get called. With partial parses that’s not true, so it will be an NPE city until I fix them up using generative testing.
But once that works, it will allow things like context-specific completions even when the form has errors, which will be awesome.
@cfleming It's really handy in Cursive how some forms (e.g (testing "...."
don't follow the normal pattern of indenting args at the same level, so the actual test itself is only indented 2 chars instead of in line with the description string. Is that extensible in any way?
We've written a (with-mocks [......] (do stuff
macro and at the moment Cursive auto-indents it as
(with-mocks [...
...]
(do stuff))
whereas we'd prefer it to be treated like defn
or whatever and be
(with-mocks [...
...]
(do stuff))
@carr0t Check out the doc here: https://cursive-ide.com/userguide/formatting.html#customisation. You can achieve the effect you want by configuring the indentation setting to 1.
It’s not explained in the doc (I need to do that) but 1 is the number of forms which are considered special and aligned (usually parameters) before the body forms start, which are just indented two spaces
In your case, the vector is the parameter, and the (do stuff)
part is where the body starts.
It’s also not shown in the doc since it went in fairly recently, but if you want to share that customisation with all your team members, you can go to Settings->Editor->Code Style->Clojure, and set the Scheme to “Project”. That will mean that your indentation customisations will be stored in the project files and can be checked in and shared.