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

Syntax highlighting freezing after typing #5082

Closed
Reprevise opened this issue Apr 24, 2024 · 3 comments
Closed

Syntax highlighting freezing after typing #5082

Reprevise opened this issue Apr 24, 2024 · 3 comments
Labels
upstream in vs code / lsp / dap Needs changing in VS Code, LSP or DAP protocols/libraries

Comments

@Reprevise
Copy link

Describe the bug
I work in a pretty large Flutter project and pretty often just after typing the syntax highlighting "freezes" and then parts of words get highlighted, etc (you can see in the screenshot below). Only parts after I typed are affected. I suspect this is an issue just because of the sheer size of the project. It does fix when I go to a different file then go back though.

To Reproduce
Steps to reproduce the behavior:

Can't reproduce it yet

Expected behavior
I expect the syntax highlighting to finish updating after I finish typing.

Screenshots
If applicable, add screenshots to help explain your problem.

VSCode

Workspace Environment
Dart Code extension: 3.86.0
Flutter extension: 3.86.0 (activated)

App: Visual Studio Code
App Host: desktop
Version: win 1.88.1

Workspace type: Dart, Flutter (LSP)

Dart (3.3.4): C:\Users\bscho\.puro\shared\caches\c4cd48e186460b32d44585ce3c103271ab676355\dart-sdk
Flutter (3.19.6): C:\Users\bscho\.puro\envs\trn\flutter (SM S928U (android-arm64/android))

Output from 'dart info'

C:\Users\bscho\.puro\shared\caches\c4cd48e186460b32d44585ce3c103271ab676355\dart-sdk\bin\dart.exe info

General info

  • Dart 3.3.4 (stable) (Tue Apr 16 19:56:12 2024 +0000) on "windows_x64"
  • on windows / "Windows 10 Home" 10.0 (Build 22631)
  • locale is en-US

Process info

Memory CPU Elapsed time Command line
2886 MB -- dart.exe
57 MB -- dart.exe
41 MB -- dart.exe
1728 MB -- dart.exe
103 MB -- dart.exe
Output from 'flutter doctor'

C:\Users\bscho\.puro\envs\trn\flutter\bin\flutter.bat doctor -v

[!] Flutter (Channel stable, 3.19.6, on Microsoft Windows [Version 10.0.22631.3447], locale en-US)
    • Flutter version 3.19.6 on channel stable at C:\Users\bscho\.puro\envs\trn\flutter
    ! Warning: `flutter` on your path resolves to C:\Users\bscho\.puro\envs\stable\flutter\bin\flutter, which is not inside your current Flutter SDK checkout at C:\Users\bscho\.puro\envs\trn\flutter. Consider adding C:\Users\bscho\.puro\envs\trn\flutter\bin to the front of your path.
    ! Warning: `dart` on your path resolves to C:\Users\bscho\.puro\envs\stable\flutter\bin\dart, which is not inside your current Flutter SDK checkout at C:\Users\bscho\.puro\envs\trn\flutter. Consider adding C:\Users\bscho\.puro\envs\trn\flutter\bin to the front of your path.
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 54e66469a9 (7 days ago), 2024-04-17 13:08:03 -0700
    • Engine revision c4cd48e186
    • Dart version 3.3.4
    • DevTools version 2.31.1
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at C:\Users\bscho\AppData\Local\Android\sdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-10027231)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • CHROME_EXECUTABLE = C:\Program Files\BraveSoftware\Brave-Browser\Application\brave.exe

[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.8.3)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.8.34330.188
    • Windows 10 SDK version 10.0.22621.0

[√] Android Studio (version 2023.2)
    • Android Studio at C:\Program Files\Android\Android Studio1
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.9+0--11185874)

[√] Android Studio (version 2022.3)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • android-studio-dir = C:\Program Files\Android\Android Studio
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-10027231)

[√] VS Code (version 1.88.1)
    • VS Code at C:\Users\bscho\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.86.0

[√] Connected device (4 available)
    • SM S928U (mobile) • R5CX15H871T • android-arm64  • Android 14 (API 34)
    • Windows (desktop) • windows     • windows-x64    • Microsoft Windows [Version 10.0.22631.3447]
    • Chrome (web)      • chrome      • web-javascript • unknown
    • Edge (web)        • edge        • web-javascript • Microsoft Edge 124.0.2478.51

[√] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.
@DanTup
Copy link
Member

DanTup commented Apr 25, 2024

I've seen this before, and then never been able to reproduce. My feeling is that either the server or VS Code are processing the request out of order with a modification, so the offsets are not applied correctly. What's odd is that some of the text seems too correct (for example Radius.circular above) for the entire request to be wrong.

How frequently do you see this? Do you have any feeling for what might contribute to it (like is it when the analysis server may be busy during initial analysis, or when you're typing quickly, or pasting large code chunks?). If I can repro it while capturing a log, it might be easier to narrow down.

@DanTup DanTup added this to the v3.90.0 milestone Apr 25, 2024
@DanTup DanTup added the in editor Relates to code editing or language features label Apr 25, 2024
@Reprevise
Copy link
Author

How frequently do you see this? Do you have any feeling for what might contribute to it (like is it when the analysis server may be busy during initial analysis, or when you're typing quickly, or pasting large code chunks?).

Multiple times per day. It happens beyond the initial analysis (if you mean like when VSCode starts up). I would say both, typing quickly and when pasting code in.

@DanTup
Copy link
Member

DanTup commented Apr 25, 2024

By coincidence, I just saw this in the analysis server codebase. It looks to me like a VS Code bug, because if I open the "Inspect Tokens and Scopes" helper (a VS Code feature), it claims the text is the same colour in both positions of a multicolour word.

I've opened microsoft/vscode#211369 with some screenshots.

Will close this for now on the basis that it appears the bug is there, but we can re-open if the response indicates there might be something wrong here.

@DanTup DanTup closed this as completed Apr 25, 2024
@DanTup DanTup removed this from the v3.90.0 milestone Apr 25, 2024
@DanTup DanTup added upstream in vs code / lsp / dap Needs changing in VS Code, LSP or DAP protocols/libraries and removed is bug in editor Relates to code editing or language features labels Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream in vs code / lsp / dap Needs changing in VS Code, LSP or DAP protocols/libraries
Projects
None yet
Development

No branches or pull requests

2 participants