Fork me on GitHub

@cfleming I can do that but the exception is not useful. It tells me the line of the the code i sent to the repl. Not the line that threw the exception.


Specifically I'm having this issue with the send <code> to REPL command.


Actually sorry I do have the information I need in that exception.


Thank you for the help


is there a (good) way to resolve these in .cljs files?


I’m going to be working on this shortly. I’m not sure yet how good I can make it, but the first thing I’m going to do is make the inspection less shouty.

👍 4

It'd be super awesome if comment forms were a tad smarter. For example, if Cursive sees this

  (require '[compute.test-components.static-data :as static-data])

  (static-data/create-dunder-mifflin c)
It could provide autocomplete for static-data/....


Good idea! That’s probably fairly easy.

👍 4

Thinking about this a little further, it’s hard to know how far to take it. Would you want def items from comments to show up in project structure, for example?

👍 4

Perhaps in project structure they should show up under a comment element there, and perhaps be rendered differently.


Ooo def’s would be super cool too!


Showing them under a comment element makes sense. I haven’t really used the project structure thing though.


I’m just worried about them being confused with proper code defs. For example, would you want them to show up in Go To Symbol…?


Maybe one comment “context” per ns?


Or if that’s too confusing, only within a single comment block.


You definitely shouldn’t be able to resolve those things outside of the comment block though.


That’s what I thought. Unfortunately that’s tricky.


I’ll think about it.


Tricky part is not resolving outside the comment?


Yeah, scoping where those symbols are visible.


Could you do it the other way as well? I've noticed that autocomplete inside comments works differently from outside i.e. not at all. I've started embracing the fiddle file idea and this discourages it a bit


@U0510KXTU Autocomplete should work inside comment blocks. However highlighting is disabled there, because often comment block fragments are invalid code, or rely on a context that doesn’t exist at the time. So if you have some invalid code the autocomplete won’t work correctly there.


Thanks. I'll watch for that.


I did just encounter an interesting scenario, however. Yesterday I had an active REPL and was writing some stuff in a comment block. Everything was working. Today I opened a fresh REPL, load the ns and get a syntax error. I had code like this:

  (require '[compute.test-components.static-data :as static-data])

  (def data-comp (component/start (static-data/new-data-component {})))

  (def client (::static-data/client data-comp))
The syntax error was talking about how ::static-data/client could not be resolved. Some more thoughts: - Allowing symbols to be resolved in within a comment block seems okay as long as they are highlighted as a warning saying "not available at runtime" or something like that. - Keywords in a comment block that use the reader shortcut should be highlighted as a error. Perhaps even having an alt+enter suggestion to create an alias in the actual namespace.