You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Turns out that Ruby has support through their language configuration file. It seems if you define a symbol for both indent and dedent (e.g. elsif or else) it will dedent the line but then begin indenting the next line. Not sure if this will work with how we currently do it:
If it won't work there then we should probably look at modernizing our configuration and switch over to the similar configuration file (the extension predates it).
Activity
karrtikr commentedon Jun 26, 2019
Prescribed solution
ericsnowcurrently commentedon Jun 26, 2019
This may not be possible currently. VSCode has the following API that we use in extension.ts:
https://code.visualstudio.com/api/references/vscode-api#LanguageConfiguration
We currently use
onEnterRules, butindentationRulesis another option. However, neither lets you indent the current line.ericsnowcurrently commentedon Jun 26, 2019
upstream: microsoft/vscode#66235
brettcannon commentedon Jul 2, 2019
Turns out that Ruby has support through their language configuration file. It seems if you define a symbol for both indent and dedent (e.g.
elsiforelse) it will dedent the line but then begin indenting the next line. Not sure if this will work with how we currently do it:vscode-python/src/client/extension.ts
Lines 179 to 198 in 796169c
If it won't work there then we should probably look at modernizing our configuration and switch over to the similar configuration file (the extension predates it).
4 remaining items
brettcannon commentedon Jul 12, 2019
We should open a bug against the VS Code docs to document the
elsetrick so no one else has to try and discover that as well.ericsnowcurrently commentedon Jul 15, 2019
Looks good:
brettcannon commentedon Dec 13, 2022
https://devblogs.microsoft.com/python/python-in-visual-studio-code-december-2022-release/#auto-indentation-with-pylance 🎉