-
Notifications
You must be signed in to change notification settings - Fork 52
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
Support multi line strings #26
Comments
I read this issue json5/json5#190 json5 is not the best solution to solve my issue. ( because json5 line break does not include the meaning of '\n'. I want to copy code & paste it directly into config file). // we need '\n\' end of every line ...
{
prefix: "foo",
body: "\
int main() {\n\
return 0;\n\
}"
} However, jsonc seems better to integrate with json5. Do you have any plans to integrate jsonc into json5 in the future? If there is, my proposal was not in line with the integration process and may be inappropriate. |
Hi @KoyamaSohei, thanks for the suggestion, but I would like to keep JSONC just as JSON with comments. That's what's in use for many existing the VSCode configuration files but e.g. also in Sublime, for eslint.json, tsconfig.json which to this with other parser libraries. Adding multi-line strings would introduce another flavor of JSON and make things more complex. If the snippet declarations syntax is too limiting, I'd suggest filing an issue against snippets in VSCode to also support JSON5 or YAML or any of ther already existing formats. |
We have no plans to integrate jsonc into json5 . |
related issue:
microsoft/vscode#15140
My proposal
Support multi line strings with python-like syntax
End of lines are automatically included in the string, but it’s possible to prevent this by adding a
\
at the end of the line.Motivation
When we create a snippet with multi line, we have 2 choices.
"body"
every line. (it's bothersome)\n
(the longer the code, the harder it is to read)There is no problem if the number of lines is small or if there are few opportunities to create snippets,
but there is room for improvement in terms of labor and readability for snippets heavy use.
I hope this proposal is taken into account. Thanks!
The text was updated successfully, but these errors were encountered: