euclidity / vscode-cucumber

Code snippets to write scenarios faster + Syntax highlight for .feature files
https://marketplace.visualstudio.com/items?itemName=stevejpurves.cucumber
MIT License
25 stars 13 forks source link

Indent style with snippets #2

Closed timbru31 closed 8 years ago

timbru31 commented 8 years ago

Hi there,

great extension, the scenario generation with snippets saves a lot of time. :smile: However we have (via EditorConfig) defined that feature files should be indented with a tab, your snippets.json is "hardcoded" to \r\n. which means that the newline is indented with spaces instead of a tab. Is there any way to respect the indention policy in vscode or is this a limitiation (and therefore not fixable)?

I'm not sure if the tab stop option could work, as documented here: https://code.visualstudio.com/Docs/customization/userdefinedsnippets

Cheers, Tim

stevejpurves commented 8 years ago

Hi @timbru31, Thanks! I think it's the hard coded spaces after the \r\n causing the problem. I have found no way follow editor settings, tab stops don't have the desired behaviour. I could define two sets of snippets, one space led one tab led, it would work but seems a bit of a fail. going to ping the vscode repo before doing that.

but this is an old issue too, did you solve it some other way?

stevejpurves commented 8 years ago

right. we are now indenting with tabs, reasoning being that a combo of vscode settings editor.detectIndentation and editor.insertSpaces control how the tabs are handled, so it seems that just using \t will mean the snippet honours the user or editorconfig settings. Although this seems to currently have issues https://github.com/Microsoft/vscode/issues/5355 it's going to be fixed. should be good for your use now @timbru31

stevejpurves commented 8 years ago

published in 0.9.4