| Summary: | [hotfeature_request] Allow to create variables, methods and references without AST | ||
|---|---|---|---|
| Product: | [WebTools] JSDT | Reporter: | Dawid Pakula <zulus> |
| Component: | General | Assignee: | Project Inbox <jsdt.javascript-inbox> |
| Status: | CLOSED WONTFIX | QA Contact: | Chris Jaun <cmjaun> |
| Severity: | enhancement | ||
| Priority: | P3 | CC: | cbridgha, nboldt, thatnitind |
| Version: | unspecified | Keywords: | helpwanted |
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Mac OS X | ||
| Whiteboard: | |||
|
Description
Dawid Pakula
I'm switching to hotfeature_request.
Another example when this feature is necessary:
Code:
Ext.define('MyClass', {
config : {
price : 100
}
});
I should register methods:
MyClass.getPrice();
MyClass.setPrice(int price);
Another, create global variable/field for singletons:
Ext.define('SecondClass', {
singleton : true
});
After registering SecondClass I should register also global variable "SecondClass" with type SecondClass.
Hi Dawid, I added the helpwanted tag, so if you, or someone else, provides a patch we can accept this as a hot feature. Sounds like this is work that can be done in the inference engine. Do you have a proposal of how you would change things there? Chris Hi Chris, Thank you. Currently is immposible due design issue. Model and AST are always mixed on each process (FlowAnalyse, Binding, inferencing etc...): InferredMethod is a model (off course connected to InferredType). But parameters list, return type etc.. are always readed from AST (IFunctionDeclaration). InferredAttribute (field representation) contain field type information, but if it isn't set, JSDT trying to read it from AST. So, as long as model will be mixed with AST, it will be not easy to register "dynamic model elements" :( As an alternative, maybe DLTK model is better?
Parse -> Compile Model (IType, IField, IMethod ...) -> TI
\-> Index
Type Inferencing is done on demand (CA, syntax highlighting, override indicators and more), with compiled model and AST.
Each process (Compilation, Indexing, Inferencing, CA) is fully pluggable and can be easy extended.
Closing as won't fix after triage session in dev call on 05/24. This mean that JSDT will be slow syntax highlighter forever, or will be possible to modify inference / structure in different way? |