vscode-dotenv icon indicating copy to clipboard operation
vscode-dotenv copied to clipboard

Don't show end-of-line comments as comments

Open pinksynth opened this issue 3 years ago • 2 comments
trafficstars

Hello! Thanks for the awesome extension.

Per the attached issue (see below), dotenv does not support end-of-line comments, but this extension shows the comments as if they are not part of the value.

So the code looks like this: image

This visually suggests that the value provided to the code is 5000, but the value is actually 3000 # 3 seconds.

Not sure how hard this would be to resolve—if it's not too complex I'd be happy to help by opening a PR.

Thanks!

pinksynth avatar Feb 01 '22 17:02 pinksynth

Got bitten very hard by this, cross-posting issue on a similar package: https://github.com/IronGeek/vscode-env/issues/12

eric-burel avatar Nov 19 '22 09:11 eric-burel

After further investigation, this is probably a parser issue and not a plugin issue. "dotenv" implementations are expected to support inline comments and scrap them correctly.

@pinksynth can you maybe tell which framework/package/setup you were using for parsing the dotenv? And you might want to open an issue there

This can become very problematic when defining an empty environment variable with an explanation comment, leading people to think the value is empty while it's not.

eric-burel avatar Nov 19 '22 17:11 eric-burel