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

Wrong highlight for raw string #190519

Closed
AuroraTea opened this issue Aug 14, 2023 · 8 comments
Closed

Wrong highlight for raw string #190519

AuroraTea opened this issue Aug 14, 2023 · 8 comments
Assignees
Labels
grammar Syntax highlighting grammar upstream-issue-linked This is an upstream issue that has been reported upstream

Comments

@AuroraTea
Copy link

Type: Bug

Behaviour

Expected vs. Actual

Expected
image

Actual: The \ of a raw string is the \ and not the escape character, but the hignlight still treats them as escapes.
image

Steps to reproduce:

  1. use raw string

Diagnostic data

  • Python version (& distribution if applicable, e.g. Anaconda): 3.10.9
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Poetry
  • Value of the python.languageServer setting: Default
Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

XXX

User Settings


languageServer: "Pylance"

Extension version: 2023.15.12191008
VS Code version: Code 1.80.2 (2ccd690, 2023-07-27T20:40:28.909Z)
OS version: Windows_NT x64 10.0.19045
Modes:

System Info
Item Value
CPUs Intel(R) Core(TM) i5-10210U CPU @ 1.60GHz (8 x 2112)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
Load (avg) undefined
Memory (System) 15.76GB (1.73GB free)
Process Argv --crash-reporter-id fddc7df4-857f-48b6-a8a4-5314435f9fbe
Screen Reader no
VM 0%
A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
vswsl492cf:30256860
vslsvsres303:30308271
vserr242:30382549
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vshan820:30294714
vstes263cf:30335440
vscod805:30301674
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593cf:30376535
pythonvs932:30410667
py29gd2263cf:30792227
vsclangdc:30486549
c4g48928:30535728
dsvsc012cf:30540253
pynewext54:30695312
azure-dev_surveyone:30548225
vscccc:30803845
282f8724:30602487
f6dab269:30613381
showlangstatbar:30737416
pythonfmttext:30731395
pythoncmvfstrcf:30756944
fixshowwlkth:30771522
showindicator:30805244
pythongtdpath:30769146
i26e3531:30792625
gsofb:30804716
pythonnosmt12:30797651
pythonidxptcf:30805731
pythonnoceb:30805159
dsvsc013:30795093
dsvsc014:30804076

@karthiknadig
Copy link
Member

Unfortunately this is dependent on VS Code itself. In order to make a change it will require a change upstream. If you would like to see such a change then please open an issue at https://github.com/microsoft/vscode.

This comes from MagicPython

@karthiknadig karthiknadig transferred this issue from microsoft/vscode-python Aug 15, 2023
@karthiknadig karthiknadig removed their assignment Aug 15, 2023
@vscodenpa
Copy link

Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.81.1. Please try upgrading to the latest version and checking whether this issue remains.

Happy Coding!

@AuroraTea
Copy link
Author

Unfortunately this is dependent on VS Code itself. In order to make a change it will require a change upstream. If you would like to see such a change then please open an issue at https://github.com/microsoft/vscode.

OK, Thanks

@AuroraTea
Copy link
Author

AuroraTea commented Aug 16, 2023

Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.81.1. Please try upgrading to the latest version and checking whether this issue remains.

Now is 1.81.1, but yet

@alexr00
Copy link
Member

alexr00 commented Aug 16, 2023

I've opened MagicStack/MagicPython#259 on the upstream repo for this.

@alexr00 alexr00 closed this as completed Aug 16, 2023
@alexr00 alexr00 added grammar Syntax highlighting grammar upstream-issue-linked This is an upstream issue that has been reported upstream labels Aug 16, 2023
@DG119
Copy link

DG119 commented Sep 21, 2023

I know this is closed but check this out: MagicStack/MagicPython#114 (comment)

r"" is fore RE, use R"" for raw string

@AuroraTea
Copy link
Author

I know this is closed but check this out: MagicStack/MagicPython#114 (comment)

r"" is fore RE, use R"" for raw string

Thank you, I didn't even know about this until you told me.
But this is not grammar for python and is not part of pep.
As a specially provided feature, at least it should be turned off by default ,or use R for RE.

I've noticed a lot of debate on the MagicPython side as well, and dissatisfied with status quo.

@DG119
Copy link

DG119 commented Sep 21, 2023

I know this is closed but check this out: MagicStack/MagicPython#114 (comment)
r"" is fore RE, use R"" for raw string

Thank you, I didn't even know about this until you told me. But this is not grammar for python and is not part of pep. As a specially provided feature, at least it should be turned off by default ,or use R for RE.

I've noticed a lot of debate on the MagicPython side as well, and dissatisfied with status quo.

Here's the reason. MagicStack/MagicPython#114 (comment)
Yeah pretty annoying to me as well, and most of the themes follow this rule.

@github-actions github-actions bot locked and limited conversation to collaborators Sep 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
grammar Syntax highlighting grammar upstream-issue-linked This is an upstream issue that has been reported upstream
Projects
None yet
Development

No branches or pull requests

5 participants