Open SonGokussj4 opened 5 years ago
I'm not the expert, but I believe that is status-by-design - it's closed the "
pair for you. It doesn't know that you want to make this.dc.TableName
part of the string literal that you're creating by enclosing it in quotes.
My take on your Expected behavior is that you want SCP to be disabled if the line starts with Debug.Print
.
I'm retagging this as enhancement because the resulting behaviour is the current designed status. The suggestion to change the autocompletion behaviour could have some merit, but I wouldn't classify this as a bug...
@daFreeMan is correct; SCP is doing its job and auto-closes ""
the double-quotes for you, not knowing the intent is to later go to the end of the expression and "
close the string.
Debug.Print "" something
The above would be illegal; the semicolon is inserted by the VBE to make the expression legal:
Debug.Print ""; something
There's a //todo
comment somewhere in the SCP code, to make it "wrap" the selection, so you would have this:
Debug.Print [something here]
Where [something here]
is the selection; hitting "
would "wrap" the something here
content with double quotes, resulting in:
Debug.Print "something here"|
Other than that, I'm not very keen on disabling SCP handling based on arbitrary criterion (e.g. disable when left-of-caret content says Debug.Print
) - that seems a good way to spaghettify the feature and make it work in unexpected ways.
Okay. I understand you all. The //todo would definitely resolve this thing. Will wait for the future. :-) Is there any way to, as @daFreeMan mentioned, disable SCP for debug.print line? Or to disable "some types of autocomplete"? If I'm not mistaken (maybe I am :-)), in the past, there were more options in Autocomplete Settings.
Description With MsgBox, it behaves like #4900 With Debug.Print it's different
To Reproduce
Debug.Print |this.dc.TableName
"
Expected behavior
Debug.Print "|this.dc.TableName
Resulting behavior
Debug.Print "|"; this.dc.TableName