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

After editing the code, the colors in the editor are chaotic。 #60791

Closed
bobingxin opened this issue Oct 25, 2024 · 9 comments
Closed

After editing the code, the colors in the editor are chaotic。 #60791

bobingxin opened this issue Oct 25, 2024 · 9 comments
Labels
Duplicate An existing issue was already created

Comments

@bobingxin
Copy link

bobingxin commented Oct 25, 2024

  • VS Code Version: 1.94.2
  • OS Version: Darwin x64 24.0.0

Steps to Reproduce:

  1. My plugin eslint,github copilot,prettier
  2. When opening a file, everything is normal.
  3. When performing editing, introducing a new library through require, and then writing and saving the code, the colors and jump mechanism of the code will become chaotic. As shown in the following figure.
    Image
  4. Closing the file and reopening it can restore normalcy.
Copy link

感谢您创建此问题!

然而,由于您没有使用英语,我们很难进行处理。如果可能,请您将此问题描述修改为英文。请您直接编辑此问题,不要提交回复或新问题。

请注意,机器翻译服务通常无法处理用于讨论软件问题所需的技术性语言,所以我们推荐您寻找一位熟悉相关技术的人来协助翻译。

如果您无法做到,没有关系。此问题已经被标记为需要翻译,等待社区成员志愿进行翻译。


Thanks for creating this issue!

Unfortunately, as the description is not in English, it's hard for us to work on. If possible, please edit the original issue to be in English.

In our experience, automatic translation services are not able to handle the technical language needed to effectively communicate about software issues, so we recommend finding a human translator who is familiar with our technology to help.

Otherwise, we have marked this as needing translation and a community member may be able to help out.

@bobingxin bobingxin changed the title 代码编辑后,编辑器颜色混乱。color After editing the code, the colors in the editor are chaotic。 Oct 25, 2024
@amunger amunger assigned hediet and unassigned amunger Oct 25, 2024
@bobingxin
Copy link
Author

Has this bug been located? This has a relatively serious impact on my coding experience.

@bobingxin
Copy link
Author

The most recent occurrence of this situation is probably when I wrote an object instance. There will be a prompt for associated methods. After the prompt, there is a certain probability that the above color disorder will occur.

@hediet hediet assigned mjbvz and unassigned hediet Dec 9, 2024
@mjbvz
Copy link
Contributor

mjbvz commented Dec 9, 2024

Does this reproduce in the latest VS Code insiders build with all extensions disabled?

@bobingxin
Copy link
Author

I am using the latest release version and have disabled all plugins, but I still encounter this issue.

@mjbvz
Copy link
Contributor

mjbvz commented Dec 12, 2024

Thanks for testing. Can you please try collecting the TS Server log:

  1. Set "typescript.tsserver.log": "verbose",
  2. Restart VS Code and reproduce the problem
  3. In VS Code, run the TypeScript: Open TS Server log command
  4. This should open a large log file called tsserver.log

That log will help us see if typescript is accidentally messing up the syntax coloring

⚠️Warning: The TypeScript log may include information from your workspace, including file paths and source code. If you have any concerns about posting this publicly on Github, just let me know and we can arrange something else. On our side, we only use these logs to investigate issues like this

@bobingxin
Copy link
Author

tsserver.log
This is the log showing syntax color errors.
Image

@mjbvz mjbvz transferred this issue from microsoft/vscode Dec 17, 2024
@mjbvz mjbvz removed their assignment Dec 17, 2024
@RyanCavanaugh
Copy link
Member

