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

formatOnType removes the space between string and brace on the last line of multiline f-string #2323

Closed
MisLink opened this issue Aug 3, 2018 · 3 comments
Assignees
Labels
area-formatting bug Issue identified by VS Code Team member as probable bug

Comments

@MisLink
Copy link

MisLink commented Aug 3, 2018

Environment data

  • VS Code version: 1.25.1
  • Extension version (available under the Extensions sidebar): 2018.7.1
  • OS and version: macOS 10.13.6
  • Python version (& distribution if applicable, e.g. Anaconda): CPython 3.6.6
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): virtualenv
  • Relevant/affected Python packages and their versions: N/A

Actual behavior

f"""
select * from {table}
where {condition}
order by {order_columns}
limit {limit_num};"""  # enter

then:

f"""
select * from {table}
where {condition}
order by {order_columns}
limit{limit_num}; """  # remove the space bwtween limit and {, and add a space at the end.

Expected behavior

Keep it as it is

Steps to reproduce:

  1. paste the code and have a try.

Logs

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

N/A

Output from Console under the Developer Tools panel (toggle Developer Tools on under Help)

N/A
@MisLink MisLink changed the title formatOnType will removes the space between string and brace on the last line of multiline f-string formatOnType removes the space between string and brace on the last line of multiline f-string Aug 3, 2018
@DonJayamanne DonJayamanne added bug Issue identified by VS Code Team member as probable bug needs verification area-formatting labels Aug 3, 2018
@ericsnowcurrently ericsnowcurrently self-assigned this Aug 6, 2018
@ericsnowcurrently
Copy link
Member

Hi @MisLink. Thanks for letting us know about this. We'll work on fixing it.

I was able to reproduce this on Ubuntu with Python 3.7 (under both Jedi and the new language server).

@ericsnowcurrently ericsnowcurrently removed their assignment Aug 6, 2018
@MikhailArkhipov MikhailArkhipov self-assigned this Aug 6, 2018
@MikhailArkhipov MikhailArkhipov added this to the Aug 2018 milestone Aug 6, 2018
@DonJayamanne
Copy link

I was able to reproduce this on Ubuntu with Python 3.7 (under both Jedi and the new language server).

@ericsnowcurrently this is done within the typescript code in the extension, not part of the language server.

@MikhailArkhipov
Copy link

@lock lock bot locked as resolved and limited conversation to collaborators Oct 15, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-formatting bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants