-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Formatter indents on ternary operator #18
Comments
I would actually like to have a look into this myself but I have NO idea where to start as I'm not into TS or Electron at all. But that can change :) I guess everything is already build-in to VS Code? To debug TS? Where would I start setting breakpoints? Can I debug the running VS Code while coding it ... ?!?! 🤔 |
to help understand: since strings are removed, it becomes my git is kinda messed up right now... I'm learning how to use, now I have time |
hmm. But var := x>y ? 2 : 3
something("skdfjbv") remains unchainged! After all: I think we need some tests for the formatter at best on various bigger libraries and. |
3 is not a string |
@ewerybody
|
Ah ok. I didn't get what you mean with "strings removed". Thought you mean quotes removed or something. ;Formatting ignores any string after the colon
;making the ternary operator act like a hotkey.
var := x>y ? 1 : 2 ;<< Integer after tthe : is ok
;identation no
var := x>y ? 1 : ;
;identation no
var := x>y ? 1 : "2" ;
;identation no
HotKey:;
;identation no
Return |
Because the ternary operator is only affected if it finishes with a string or nothing at all.
|
noted
ty for finding this, this isn't supposed to happen, since one this is in function but I suspect that changing ONLY this regex won't fix the problem of matching comments properly... I will try to fix these, after... |
Repro
The exact expression from the docs
var := x>y ? 2 : 3
does work properly tho!It's just when there is a quoted string after the
:
Expected behavior
The code should not change.
Environment
VS Code 1.53.0.0
AutoHotkey Plus Plus v2.5.12
The text was updated successfully, but these errors were encountered: