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

TS is offering no quick fix to implement interface #55816

Open
bpasero opened this issue Sep 18, 2023 · 6 comments · May be fixed by #58537
Open

TS is offering no quick fix to implement interface #55816

bpasero opened this issue Sep 18, 2023 · 6 comments · May be fixed by #58537
Assignees
Labels
Bug A bug in TypeScript Fix Available A PR has been opened for this issue

Comments

@bpasero
Copy link
Member

bpasero commented Sep 18, 2023

In this case:

/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/

import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';

export class EditorParts implements IEditorGroupsService {

}

Image

@bpasero
Copy link
Member Author

bpasero commented Sep 18, 2023

This must have quite recently regressed, on Friday:

image

@mjbvz
Copy link
Contributor

mjbvz commented Sep 18, 2023

Works for me both with the workspace version of TS and using the latest TS nightly.

Screenshot 2023-09-18 at 2 27 12 PM

Had TS initialization finished when this happened? Any other info you can provide?

@bpasero
Copy link
Member Author

bpasero commented Sep 19, 2023

@mjbvz this is on macOS, it does not reproduce in an empty profile. It does reproduce with extensions disabled. So I suspect one of my settings.

My settings:

{
    // Editor
    "editor.fontFamily": "Fira Code",
    "editor.fontSize": 13,
    "editor.fontLigatures": true,
    "editor.wordWrap": "off",
    "editor.dragAndDrop": false,
    "editor.folding": true,
    "editor.formatOnSave": true,
    "editor.codeLens": true,
    "editor.renderWhitespace": "none",
    "editor.snippetSuggestions": "bottom",
    "editor.minimap.enabled": false,
    "editor.find.globalFindClipboard": false,
    "editor.inlineSuggest.enabled": true,
    "editor.smoothScrolling": false,
    "editor.suggestSelection": "first",
    "editor.suggest.localityBonus": true,
    "editor.hover.delay": 800,
    "editor.guides.indentation": false,
    "editor.renderControlCharacters": true,
    "editor.gotoLocation.multipleDefinitions": "goto",
    "editor.mouseWheelScrollSensitivity": 3,
    "diffEditor.renderIndicators": false,
    "diffEditor.experimental.showMoves": true,
    "[jsonc]": {
        "editor.formatOnSave": false,
        "editor.formatOnPaste": false
    },
    "[html]": {
        "editor.formatOnSave": false,
        "editor.formatOnPaste": false
    },
    "[typescript]": {
        "editor.quickSuggestions": {
            "comments": "off",
            "strings": "off",
            "other": "off"
        },
        "editor.defaultFormatter": "vscode.typescript-language-features"
    },
    "[javascript]": {
        "editor.quickSuggestions": {
            "comments": "off",
            "strings": "off",
            "other": "off"
        }
    },

    // TypeScript
    "typescript.referencesCodeLens.enabled": false,
    "typescript.updateImportsOnFileMove.enabled": "always",
    "javascript.updateImportsOnFileMove.enabled": "always",
    "typescript.inlayHints.parameterNames.enabled": "none",
    "typescript.preferences.autoImportFileExcludePatterns": [
        "xterm",
        "xterm-headless",
        "node-pty",
        "vscode-notebook-renderer",
        "src/vs/workbench/workbench.web.main.ts",
        "src/vs/workbench/api/common/extHostTypes.ts"
    ],

    // Workbench
    "files.autoSave": "afterDelay",
    "files.dialog.defaultPath": "/Users/bpasero/Development/Microsoft/",
    "workbench.iconTheme": null,
    "workbench.colorCustomizations": {
        "focusBorder": "#F3F3F3",
        "inputOption.activeBackground": "#007acc1f",
        "inputOption.activeBorder": "#007acc1f",
        "editorLineNumber.activeForeground": "#2b91af",
        "list.focusHighlightForeground": "#fff",
        "activityBar.activeBorder": "#2c2c2c",
        "sideBarSectionHeader.border": "#0000",
        "list.activeSelectionBackground": "#3399FF",
        "list.highlightForeground": "#0066BF",
        "list.activeSelectionIconForeground": "#fff",
        "diffEditor.insertedTextBackground": "#9bb95533"
    },
    "workbench.tips.enabled": false,
    "workbench.startupEditor": "none",
    "workbench.tree.renderIndentGuides": "none",
    "workbench.tree.expandMode": "singleClick",
    "workbench.settings.editor": "json",
    "workbench.colorTheme": "Default Light+",
    "window.restoreFullscreen": true,
    "window.commandCenter": false,
    "window.newWindowDimensions": "inherit",
    "workbench.editor.tabHeight": "compact",
    "workbench.editor.empty.hint": "hidden",
    "workbench.editor.decorations.badges": true,
    "workbench.editor.decorations.colors": false,
    "workbench.editor.enablePreview": false,
    "workbench.editor.showTabs": false,
    "breadcrumbs.enabled": false,

    // Testing
    "testing.openTesting": "neverOpen",

    // Terminal
    "terminal.integrated.fontFamily": "Menlo",
    "terminal.integrated.fontSize": 13,
    "terminal.integrated.lineHeight": 1.4,
    "terminal.integrated.windowsEnableConpty": false,
    "terminal.integrated.showExitAlert": false,
    "terminal.integrated.tabs.enabled": true,
    "terminal.integrated.shellIntegration.enabled": true,
    "terminal.integrated.commandsToSkipShell": [
        "workbench.action.openPreviousEditorFromHistory"
    ],

    // Explorer
    "explorer.decorations.colors": false,
    "explorer.confirmDragAndDrop": false,
    "explorer.confirmDelete": false,

    // Search
    "search.actionsPosition": "right",

    // Git
    "git.mergeEditor": true,
    "git.autofetch": true,
    "git.confirmSync": false,
    "git.enableSmartCommit": true,
    "git.showInlineOpenFileAction": false,
    "git.ignoreLimitWarning": true,
    "git.branchRandomName.enable": true,
    "git.inputValidationSubjectLength": 500,
    "git.showActionButton": {
        "commit": false,
        "publish": false,
        "sync": false
    },
    "git.closeDiffOnOperation": true,
    "git.branchPrefix": "ben/",
    "scm.defaultViewMode": "list",
    "scm.alwaysShowRepositories": false,
    "githubPullRequests.fileListLayout": "flat",
    "githubPullRequests.defaultMergeMethod": "squash",
    "githubPullRequests.createOnPublishBranch": "never",
    "githubPullRequests.pullBranch": "never",
    "githubPullRequests.pushBranch": "always",
    "githubPullRequests.postCreate": "none",
    "githubPullRequests.assignCreated": "${user}",
    "githubIssues.issueCompletionFormatScm":"${issueTitle} (fix ${issueNumberLabel})",
    "githubIssues.queries": [
        {
            "label": "My Issues",
            "query": "assignee:bpasero sort:updated-desc is:open"
        },
        {
			"label": "Reviewed By Me",
			"query": "is:open reviewed-by:bpasero"
		}
    ],
    "githubPullRequests.useReviewMode": {
        "merged": false,
        "closed": false
    },
    "comments.openView": "never",

    // Debug
    "debug.inlineValues": "on",
    "debug.internalConsoleOptions": "neverOpen",
    "debug.openDebug": "neverOpen",
    "debug.javascript.autoAttachFilter": "disabled",
    "debug.console.fontFamily": "Fira Code",
    "debug.console.fontSize": 13,
    "debug.console.lineHeight": 20,
    "debug.showBreakpointsInOverviewRuler": true,
    "debug.console.acceptSuggestionOnEnter": "on",

    // Extensions
    "extensions.autoUpdate": true,
    "extensions.ignoreRecommendations": true,

    // Problems
    "problems.decorations.enabled": true,

    // Update
    "update.showReleaseNotes": false,

    // Ignored Settings
    "settingsSync.ignoredSettings": [
        "editor.mouseWheelScrollSensitivity"
    ],
    "window.zoomLevel": 1
}

My extensions:

@bpasero bpasero assigned bpasero and unassigned bpasero Sep 19, 2023
@bpasero bpasero removed the important label Sep 19, 2023
@bpasero
Copy link
Member Author

bpasero commented Sep 19, 2023

Tested this more using vscode-bisect and actually I can reproduce this even with default settings and no extensions months ago.

I believe the issue here is that the service is 2 different types from that file, its both the decorator and the interface:

image

I suspect that the quick fixes are computed based on the decorator and not the service then:

image

@mjbvz
Copy link
Contributor

mjbvz commented Sep 21, 2023

Was finally able to reproduce this in src/vs/workbench/contrib/externalTerminal/electron-sandbox/externalTerminal.contribution.ts (but not in other files).

At the top of the file, I added:

import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';

export class EditorParts implements IEditorGroupsService { }

Here's the TS error:

 ERR <semantic> TypeScript Server Error (5.3.0-dev.20230919)
Debug Failure.
Error: Debug Failure.
    at Object.addImportFromExportedSymbol (/Users/matb/projects/vscode/node_modules/typescript/lib/tsserver.js:150252:13)
    at /Users/matb/projects/vscode/node_modules/typescript/lib/tsserver.js:156054:38
    at Array.forEach (<anonymous>)
    at importSymbols (/Users/matb/projects/vscode/node_modules/typescript/lib/tsserver.js:156054:11)
    at addNewNodeForMemberSymbol (/Users/matb/projects/vscode/node_modules/typescript/lib/tsserver.js:155476:11)
    at createMissingMemberNodes (/Users/matb/projects/vscode/node_modules/typescript/lib/tsserver.js:155423:7)
    at addMissingDeclarations (/Users/matb/projects/vscode/node_modules/typescript/lib/tsserver.js:150121:3)
    at /Users/matb/projects/vscode/node_modules/typescript/lib/tsserver.js:150083:81
    at _ChangeTracker.with (/Users/matb/projects/vscode/node_modules/typescript/lib/tsserver.js:168335:5)
    at /Users/matb/projects/vscode/node_modules/typescript/lib/tsserver.js:150083:64
    at mapDefined (/Users/matb/projects/vscode/node_modules/typescript/lib/tsserver.js:2668:22)
    at Object.getCodeActions (/Users/matb/projects/vscode/node_modules/typescript/lib/tsserver.js:150082:12)
    at /Users/matb/projects/vscode/node_modules/typescript/lib/tsserver.js:147198:46
    at flatMap (/Users/matb/projects/vscode/node_modules/typescript/lib/tsserver.js:2597:17)
    at Object.getFixes (/Users/matb/projects/vscode/node_modules/typescript/lib/tsserver.js:147198:10)
    at /Users/matb/projects/vscode/node_modules/typescript/lib/tsserver.js:144566:33
    at flatMap (/Users/matb/projects/vscode/node_modules/typescript/lib/tsserver.js:2597:17)
    at Object.getCodeFixesAtPosition (/Users/matb/projects/vscode/node_modules/typescript/lib/tsserver.js:144564:12)
    at TsecLanguageServicePlugin.boundGetCodeFixesAtPosition [as getCodeFixesAtPosition] (/Users/matb/projects/vscode/node_modules/tsec/lib/packages/tsec/language_service_plugin.js:84:43)
    at IpcIOSession.getCodeFixes (/Users/matb/projects/vscode/node_modules/typescript/lib/tsserver.js:184733:50)
    at getCodeFixes (/Users/matb/projects/vscode/node_modules/typescript/lib/tsserver.js:182844:43)
    at /Users/matb/projects/vscode/node_modules/typescript/lib/tsserver.js:185037:69
    at IpcIOSession.executeWithRequestId (/Users/matb/projects/vscode/node_modules/typescript/lib/tsserver.js:185029:14)
    at IpcIOSession.executeCommand (/Users/matb/projects/vscode/node_modules/typescript/lib/tsserver.js:185037:29)
    at IpcIOSession.onMessage (/Users/matb/projects/vscode/node_modules/typescript/lib/tsserver.js:185079:51)
    at process.<anonymous> (/Users/matb/projects/vscode/node_modules/typescript/lib/tsserver.js:186657:14)
    at process.emit (node:events:513:28)
    at emit (node:internal/child_process:937:14)
    at process.processTicksAndRejections (node:internal/process/task_queues:83:21): Error: <semantic> TypeScript Server Error (5.3.0-dev.20230919)

@mjbvz mjbvz transferred this issue from microsoft/vscode Sep 21, 2023
@mjbvz mjbvz removed their assignment Sep 21, 2023
@mjbvz
Copy link
Contributor

mjbvz commented Sep 21, 2023

This same error may have been hit in some automated tests too: #55770

@RyanCavanaugh RyanCavanaugh added the Bug A bug in TypeScript label Sep 25, 2023
@RyanCavanaugh RyanCavanaugh added this to the TypeScript 5.4.0 milestone Sep 25, 2023
@typescript-bot typescript-bot added the Fix Available A PR has been opened for this issue label May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Fix Available A PR has been opened for this issue
Projects
None yet
5 participants