Updated third party libraries
ManyÂ third party libraries have been updated in 7.0:
Improved content assist
We can help add JSDoc tags:
We can show assist for parameters:
We can show assist for type objects:
We can show the actual return type of items from our built-in indexes (rather than simply ‘Object’):
We can also show assist for RegExp literals (finally):
Enhanced ESLint support
Along with the version update toÂ ESLint,Â we also spent time improving the overall integration support for ESLint. In doing so,Â we provided new linting rules and some content assist templates / completions to help you craftÂ ESLint directives.
The new no-empty-block rule (off by default) can be used to detect empty code blocks. When an empty block is found you get a pleasant warning in the editor, with a suggestion how to fix it:
Another new rule, throw-error, will check to make sure that you only throw error-objects from throw statements. If you fail to do so, you will see the helpful reminder:
With the change to stop using JSLint/JSHint directives and a linting rule in place to warn you about the unsupported usage, we thought it best to add some content assist completions to help you craft correct ESLint directives.
So now we have ESLint directive templates:
Assist setting up an environment:
Assist disabling / enabling rules:
In order to provide content assist inside JSDoc blocks, one of the things that we had to do was add recovery support for unclosed / incomplete comment blocks while parsing your source. The new block comment recovery support will parse and recover all complete statements up to the incomplete comment.
In the following example, the declaration can be recovered, but the if-statement cannot (since the comment is also breaking the if-statement):
Support was also improved to report parsing errors that cause a complete failure to parse, where no tokens at all are being returned from the parse. In the following example we now correctly report the bad
Improved mark occurrences
A lot of work has goneÂ into improving the accuracy and adding new occurrence support.
We can now show you occurrences of labelled statements:
Correctly show occurrences in throw statements:
Mark occurrences in use-before-define and hoisting scenarios:
We even fixed a long standing bug that refused to show occurrences for something that was not defined in the file:
Improved web tools
Our support for HTML has been improved with the addition of an HTML outline, which is powered by the htmlparser third party library.