Adding single quote before foo@bar adds extra single quote
See original GitHub issueEnvironment data
- VS Code version: 1.27.2
- Extension version (available under the Extensions sidebar): 2018.8.0
- OS and version: Debian GNU/Linux (buster)
- Python version (& distribution if applicable, e.g. Anaconda): 2.7
- Type of virtual environment used (N/A | venv | virtualenv | conda | …): N/A
- Relevant/affected Python packages and their versions:
Actual behavior
foo = [
{
'username': 'john',
'blocked': True,
'extra_emails': [
foo@bar
]
}
]
When adding a single quote before foo@bar
above, two single quote characters are inserted.
foo = [
{
'username': 'john',
'blocked': True,
'extra_emails': [
''foo@bar # <-- We got an extra single quote here
]
}
]
Interesting enough, if I change foo@bar
to just foo
and then press the quote character, the problem goes away - only a single quote gets inserted. So it seems to be specifically with email addresses/strings containing an @ character.
Expected behavior
A single quote character should be inserted.
Logs
Output for Python
in the Output
panel (View
→Output
, change the drop-down the upper-right of the Output
panel to Python
)
Starting Jedi Python language engine.
##########Linting Output - pylint##########
************* Module foo
6,0,error,E0001:invalid syntax (<string>, line 6)
Output from Console
under the Developer Tools
panel (toggle Developer Tools on under Help
)
/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:1411 INFO no standard startup: not just one window
/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:3260 [PeterJausovec.vscode-docker]: Command `vscode-docker.delete-ACR-Image` appears multiple times in the `commands` section.
/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:4236 Overwriting grammar scope name to file mapping for scope source.yaml.
Old grammar file: file:///usr/share/code/resources/app/extensions/yaml/syntaxes/yaml.tmLanguage.json.
New grammar file: file:///home/per/.vscode/extensions/redhat.vscode-yaml-0.0.16/syntaxes/yaml.tmLanguage.json
e.register @ /usr/share/code/resources/app/out/vs/workbench/workbench.main.js:4236
/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:276 [Extension Host] vscode-icons is active!
/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:276 [Extension Host] Git extension API method 'getGitPath' is deprecated.
t.log @ /usr/share/code/resources/app/out/vs/workbench/workbench.main.js:276
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Bash inserting extra, incorrect single quotes ... - Stack Overflow
It's usually a mistake to hardcode literal quotes, unless you plan to eval the command -- and that's almost always a mistake. –...
Read more >Why does bash add single quotes to unquoted failed ...
When instructed to echo commands as they are executed ("execution trace"), both bash and ksh add single quotes around any word with one...
Read more >How to add single quote in an expression
To get single quotes to appear you'll have to use four quote marks in a row (i.e. ''''). Additionally, you'll need to concatenate...
Read more >Wrong parsing of env variables in single quotes #35 - GitHub
When I try to use this with dj-database-url it is failing to parse the DATABASE_URL environment variable as it is. It seems using...
Read more >Bug with quotes in quotes and scripts (#1742) · Issues - GitLab
Single quotations are wrongly added and cmake fails! 1.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@perlun I would try the “Auto Closing Quotes” setting.
@DonJayamanne Good find - indeed, I am also. Please re-create this in the appropriate vscode repository and feel free to close the vscode-python issue (=this).