microsoft / microsoft/TypeScript
Recognize properties introduced by jQuery extend
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 132
Description
The old VS JS language service used to make runtime types available at design-time, allowing it to support jQuery's extend function for adding properties dynamically. The new one uses static types and so does not offer these symbols during completion, navigate-to, etc. We've had some customer inquiries about the possibility of supporting this functionality in the TS language service.
https://developercommunity.visualstudio.com/content/problem/529989/aspnet-在html-文件-js-智能提示失效.html
https://developercommunity.visualstudio.com/content/problem/560277/javascript-go-to-members-doesnt-work-with-property.html
The latter provided this example:
(function ($) {
mynamespace.myClass = Class.extend({
init: function (options) {
// unless you specifically type this.testProperty = "abc" in JS, the 'Go to Members' will not find the below property even though it's explicitely defined.
},
__properties: {
'testProperty': {
/// <summary>
/// Gets or sets the test property
/// </summary>
/// <value type="String"></value>
get: function () {
return this._testProperty;
},
set: function (value) {
this._testProperty = value;
}
}
}
});
})(jQuery);
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 reviewing the two linked Developer Community reports and the jQuery/Class.extend example. No source files or tests are named, so first identify the TypeScript language-service entry points for completion and navigate-to, then define what recognition of dynamically introduced properties should cover and how it can be tested.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100