Looks like the editor and TS Server have gotten out of sync due to an exception here

    Debug Failure. False expression.

    Error: Debug Failure. False expression.
        at acquireOrUpdateDocument (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/typescript.js:142602:15)
        at Object.updateDocumentWithKey (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/typescript.js:142553:12)
        at Object.getOrCreateSourceFileByPath [as getSourceFileByPath] (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/typescript.js:151540:37)
        at tryReuseStructureFromOldProgram (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/typescript.js:126281:59)
        at createProgram (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/typescript.js:125676:23)
        at synchronizeHostDataWorker (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/typescript.js:151478:15)
        at synchronizeHostData (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/typescript.js:151373:7)
        at Object.getProgram (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/typescript.js:151555:5)
        at InferredProject2.updateGraphWorker (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/typescript.js:186505:41)
        at InferredProject2.updateGraph (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/typescript.js:186340:32)
        at updateProjectIfDirty (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/typescript.js:188168:36)
        at InferredProject2.getLanguageService (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/typescript.js:185937:7)
        at IpcIOSession.getCompletions (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/typescript.js:194441:33)
        at completionInfo (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/typescript.js:192716:43)
        at /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/typescript.js:195218:15
        at IpcIOSession.executeWithRequestId (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/typescript.js:195207:14)
        at IpcIOSession.executeCommand (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/typescript.js:195216:29)
        at IpcIOSession.onMessage (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/typescript.js:195264:68)
        at process.<anonymous> (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/_tsserver.js:525:14)
        at process.emit (node:events:518:28)
        at emit (node:internal/child_process:950:14)
        at process.processTicksAndRejections (node:internal/process/task_queues:83:21)

likely due to the prior exception

    Error: Debug Failure.
        at stopWatchFailedLookupLocationOfResolution (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/typescript.js:131647:11)
        at /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/typescript.js:131693:25
        at /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/typescript.js:44314:16
        at Map.forEach (<anonymous>)
        at Object.forEach (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/typescript.js:44312:25)
        at removeResolutionsOfFileFromCache (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/typescript.js:131692:19)
        at Object.removeResolutionsOfFile (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/typescript.js:131711:5)
        at _AutoImportProviderProject.removeFile (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/typescript.js:186269:28)
        at /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/typescript.js:189795:21
        at Map.forEach (<anonymous>)
        at _ProjectService.updateNonInferredProjectFiles (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/typescript.js:189792:27)
        at _ProjectService.setFileNamesOfAutoImportProviderOrAuxillaryProject (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/typescript.js:189849:10)
        at _AutoImportProviderProject.updateGraph (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/typescript.js:187479:25)
        at updateProjectIfDirty (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/typescript.js:188168:36)
        at InferredProject2.getPackageJsonAutoImportProvider (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/typescript.js:187054:7)
        at getExportInfoMap (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/typescript.js:141074:70)
        at collectAutoImports (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/typescript.js:168019:24)
        at getGlobalCompletions (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/typescript.js:167958:5)
        at tryGetGlobalSymbols (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/typescript.js:167889:397)
        at getCompletionData (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/typescript.js:167630:10)
        at Object.getCompletionsAtPosition (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/typescript.js:165495:26)
        at Object.getCompletionsAtPosition2 [as getCompletionsAtPosition] (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/typescript.js:151753:35)
        at IpcIOSession.getCompletions (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/typescript.js:194441:54)
        at completionInfo (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/typescript.js:192716:43)
        at /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/typescript.js:195218:15
        at IpcIOSession.executeWithRequestId (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/typescript.js:195207:14)
        at IpcIOSession.executeCommand (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/typescript.js:195216:29)
        at IpcIOSession.onMessage (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/typescript.js:195264:68)
        at process.<anonymous> (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/_tsserver.js:525:14)
        at process.emit (node:events:518:28)
        at emit (node:internal/child_process:950:14)
        at process.processTicksAndRejections (node:internal/process/task_queues:83:21)

Tentatively duping to #60243, but it'd be nice to have a concrete repro to be able to check

@RyanCavanaugh RyanCavanaugh added the Duplicate An existing issue was already created label Dec 17, 2024
@typescript-bot
Copy link
Collaborator

This issue has been marked as "Duplicate" and has seen no recent activity. It has been automatically closed for house-keeping purposes.

@typescript-bot typescript-bot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

6 participants