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.
ECMA 6 Script brings possibility write modules in JavaScript. NetBeans has to support writing modules. Mainly import expression: https://developer.mozilla.org/cs/docs/Web/JavaScript/Reference/Statements/import and export expression: https://developer.mozilla.org/cs/docs/Web/JavaScript/Reference/Statements/export NetBeans has to handle imports in the right way (creating variables in the model, mark occurrences, code completion, coloring etc.). The bulk of these things has to be done for export as well.
This task depends on the changes in the parser. Currently grall parser doesn't handle import and export expressions in the sufficient way. Needs to be changed there.
Created attachment 159207 [details] Go To Imported File User can use CTRL+click funtinality to navigate into the imported file. When the mouse cursor is over the imported file string and user press down CTRL, then the string is changed to the link. And when a user click on the link and NetBeans are able to find such imported file, then the file is opened.
Petre, could this be closed as resolved?
I just tested build #2276 and there are still problems with modules. This code gives error on the second line: import {LooseParser} from "./state" import {isDummy} from "./parseutil" While the error goes away if I add a semicolon on the end of the first line, but semicolons are optional in ES6
(That was an excerpt of the file "expression.js" inside the "acorn" package)
IMHO according the specification http://www.ecma-international.org/ecma-262/6.0/#sec-imports , there has to be the semicolon in import and export expressions. To PetrH.: Yes, this task can be close, if something doesn't work, new defect should be created.
Petr, according to the specs, there are rules for "Automatic Semicolon Insertion". Citing from http://www.ecma-international.org/ecma-262/6.0/#sec-automatic-semicolon-insertion [...] Certain ECMAScript statements (empty statement, let, const, import, and export declarations, variable statement, expression statement, debugger statement, continue statement, break statement, return statement, and throw statement) must be terminated with semicolons. Such semicolons may always appear explicitly in the source text. For convenience, however, such semicolons may be omitted from the source text in certain situations. These situations are described by saying that semicolons are automatically inserted into the source code token stream in those situations [...] When, as a Script or Module is parsed from left to right, a token (called the offending token) is encountered that is not allowed by any production of the grammar, then a semicolon is automatically inserted before the offending token if one or more of the following conditions is true: The offending token is separated from the previous token by at least one LineTerminator. [...] And I think this is the case I reported above (the statements are separated from one LineTerminator).
I reopened this bug, but maybe you prefer me to create another one about the automatic semicolon insertion?
It looks like you convinced me. I will try to discuss this with parser group. And you are right, this should be treated as defect and separated from this task. Thanks
Done, thanks! https://netbeans.org/bugzilla/show_bug.cgi?id=262449