PTVS icon indicating copy to clipboard operation
PTVS copied to clipboard

Python code coloring loses track of in/out of strings

Open vsfeedback opened this issue 2 years ago • 1 comments

This issue has been moved from a ticket on Developer Community.


The Python code below, simplified from _GetTextInside in https://source.chromium.org/chromium/chromium/tools/depot_tools/+/main:cpplint.py;l=59?q=cpplint.py&sq=, causes problems for the Python syntax coloring. The syntax coloring thinks that the for loop at the bottom is inside the string.

def _GetTextInside():
  r"""
  [
  """

  for i in range(10):
    print(i)

Once the analysis gets into this state things remain broken for the rest of the file. The incorrect coloring makes it much harder to read the file and to see syntax errors.


Original Comments

Feedback Bot on 5/15/2022, 07:34 PM:

(private comment, text removed)


Original Solutions

(no solutions)

vsfeedback avatar May 23 '22 20:05 vsfeedback

looks related out the VS version of textmate being out of date, similar to https://github.com/microsoft/PTVS/issues/6653

bschnurr avatar May 23 '22 20:05 bschnurr

dup of #6782

StellaHuang95 avatar Sep 19 '22 18:09 StellaHuang95