Closed Bernardoow closed 6 years ago
Hi @sentience, can see this pr?
Hi @Bernardoow! Thanks for the PRs! ❤️ I will review them and give you some feedback this weekend.
@sentience OK !
I sent email to you in your address thatguy@kevinyank.com. Can you check this too? ;D
I believe the full snippet should me
<snippet>
<content><![CDATA[
|> Debug.log "${1:$TM_LINE_NUMBER}"
]]></content>
<description>Debug line based.</description>
<tabTrigger>debug</tabTrigger>
<scope>source.elm</scope>
</snippet>
I think the work flow would be somethink like this.
Most I create my code, test it, then see that doesn't work. Then I would like to add the debug statement?
How are your workflow?
Usually I Put debug for see some party of code without change flux, because this I create debug with line numbers for I can create many I need.
Ok, do you create new variables when you are debugging or inserting the debugger in the existing variables?
@stoivo Your suggestion for debug snippets is better. Much Better!!!
Speaking for myself, my workflow is usually to wrap the existing expression in a Debug.log
call:
Before:
fn a b =
let
c =
a + b
in
c ** 2
After:
fn a b =
let
c =
Debug.log "debug" (a + b)
in
c ** 2
Elm gives you a lot of flexibility in how you compose functions and expressions…
Debug.log "debug" expression
expression |> Debug.log "debug"
Debug.log "debug" <| expression
…so it's hard to imagine a single “most common” way that Debug.log
might be applied via a snippet. I wonder if it might be better just to make the snippet this:
Debug.log "${1:debug}"
…and you can decide how to use it in each circumstance.
@sentience Done.
I think we should make the content
Debug.log "${1:$TM_LINE_NUMBER}"
or
Debug.log "${1:debug $TM_LINE_NUMBER:}"
When you may not need to add addition comment.
Ok. In few hours I will update. I'm traveling now.
Done.
This looks good, I think we can squash and merge.
I added a new snippet for debug.