Skip to content
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

Add regex to dedent else and friends #6497

Merged
merged 23 commits into from
Jul 12, 2019

Conversation

kimadeline
Copy link

For #6333

  • Dedent else (and elif while we're at it)
  • Remove unnecessary rule now that we introduced the indentationRules key
  • Pull request represents a single change (i.e. not fixing disparate/unrelated things in a single PR)
  • Title summarizes what is changing
  • Has a news entry file (remember to thank yourself!)
  • [n/a] Appropriate comments and documentation strings in the code
  • [n/a] Has sufficient logging.
  • [n/a] Has telemetry for enhancements.
  • Unit tests & system/integration tests are added/updated
  • [n/a] Test plan is updated as appropriate
  • [n/a] package-lock.json has been regenerated by running npm install (if dependencies have changed)
  • [n/a] The wiki is updated with any design decisions/details.

src/client/language/languageConfiguration.ts Outdated Show resolved Hide resolved
@brettcannon brettcannon changed the title Add regex to dedent else Add regex to dedent else and friends Jul 9, 2019
@brettcannon
Copy link
Member

brettcannon commented Jul 9, 2019

Going through Python's grammar, here is the thinking:

Dedent the following line after the statement

  • break
  • continue
  • pass
  • raise
  • return (although check if it still indents if an dangling/open [, e.g.
return [  # Does the following line still get indented (which is what we want)?

Indent the the following line after the statement

  • \
  • if
  • while
  • for
  • try
  • with
  • def
  • class
  • async def
  • async for
  • async with

Dedent the statement line itself while still indenting the following line

  • elif
  • else
  • except
  • finally

@kimadeline
Copy link
Author

Make sure #4241 and #3284 are not impacted

Copy link
Member

@ericsnowcurrently ericsnowcurrently left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly LGTM. Everything looks correct. I just have a few comments relative to helping out readers.

src/client/language/languageConfiguration.ts Outdated Show resolved Hide resolved
src/client/language/languageConfiguration.ts Outdated Show resolved Hide resolved
src/client/language/languageConfiguration.ts Outdated Show resolved Hide resolved
src/client/language/languageConfiguration.ts Outdated Show resolved Hide resolved
src/client/language/languageConfiguration.ts Outdated Show resolved Hide resolved
src/client/language/languageConfiguration.ts Outdated Show resolved Hide resolved
src/test/language/languageConfiguration.unit.test.ts Outdated Show resolved Hide resolved
src/test/language/languageConfiguration.unit.test.ts Outdated Show resolved Hide resolved
src/test/language/languageConfiguration.unit.test.ts Outdated Show resolved Hide resolved
kimadeline and others added 3 commits July 11, 2019 12:02
Co-Authored-By: Eric Snow <ericsnowcurrently@gmail.com>
Co-Authored-By: Eric Snow <ericsnowcurrently@gmail.com>
Copy link
Member

@ericsnowcurrently ericsnowcurrently left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@kimadeline kimadeline merged commit 2454423 into microsoft:master Jul 12, 2019
@kimadeline kimadeline deleted the 6333-dedent-else branch July 12, 2019 16:16
@lock lock bot locked as resolved and limited conversation to collaborators Jul 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants