microsoft / microsoft/TypeScript
Make Javascript intellisense detect inheritance
还没有人认领这个 Issue。
- 主要语言
- Go
- 星标
- 111k
- 派生
- 14.3k
- 平均合并
- 2 天 4 小时
- 30 天内合并 PR
- 132
描述
From @benjaminmillhouse on December 21, 2016 17:33
- VSCode Version: Code 1.8.0 (38746938a4ab94f2f57d9e1309c51fd6fb37553d, 2016-12-13T17:38:28.425Z)
- OS Version: Darwin x64 16.3.0
- Extensions:
| Extension | Author | Version |
|---|---|---|
| JSDocTagComplete | HookyQR | 0.0.2 |
| html-css-class-completion | Zignd | 1.0.3 |
| theme-atom-one-dark | andischerer | 0.0.1 |
| vscode-eslint | dbaeumer | 1.1.0 |
| docthis | joelday | 0.3.5 |
| Angular1 | johnpapa | 0.1.16 |
| Angular2 | johnpapa | 1.0.2 |
| csharp | ms-vscode | 1.5.3 |
| js-atom-grammar | ms-vscode | 0.1.10 |
| vscode-icons | robertohuertasm | 4.0.2 |
| bootstrap-3-snippets | wcwhitehead | 0.0.8 |
Hello,
I would love it if VS Code's Javascript intellisense was able to detect inheritance. Please let me know if there is a way to accomplish this today through jsdoc comments or anything like that. I have tried all kinds of different ways to get VS Code to detect it (definitions like below, @augments, @extends jsdoc comments, etc) and have not gotten anything to work.
As an example, when inheriting like this:
function BaseClass() {
this.foo = 'bar';
}
BaseClass.prototype.baz = function () { }
function InheritedClass() {
BaseClass.call(this);
}
InheritedClass.prototype = Object.create(BaseClass.prototype);
InheritedClass.prototype.constructor = InheritedClass;
Would like the intellisense for new InheritedClass(). to show 'foo' and 'baz' as properties/methods for InheritedClass in Intellisense.
Copied from original issue: Microsoft/vscode#17690
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
未指定源文件、测试或入口点。首先在 VS Code 中复现提供的 BaseClass/InheritedClass 示例,并跟踪处理原型继承的 JavaScript IntelliSense 路径。完成的标准是,new InheritedClass() 的补全建议中包含继承的成员 foo 和 baz。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- javascript, typescript
- 领域
- devtools
- Issue 类型
- 功能
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100