-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Dedent else:
#6333
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
Comments
Prescribed solution
|
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 |
upstream: microsoft/vscode#66235 |
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. 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). |
We should open a bug against the VS Code docs to document the |
Looks good: # dedent
if True:
break
if True:
continue
if True:
pass
if True:
raise
if True:
raise spam
if True:
return
if True:
return None
if True:
return {}
if True:
return {
# indent
spam\
eggs
# keeps indenting
if True:
...
while True:
...
for x in spam:
...
try:
...
with spam:
...
def spam():
...
def spam: # no parens
...
class spam:
...
class spam():
...
async def spam():
...
async for x in spam:
...
async with spam:
...
# dedent + indent
if True:
...
elif False: # dedented
...
else: # dedented
...
try:
...
except Exception: # dedented
...
except: # dedented
...
else: # dedented
...
for x in spam:
...
else: # dedented
...
while True:
...
else: # dedented
... |
E.g.
The text was updated successfully, but these errors were encountered: