Closed gfx closed 4 years ago
@gfx wanted to link the original VSCode changes
Don't know if you can call one of those getEol
methods and/or import OS
and do the check yourself
Now seeing that #72 looks to be a duplicate of this, although a slightly different implementation.
From https://github.com/AlanWalk/markdown-toc/pull/72#pullrequestreview-189579058
Seems that the VSCode snippet builder builds snippets the same way via an array and then joins them together. It seems they are only using
'\n'
for all cases. Maybe the secret is to just do\n
and post processing will handle the rest.VSCode's snippet building: https://github.com/Microsoft/vscode/blob/82863aac3b43b9559057295afcf5f99edd9f5f22/src/vs/workbench/parts/snippets/electron-browser/snippetsFile.ts#L227
VSCode's snippet implementation example: https://code.visualstudio.com/docs/editor/userdefinedsnippets#_global-snippets
I dug around in the VSCode Extension API and couldn't really find anything about determining the OS EOL's value.
Looks like we should be able to use require('os').EOL
though.
Should this be closed then to let #72 go through?
Closed in favor of https://github.com/AlanWalk/markdown-toc/pull/80
Fix https://github.com/AlanWalk/markdown-toc/issues/65
workaround before this PR
Set
files.eol
to"\n"
or"\r\n"
in vscode settings.auto
is a new feture introduced in v1.29.0