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

provideDocumentSemanticTokens is called on all modified documents after a find/replace leading to the OS freezing #178461

Closed
sean-mcmanus opened this issue Mar 28, 2023 · 0 comments · Fixed by #179396
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug insiders-released Patch has been released in VS Code Insiders semantic-tokens Semantic tokens issues verified Verification succeeded
Milestone

Comments

@sean-mcmanus
Copy link
Contributor

sean-mcmanus commented Mar 28, 2023

Does this issue occur when all extensions are disabled?: Yes (but the repro requires an extension that implements semantic tokens)

  • VS Code Version: Version: 1.76.2 (user setup)
    Commit: ee2b180
    Date: 2023-03-14T17:55:54.936Z
    Electron: 19.1.11
    Chromium: 102.0.5005.196
    Node.js: 16.14.2
    V8: 10.2.154.26-electron.0
    OS: Windows_NT x64 10.0.22621
    Sandboxed: No
    and
    Version: 1.77.0-insider (user setup)
    Commit: b9226e1
    Date: 2023-03-24T18:57:27.096Z
    Electron: 19.1.11
    Chromium: 102.0.5005.196
    Node.js: 16.14.2
    V8: 10.2.154.26-electron.0
    OS: Windows_NT x64 10.0.22621
    Sandboxed: Yes
  • OS Version: Windows 11

Steps to Reproduce:

  1. Do a find/replace on unopened file targets with an extension installed that provides semantic document tokens for those target files.

Bug: In addition to the didOpen, which is fine, VS Code is also invoking provideDocumentSemanticToken for the documents, which doesn't seem to make sense since the documents are not visible, which for the C/C++ extension can lead to the OS to freeze (we have a fix for that, see microsoft/vscode-cpptools#10743), but it seems like VS Code shouldn't be invoking provideDocumentSemanticToken in the first place. Our extension implements vscode.DocumentSemanticTokensProvider.

UPDATE: Also, looks like I had

    "files.autoSaveDelay": 1000,
    "files.autoSave": "afterDelay",

not sure if that matters.

@rebornix rebornix assigned alexdima and unassigned rebornix Mar 28, 2023
@alexdima alexdima added the semantic-tokens Semantic tokens issues label Apr 6, 2023
@alexdima alexdima added the bug Issue identified by VS Code Team member as probable bug label Apr 6, 2023
@alexdima alexdima added this to the April 2023 milestone Apr 6, 2023
alexdima added a commit that referenced this issue Apr 6, 2023
* Fixes #178461: Only fetch semantic tokens for visible documents

* Fix unit tests
@VSCodeTriageBot VSCodeTriageBot added unreleased Patch has not yet been released in VS Code Insiders insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels Apr 6, 2023
@jrieken jrieken added the verified Verification succeeded label Apr 27, 2023
@github-actions github-actions bot locked and limited conversation to collaborators May 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug insiders-released Patch has been released in VS Code Insiders semantic-tokens Semantic tokens issues verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants