This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Created attachment 160115 [details] Wrong colors when varialbe declared with inline type annotation Inline type annotation are not part of ES6 but tools like babel supports it and some tools like flow promote them. It would be nice to have a support for them in nebteans. Current behaviour: - A variable declared with inline type annotation is reported as not declared. - Syntax highlighting can be broken if multiple variable are declared (see attached screenshot). Expected behaviour (in a first time): - Provide an option to support inline type annotation (ie don't report them as error) - Detect type annotation and propose the option - Syntax highlighting should always be correct - Variable declared with inline type annotation should always be considered declared. In the long run - Use annotations to report errors and help refactoring (with the help of flow?) Sample code from flow getting started (https://flowtype.org/docs/getting-started.html#_): var str: number = 'hello world!'; console.log(str);
Treat it as enhancement.
Is this ES8 spec? https://github.com/sirisian/ecmascript-types
It's not the official SPEC (as far as I know ES7 is not completed yet). But from what I understand, the author off this document will propose this for ES7 (which makes sense since many dynamic and weakly typed languages (python3, perl6) are adding optional static types). I don't know if this will be accepted but I think it is very likely.
(In reply to Jenselme from comment #3) > It's not the official SPEC (as far as I know ES7 is not completed yet). > > But from what I understand, the author off this document will propose this > for ES7 (which makes sense since many dynamic and weakly typed languages > (python3, perl6) are adding optional static types). I don't know if this > will be accepted but I think it is very likely. Looking here https://flowtype.org/docs/syntax.html#_ It's not actually the ES8 but proprietary similar syntax of the Flow and syntax extension not directly related to ES7 and ES8. We might evaluate a way for ignoring the type annotations (which is the way how it runs anyway).