-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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
CMD+D in JSON #10080
Comments
Each language can define what a 'word' is. For JSON it is the full string literal, which needs to be like that for other areas like code completion. I'm not sure what's the design of Ctrl+D is. @alexandrudima Should it be the equivalent of doubleclick and use the configured wordSeparators? |
Whaaat?
|
I think the bug got introduced by this commit: 17e0d1c |
Just for comparison - both Atom and Sublime selects single word (eg. |
@alexandrudima Not a bug, done intentionally. Other languages add @, !, : #, - _ to the word, which shows that what we call the 'word' regex is actually rather a 'token' regex. Why does Ctrl+D not use the wordSeparators as defined in editor.wordSeparator? It would be consistent to what double-click selects. |
Closing as works as designed. Alex feel free to reopen if you think Ctrl +D should use use the wordSeparators. |
@alexandrudima Please reconsider fixing it, arguments for it:
Thanks for reconsidering |
@aeschli Here I am using VSCode version 0.10.8. Please notice how The bug was introduced when JSON changed its word definition regex in such a way that it now incorrectly identifier strings in quotes such as Here is JSON's definition of a word definition in 0.10.8: Here is JSON's definition of a word definition today: I will not change the behaviour of Ctrl-D because one language contains an incorrect word definition regular expression. I can, however hard code a good word definition in the editor core for json. |
I am adding the label important because this is a regression. @aeschli If you wish I can try finding the exact commit which introduced this regression. |
@alexandrudima The change was made intentionally, please read my comment above. It fixed various issues with code assist which I feel are equally important as Ctrl+D. |
We're in a deadlock here, IMO I don't see to get both camps here happy. Closing this been very few complaints on the CTRL+D behaviour in JSON I close this. |
As it seems the default functionality won't change, is it possible to override the current behavior in my settings to be the same as JavaScript? |
Can you add that regex as a configurable setting? Any other work arounds for those of us that value proper cmd+D behavior over code completion? Is there a way to map As is, editing JSON files is very annoying when you're used to using cmd+D. UPDATE: {
"files.associations": {
"*.json": "javascript"
}
} |
Steps to Reproduce:
test.json
file with contenttest
wordtest
It works fine in
.js
file:The text was updated successfully, but these errors were encountered: