You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Implement interface helper does not consider what is already implemented on base classes #19847
Mohamed Hegazy (@mhegazy) I've made the required changes and would like to test now. How can I test whether the issue is fixed? Also how to debug ts compiler changes?
VSCode ships with an older version of TypeScript. Please see Using Newer TypeScript Versions documentation for more details on updating your VSCode to use a different version of TypeScript.
Mohamed Hegazy (@mhegazy)Daniel Imms (@Tyriar) Need help debugging ts executions from vscode. I tried putting a debugger; in my ts file hoping that it'd stop while fixing incorrectly implemented interfaces in my vscode OSSDEV build, but it does not.
Thanks in advance.
PS: I've configured my vscode nightly build (from master) to load local tsserver.js.
Activity
mhegazy commentedon Nov 8, 2017
PRs welcomed...
MhdTlb commentedon Nov 9, 2017
I would like to work on this issue but I need some guidance
mhegazy commentedon Nov 9, 2017
sure. The code for this fix is in https://github.com/Microsoft/TypeScript/blob/master/src/services/codefixes/fixClassIncorrectlyImplementsInterface.ts
The fix should probably be in https://github.com/Microsoft/TypeScript/blob/d998e97d8c64acf1ed4b8cd508a4589c110bd3aa/src/services/codefixes/helpers.ts#L36 to change
const classMembers = classDeclaration.symbol.members;toconst classMembers = checker.getPropertiesOfType(checker.getTypeAtLocation(classDeclaration));shobhitchittora commentedon Nov 10, 2017
Mohamed Hegazy (@mhegazy) I've made the required changes and would like to test now. How can I test whether the issue is fixed? Also how to debug ts compiler changes?
PS: I used vscode to reproduce the issue.
mhegazy commentedon Nov 10, 2017
VSCode ships with an older version of TypeScript. Please see Using Newer TypeScript Versions documentation for more details on updating your VSCode to use a different version of TypeScript.
mhegazy commentedon Nov 10, 2017
u also should write a unit test for it, see https://github.com/Microsoft/TypeScript/blob/master/tests/cases/fourslash/codeFixClassImplementInterfaceProperty.ts
shobhitchittora commentedon Nov 11, 2017
Mohamed Hegazy (@mhegazy) Daniel Imms (@Tyriar) Need help debugging ts executions from vscode. I tried putting a
debugger;in my ts file hoping that it'd stop while fixing incorrectly implemented interfaces in my vscode OSSDEV build, but it does not.Thanks in advance.
PS: I've configured my vscode nightly build (from master) to load local
tsserver.js.Tyriar commentedon Nov 11, 2017
Matt Bierner (@mjbvz) might be able to help with debugging in vscode
shobhitchittora commentedon Dec 17, 2017
Ping Matt Bierner (@mjbvz). Can you help with this?
mjbvz commentedon Dec 19, 2017
Shobhit Chittora (@shobhitchittora) To debug the ts server loaded by code:
First point your vscode
typescript.tsdkuser setting your locally build version of TypeScript:Using a local build of code, change the
execArgvin this file to beexecArgv: ['--inspect=5859']Attach to the ts server spawned by the local build of code using:
{ "type": "node", "request": "attach", "name": "Attach to TS Server", "protocol": "inspector", "port": 5859 }shobhitchittora commentedon Dec 20, 2017
A few updates on this thread -
TypeScript/src/services/codefixes/helpers.tsis refactored since the last comment by Mohamed Hegazy (@mhegazy). The method new is at - https://github.com/Microsoft/TypeScript/blob/master/src/services/codefixes/helpers.ts#L9.Blocker-
classMembersis coming as empty array when try to get autofix suggestion in vscode. ( refer screenshot )dragomirtitian commentedon Nov 13, 2018
This issue should be closed. It no longer happens since 3.0. (Had my eye on fixing it and found I had nothing to fix :) )
laughinghan commentedon May 21, 2019
Indeed, no error at all here: https://www.typescriptlang.org/play/index.html#src=interface%20MyInterface%20%7B%0A%20%20foo()%3A%20void%3B%0A%7D%0A%0Ainterface%20IBase%20extends%20MyInterface%20%7B%0A%20%20bar()%3A%20void%3B%0A%7D%0A%0Aabstract%20class%20Base%20implements%20MyInterface%20%7B%0A%20%20foo()%3A%20void%20%7B%7D%0A%7D%0A%0Aclass%20MyClass%20extends%20Base%20implements%20IBase%20%7B%0A%20%20bar()%3A%20void%20%7B%0A%20%20%20%20throw%20new%20Error(%22Method%20not%20implemented.%22)%3B%0A%20%20%7D%0A%7D
mjbvz commentedon Jan 29, 2020
Confirmed that this is fixed with TS 3.7.5