microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
160.52k stars 28.11k forks source link

Scrolling breaking semantic highlighting #210295

Open RedCMD opened 2 months ago

RedCMD commented 2 months ago

Scrolling up and down causes semantic highlighting to randomly stop working

First time it's happened to me I dare not restart anything atm too late 😔

https://github.com/microsoft/vscode/assets/33529441/98184bfb-549f-4123-a810-1145060fb838

other files not affected its not locked to any certain scroll position (cut off points randomly shifts)

doesn't change 'while' scrolling, only after I've stopped scrolling for ~1sec

Somehow it still has its semantic token info applied image

But isn't affecting 'dead' code (darker blue). only consts image image

image

log.ts:419  INFO Started local extension host with pid 7580.
log.ts:429  WARN [cmake-tools]: Couldn't find message for key cmake-tools.configuration.cmake.options.advanced.statusBarVisibility.variant.description.
log.ts:439   ERR Extension 'ms-toolsai.jupyter' wants API proposal 'notebookControllerKind' but that proposal DOES NOT EXIST. Likely, the proposal has been finalized (check 'vscode.d.ts') or was abandoned.
log.ts:419  INFO Extension host (LocalProcess pid: 7580) is unresponsive.
log.ts:419  INFO Extension host (LocalProcess pid: 7580) is responsive.
log.ts:419  INFO [perf] Render performance baseline is 60ms
log.ts:439   ERR Cancelled: Canceled
    at _.B (vscode-file://vscode-app/e:/VSCode-win32-x64/resources/app/out/vs/workbench/workbench.desktop.main.js:785:28974)
    at async _.z (vscode-file://vscode-app/e:/VSCode-win32-x64/resources/app/out/vs/workbench/workbench.desktop.main.js:785:25774)
    at async _.getExtensions (vscode-file://vscode-app/e:/VSCode-win32-x64/resources/app/out/vs/workbench/workbench.desktop.main.js:785:22432)
    at async oe.getExtensions (vscode-file://vscode-app/e:/VSCode-win32-x64/resources/app/out/vs/workbench/workbench.desktop.main.js:2909:13776)
    at async Me.Lc (vscode-file://vscode-app/e:/VSCode-win32-x64/resources/app/out/vs/workbench/workbench.desktop.main.js:2845:25206)
    at async Me.Uc (vscode-file://vscode-app/e:/VSCode-win32-x64/resources/app/out/vs/workbench/workbench.desktop.main.js:2845:27892)
    at async Me.rc (vscode-file://vscode-app/e:/VSCode-win32-x64/resources/app/out/vs/workbench/workbench.desktop.main.js:2845:14713)
    at async vscode-file://vscode-app/e:/VSCode-win32-x64/resources/app/out/vs/workbench/workbench.desktop.main.js:2845:13012
log.ts:429  WARN Settings pattern "application.*" doesn't match any settings
  {
    "window.zoomLevel": 1,
    "files.autoSave": "afterDelay",
    "editor.acceptSuggestionOnEnter": "off",
    "window.customMenuBarAltFocus": false,
    "window.enableMenuBarMnemonics": false,
    "files.hotExit": "onExitAndWindowClose",
    "editor.suggestSelection": "recentlyUsedByPrefix",
    "explorer.autoReveal": false,
    "editor.renderControlCharacters": true,
    "[.asm]": {
        "editor.quickSuggestions": {
            "comments": "off",
            "strings": "off",
            "other": "off"
        },
        "editor.parameterHints.enabled": false,
        "editor.formatOnType": false,
        "editor.wordWrap": "off",
        "C_Cpp.default.systemIncludePath": [
            "D:\\Documents\\CASIO\\fx-9860G_SDK\\OS"
        ]
    },
    "[.src]": {
        "editor.quickSuggestions": {
            "comments": "off",
            "strings": "off",
            "other": "off"
        },
        "editor.parameterHints.enabled": false,
        "editor.formatOnType": false,
        "editor.wordWrap": "off"
    },
    "[xml]": {
        "editor.wordWrap": "on"
    },
    "files.associations": {
        "*.wasm": "wasm"
    },
    "editor.formatOnType": true,
    "editor.tabSize": 4,
    "editor.detectIndentation": false,
    "editor.insertSpaces": false,
    "editor.useTabStops": false,
    "workbench.editorAssociations": {
        "*.abs": "default",
        "*.wasm": "default"
    },
    "editor.minimap.maxColumn": 10000,
    "diffEditor.renderSideBySide": true,
    "workbench.editor.highlightModifiedTabs": true,
    "editor.largeFileOptimizations": false,
    "workbench.startupEditor": "none",
    "files.maxMemoryForLargeFilesMB": 3072,
    "files.participants.timeout": 10000,
    "workbench.editor.tabCloseButton": "off",
    "workbench.editor.tabSizing": "shrink",
    "workbench.editor.titleScrollbarSizing": "large",
    "editor.selectionHighlight": true,
    "editor.occurrencesHighlight": "singleFile",
    "editor.foldingHighlight": true,
    "editor.renderLineHighlight": "all",
    "workbench.editor.wrapTabs": true,
    "editor.wordWrapColumn": 180,
    "debug.internalConsoleOptions": "neverOpen",
    "editor.stickyTabStops": true,
    "diffEditor.renderIndicators": false,
    "explorer.confirmDragAndDrop": false,
    "markdown.preview.fontSize": 13,
    "security.workspace.trust.untrustedFiles": "open",
    "explorer.confirmDelete": false,
    "git.enableSmartCommit": false,
    "git.autofetch": true,
    "files.exclude": {
        "**/.git": false,
        "desktop.ini": true
    },
    "git.confirmSync": false,
    "json.maxItemsComputed": 1000000,
    "search.maxResults": 50000,
    "diffEditor.maxComputationTime": 30000,
    "editor.trimAutoWhitespace": false,
    "editor.unicodeHighlight.allowedCharacters": {
        "ỿ": true,
        "Å¿": true
    },
    "editor.glyphMargin": true,
    "codelens-sample.enableCodeLens": true,
    "editor.unfoldOnClickAfterEndOfLine": true,
    "redhat.telemetry.enabled": false,
    "search.useGlobalIgnoreFiles": true,
    "editor.suggest.insertMode": "replace",
    "javascript.suggest.completeFunctionCalls": true,
    "js/ts.implicitProjectConfig.strictFunctionTypes": false,
    "git.inputValidationSubjectLength": 75,
    "git.ignoreMissingGitWarning": true,
    "editor.guides.highlightActiveIndentation": true,
    "editor.guides.bracketPairs": "active",
    "extensions.autoUpdate": false,
    "editor.renderWhitespace": "boundary",
    "update.mode": "manual",
    "editor.minimap.size": "fill",
    "editor.wrappingIndent": "none",
    "[json]": {
        "editor.defaultFormatter": "vscode.json-language-features"
    },
    "[regex-tmLanguage]": {
        "editor.maxTokenizationLineLength": 500000
    },
    "[javascript]": {
        "editor.defaultFormatter": "vscode.typescript-language-features",
        "editor.maxTokenizationLineLength": 5000
    },
    "[jsonc]": {
        "editor.defaultFormatter": "vscode.json-language-features"
    },
    "powershell.integratedConsole.showOnStartup": false,
    "powershell.integratedConsole.focusConsoleOnExecute": false,
    "powershell.integratedConsole.startInBackground": true,
    "editor.foldingMaximumRegions": 10000,
    "SAS.connectionProfiles": {},
    "workbench.editor.empty.hint": "hidden",
    "editor.unicodeHighlight.invisibleCharacters": false,
    "git.openRepositoryInParentFolders": "never",
    "editor.maxTokenizationLineLength": 500000,
    "workbench.editor.tabActionCloseVisibility": false,
    "files.readonlyExclude": {
        "**/node_modules/vscode-textmate/**/*": true
    },
    "C_Cpp.formatting": "vcFormat",
    "C_Cpp.vcFormat.newLine.beforeOpenBrace.function": "sameLine",
    "C_Cpp.vcFormat.newLine.beforeOpenBrace.block": "sameLine",
    "C_Cpp.vcFormat.indent.caseLabels": true,
    "workbench.editor.enablePreview": true,
    "workbench.editor.closeEmptyGroups": false,
    "[leojsbody.plain.wrap][leojsbody.python.wrap][leojsbody.javascript.wrap][leojsbody.typescript.wrap][leojsbody.c.wrap][leojsbody.cpp.wrap][leojsbody.css.wrap][leojsbody.fortran.wrap][leojsbody.fortran90.wrap][leojsbody.html.wrap][leojsbody.java.wrap][leojsbody.json.wrap][leojsbody.markdown.wrap][leojsbody.php.wrap][leojsbody.restructuredtext.wrap][leojsbody.rust.wrap]": {
        "editor.wordWrap": "on"
    },
    "window.confirmBeforeClose": "never",
    "debug.onTaskErrors": "debugAnyway",
    "workbench.tree.stickyScrollMaxItemCount": 8,
    "editor.stickyScroll.maxLineCount": 7,
    "C_Cpp.codeAnalysis.exclude": {},
    "[json-textmate]": {
        "editor.defaultFormatter": "RedCMD.tmlanguage-syntax-highlighter"
    },
    "javascript.format.semicolons": "insert",
    "javascript.referencesCodeLens.enabled": true,
    "js/ts.implicitProjectConfig.module": "ES2022",
    "js/ts.implicitProjectConfig.target": "ES2022",
    "typescript.disableAutomaticTypeAcquisition": true,
    "typescript.format.semicolons": "insert",
    "typescript.inlayHints.functionLikeReturnTypes.enabled": true,
    "typescript.inlayHints.parameterTypes.enabled": true,
    "typescript.suggest.completeFunctionCalls": true,
    "diffEditor.ignoreTrimWhitespace": false,
    "diffEditor.hideUnchangedRegions.enabled": true
}

possibly related: https://github.com/microsoft/vscode/issues/197459

don't know what extension caused this happened hours later image

VSCodeTriageBot commented 2 months ago

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

Happy Coding!

RedCMD commented 2 months ago

I do think the bot shouldn't be so sensitive

RedCMD commented 2 months ago

@hediet do you have any idea? @alexdima seems to be away

alexdima commented 1 month ago

This is concerning, I see it being broken in your video. I wonder if the collapsed code blocks play a part here, in this case we make multiple requests to the TS language service, with different ranges here https://github.com/microsoft/vscode/blob/4af0c6a8f4e8b7ba223d27acd2d894a76a912a5e/src/vs/editor/contrib/semanticTokens/browser/viewportSemanticTokens.ts#L122-L124.

It is possible that either TS replies with different semantic tokens based on the ranges that we pass in or that we have some sort of bug in the SparseTokensStore when combining their reply.

hediet commented 1 month ago

@RedCMD thanks for reporting this issue! I didn't manage to reproduce this though, even with having folded ranges. Does this consistently happen on the code you've shown? ~Do you mind sharing the code?~ Seems to be this code. Unfortunately, I still cannot reproduce.

RedCMD commented 1 month ago

I haven't been able to reproduce it since

if it does happen again is there anyway to get info about it without needing to restart?

I've had problems before where the folding ranges get out of sync with the document tho usually on large JSON files