microsoft / microsoft/TypeScript
No auto-completion on typescript interface with classes implement
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 132
Description
Redirected by https://github.com/microsoft/vscode-cpptools/issues/3789
Type: LanguageService
Describe the bug
- macOS Mojave 10.14.5
- VSCODE : 1.35.1
- TS 3.5.1
To Reproduce
Create a file with the following :
import { Strategy } from "passport-local";
class SSOPlugin implements Plugin {
constructor() {}
init() {}
}
interface Plugin {
authenticators?: Record<string, any>;
strategies: { [key: string]: KuzzleStrategy };
}
interface KuzzleStrategy {
config: {
authenticator: string;
fields: string[];
};
methods: {
afterRegister?: () => any;
create: () => any;
delete: () => any;
exists: () => any;
getById?: () => any;
getInfo?: () => any;
update: () => any;
validate: () => any;
verify: () => any;
};
}
export = SSOPlugin;
In constructor or any method using this. and auto-completion doesn't give anything.
But if I give the wrong types, the compiler complain (also red line on IDE).
Expected behavior
I should get auto-completion.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the reported TypeScript language-service behavior with the interface and implementing class shown in the issue, then compare completions inside the constructor and methods with the compiler's type errors. Trace the completion entry point for this in an implementing class and add a regression test covering the interface members. Done means the expected members appear in auto-completion without changing type checking.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- compilers, devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100