WebStorm 2019.1: smart intentions for JavaScript, improvements in Angular support, updated CSS and HTML docs, and new debug console

⭐️WebStorm 2019.1 is now available!⭐️

WebStorm 2019.1 brings with it new smart intentions for JavaScript and TypeScript, improved support for Angular, updated documentation for CSS and HTML, a more powerful debug console, and much more!

Explore the top new features and download WebStorm 2019.1 on our website.

In this blog post we would like to share with you the detailed release notes for this WebStorm update. They are compiled from the EAP blog posts that we’ve been publishing here for the past several months.
Here are the features and improvements grouped by the WebStorm subsystems:

  • JavaScript and TypeScript support: intentions for destructuring; convert function with Promise to async function; convert properties in constructor to class fields; inspections for switch statements; add or remove export; extended error messages in TypeScript.
  • Style sheets support: updated docs for CSS and browser compatibility check; extract CSS variable; camel case support for CSS Modules; support for Less 3.0 features.
  • HTML support: improved HTML documentation.
  • Development with Angular: new inspections for Angular projects; easier navigation in Angular projects.
  • Development with React: improved completion for merged props; Extract Method refactoring for custom React Hooks.
  • Development with Vue.js: better support for Vue projects with TypeScript.
  • Node.js and npm: completion for npm scripts; version range tooltip for dependencies; run and debug Node.js app when using Docker Compose; simple Node.js project template.
  • Linters integrations: improved support for ESLint and TSLint in complex projects; support for TSLint as TypeScript plugin.
  • Debugging: new debugger console.
  • Testing: highlighting for failed line in test; testing with Cucumber and TypeScript.
  • IDE improvements: Recent Locations popup; save project as a template; soft-wraps for selected file types.
  • Version Control: cherry-pick a file from a commit from the VCS log; incoming and outgoing commits.

DOWNLOAD WEBSTORM 2019.1

JavaScript and TypeScript support

Destructuring in JavaScript and TypeScript

With destructuring, you can unpack values from arrays and objects into variables. This feature has a very concise syntax that is often used when you need to pass data in your app.

If you’re not yet familiar with destructuring, we recommend reading the great overview in the book Exploring ES6.

To help you start using destructuring in your code, WebStorm 2019.1 adds a set of new refactorings and intentions that can introduce destructuring to your code. Let’s see how they can be used when working with objects and arrays.

If you have a piece of code in which you are getting multiple values out of an array or an object, you can now simplify it by using the new Replace with object or array destructuring intention (Alt-Enter):

Replace with destructuring

If not all values from the array or object are used, the resulting destructuring will skip the elements:

Replace with destructuring: skipping values

If you want to keep the original assignments, you can use the Introduce object or array destructuring intention (Alt-Enter), or go with the Extract object or array destructuring refactoring:

Introduce destructuring

This intention can be very handy when working with React class components:

Destructuring with React

Some other IDE actions now also default to destructuring. For example, the Insert ‘require()’ quick-fix that works in Node.js apps with CommonJS modules now uses destructuring:

Insert require quick fix

There’s also a new Convert parameters to object action (Alt-Enter) that generates a destructuring parameter for a function:

Convert parameters to object

Convert Promise to async/await

With this new intention in the IDE, you can automatically change a function that returns a promise with .then() and .catch() calls to an async function that uses the async/await syntax – not only in TypeScript files, but also in JavaScript and Flow.

Simply press Alt-Enter on the name of the function and select Convert to async function. Voila!

convert-to-async

WebStorm will introduce a new variable and replace Promise.catch with the try-catch block:

In this example, WebStorm knows that fetch returns a promise and suggests converting the download function to async:

Convert properties in constructor to class fields

With this handy new intention (Alt-Enter), you can replace properties defined in a constructor with class fields:

declare-class-fields

New inspections for switch statements

WebStorm 2018.2 added an intention which generated cases for ‘switch’. But what if you edited your code and are now missing a new case inside the switch statement? Or there’s a missing default? Or what if some branches are unreachable? The IDE can now help with that too. We’ve added a bunch of improvements which may be truly beneficial to handling switch statements in JavaScript and TypeScript.

There’s now code completion inside switch that suggests cases based on the available data about the parameter (when it is a TypeScript enum or when its type is specified in JSDoc as a list of string values).

Code completion for cases inside the switch statement

The new inspection will check that all the cases are covered and if any are missing, the intention to create them can be used.

Create missing branches inside switch

If there’s an empty switch statement, the IDE will suggest that you remove it. You can unwrap a switch that only has a default clause.

The IDE will now warn you about any unreachable branches and provide a quick fix to remove them.

Another new inspection will help you avoid the situation when a variable is declared in one case and then used in another.

Variable is used in another switch case

The last new inspection will warn you if the type of switch parameter is not strictly enumerable and there is no default clause.

Create a default branch inside switch

Note that this one is set to the “Don’t show, quick fix only” severity level by default, i.e., it provides the quick fix on Alt-Enter, but it is not highlighted in the editor. To change the severity, navigate to Preferences | Editor | Inspections | JavaScript | General | ‘switch’ statement with no ‘default’ branch.

Add or remove export

With this new intention (Alt-Enter), you can quickly add export or export default for a class, variable, or function – and save a couple of seconds typing it. The Remove export action, as you may have already guessed, removes the export statement – but first it makes sure that the symbol is not used in some other files.

Add default export

Extended error messages in TypeScript

Starting with TypeScript 3, some of the error messages have additional information with links to the related code that can help you to understand the cause of the problem. WebStorm now shows this extended info in its error tooltips, so you can click on the link to jump to the code.

Extended error info in TypeScript

Adding missing library to tsconfig.json

With TypeScript, you need to explicitly list standard libraries in the tsconfig.json file that TypeScript will include in the compilation, e.g. DOM, ES2015.Promise, etc. WebStorm can help you with that. Press Alt-Enter on the symbol defined in the unlisted library, and use a quick-fix to add the required libraries to tsconfig.json.

Add missing TypeScript library to tsconfig.json

TypeScript 3.3 and 3.4

We have updated the bundled version of TypeScript to 3.3.

To get ready for the TypeScript 3.4 release, we’ve supported the new syntax features planned for this release.

Style sheets support

Updated docs for CSS and browser compatibility check

We’ve updated our documentation for CSS properties and pseudo-elements. Press F1 to see the brief description of the property and its values, as well as information about the supported browsers.

CSS docs

The description and browser compatibility data is loaded from MDN. You can quickly open the full article in the browser to see more details and examples – click the link at the bottom on the documentation popup, or press Shift-F1.

If you’re offline and the IDE can’t access developer.mozilla.org, WebStorm will show the property description from the bundled schemas that it uses for completion and validation. It might be different from the one available on MDN, but still useful.

Now, when WebStorm knows what browsers support a specific CSS property (thanks to MDN Browser Compatibility Data), you can use a new compatibility inspection. Go to Preferences/Settings | Editor | Inspections – CSS and select “Browser compatibility”, then select the minimum browser versions you want to target. You will see a warning in the editor if a property is not supported in the target browser.

CSS browser compatibility

Extract CSS variable

With the new Extract CSS variable refactoring, it is now so much easier to introduce variables using the var(--var-name) syntax in your .css files.

Select the value you want to declare as a variable and press Alt-Cmd-V on macOS or Ctrl-Alt-V on Windows and Linux. Or, select Extract Variable in the Refactor menu. Then type the name and decide if you want to replace just one or all usages of this value in the current file.

Extract CSS variable refactoring

By the way, the color preview on the editor gutter now works for all usages of CSS variables.

Camel case support for CSS Modules

If you’re using CSS Modules in your project, code completion for classes in the JavaScript file will now suggest camel-cased versions of class names with dashes:

CSS Modules: completion for class names with dashes

Support for Less 3.0 features

In Less files, we’ve added support for the Less 3.0 feature, properties as variables.
After typing $ as a value, you will now see suggestions for the property names used in this scope that can be used as variables:

Less 3: properties as variables

WebStorm now also supports the if syntax in Less.

HTML support

Updated HTML documentation

We updated the HTML documentation to make it much more informative and useful. The quick documentation for a tag (Ctrl+Q on Windows and Linux or F1 on macOS) shows its short description from MDN including its compatibility with the most popular browsers: Chrome (+Android), Safari (+iOS), Firefox, IE, and Edge. (Note that if there’s no available information or if a tag is available in all browsers, then no browser info is shown.)

Updated docs for HTML tags

The docs for the attributes also show the MDN data:

Updated docs for HTML attributes

If you want more information about the tag and examples of how it is used, then it is easy to consult the full MDN reference – press Shift+F1 or click the link and it will open in the browser.

Improvements in Pug

We’ve fixed a bunch of issues related to the use of JavaScript in Pug (ex-Jade) files: arrow functions are supported inside of Pug’s script tag and template strings are now also properly supported.

Better support for Pug

Development with Angular

New inspections for Angular projects

For Angular applications, we’ve added 17 new inspections that will help you detect Angular-specific errors in your app as you edit code. These inspections are going to replace the integration with the Angular language server that the IDE was running side by side with the TypeScript service. Our goal is to provide a better editing experience when working with both TypeScript and Angular template files, with more checks and quick-fixes available for them.

Here are a couple of examples:

The new inspection suggests to add a component to a module:

Add missing component to module

This inspection warns you that both template and templateUrl properties are used and suggests removing one:

Angular inspection

Here the inspection warns you about the incorrect use of structural directives:

Angular inspection

To see the full list of inspections and configure them, go to Preferences/Settings | Editor | Inspections – Angular.

Easier navigation in Angular projects

We know that when working on Angular projects you always have to jump between the different component files such as TypeScript, template, and style files. There are many ways to do this: you can use the Navigation bar, or the Project view, or Go to File, or the Angular CLI QuickSwitch plugin…

We’ve decided to add one more – using the Related Symbol… popup. When you’re in one of the Angular component files, press Ctrl-Cmd-Up on macOS or Ctrl+Alt+Home on Windows and Linux to see the list of other related files. Then you can use the arrow keys to select the file you need and then press Enter to open it.

Angular related symbol popup

In the popup, you can also use the numbers associated with each file type: 1. The TypeScript file with the component class; 2. Template; 3. Tests; and 4. Styles. So Ctrl-Cmd-Up / Ctrl+Alt+Home and then 1 will take you to the TypeScript component file.

In the TypeScript file, the Related Symbol popup will also list all the symbols that were imported into this file (hence, the name).

Development with React

Improved completion for props

WebStorm now provides better code completion for React props merged using with the spread operator.

Extract Method now works for custom React Hooks

React Hooks have recently landed in the stable React version. One of the features that was immediately suggested to us was a refactoring for creating a custom React hook – and the Extract Method refactoring is perfect for this task!

We’ve implemented a couple of improvements, namely, allowed Extract Method to work with local functions and use destructuring for the return values.

extract-react-hook

So here’s how it works:

  • Select the code you want to extract.
  • Use Refactor this… (Ctrl-T on macOS or Ctrl+Shift+Alt+T on Windows and Linux) or Extract Method (Alt-Cmd-M / Ctrl+Alt+M).
  • Select the scope where the extracted function should be defined.
  • Name it.

Development with Vue.js

Better support for Vue projects with TypeScript

We have good news for all our Vue and TypeScript fans! WebStorm now uses the TypeScript language service together with its own TypeScript support, for any TypeScript code in .vue files. This means that you’ll now get more accurate type checking and type info, and you will be able to use the quick-fixes provided by the service. All the TypeScript errors in the current file will be listed in the TypeScript tool window at the bottom of the IDE window.

Node.js and npm

Completion for npm scripts

When adding new scripts to the package.json file, WebStorm now provides suggestions for available commands. You can see a list of commands provided by the installed packages (from the node_modules/.bin folder):

Code completion for npm scripts

After typing node, the IDE will offer completion for folders and files that you can run. And after typing npm run, you’ll see a list of tasks defined in the current file. Cmd/Ctrl-click on the task name will take you to its definition in the same file:

Completion for npm scripts

Version range tooltip for dependencies

Another improvement related to the package.json file is a new tooltip that shows what range of versions could be installed when running npm install or yarn install. Press Cmd/Ctrl and hover over the version to see the information.

Semver info

Run and debug Node.js app when using Docker Compose

If you’re using Docker for testing your Node.js application, you can now use the configuration described in the Docker Compose file to easily run and debug the app from the IDE.

Please note that the described steps only work if you use node or npm in the command field of your Docker Compose file to run your app, e.g. command: node ./src/app.js

  1. Create a new Node.js run/debug configuration using the Edit Configurations… action in the Run menu.
  2. Click the icon next to the Node.js interpreter field, then click + and select Add Remote…
  3. In the dialog that opens, select Docker Compose. If you haven’t used Docker in WebStorm before, you need to configure the Docker connection – click the New… icon and select the connection option according to your OS as described in this doc.
    Add remote node interpreter with Docker Compose
  4. Set the path to the Docker Compose file and select the service you want to run.
  5. In the Node.js run/debug configuration, leave the JavaScript file field blank if you want WebStorm to use the command specified in your Docker Compose file. If you want to override it, you can use the fields in the configuration (JavaScript file, node, and app parameters…).
  6. Save the configuration.

Now you can use this configuration to run or debug your app – the IDE will deploy the app to the Docker container using the docker-compose up command and, if running in the debug mode, pass the debug flag to Node.js and attach to the debug process.

If you don’t use Docker Compose or want to have a closer look at the Docker support for Node.js in WebStorm, check out the blog post “Quick tour of WebStorm and Docker”.

Simple Node.js project template

To make it easier to start a simple Node.js app, we’ve added a new template called “Node.js”. You can choose this when you click Create New Project on the IDE Welcome screen.

This project generator runs the npm init command that adds a package.json file and enables code completion for Node.js core APIs.

Linters integrations

Improved support for ESLint and TSLint in complex projects

We have completely redesigned our integration with ESLint and TSLint to improve the way it works in monorepos (including projects managed by lerna and yarn workspaces) and projects with multiple linter configurations.

Before, WebStorm could run only one linter’s service per project. So if you had different linter versions with different configs in different parts of your project, still only one ESLint or TSLint process would run, resulting in some configs being ignored or some plugins working incorrectly.

Now, the IDE will start a separate process for every package.json that lists a linter (ESLint or TSLint) as a dependency, and it will process everything below it as if it were invoked with .bin/eslint **/*.js (in case of ESLint).

This behavior is on by default for all new projects.

To switch to the new mode in the existing projects, go to Preferences/Settings | Languages and Frameworks | JavaScript | Code Quality Tools | ESLint or TypeScript | TSLint and select Automatic ESLint/TSLint configuration.

If you need to run a globally installed linter, pass additional options to it, or add a custom rules directory, you configure all these additional options if you select Manual configuration.

Support for TSLint as TypeScript plugin

If you’re using TypeScript in your .vue files and want to lint the code inside the script tag using TSLint, you can now use the typescript-tslint-plugin plugin for TypeScript. With this, TSLint checks become part of the TypeScript language service, and you will be able to see all the TSLint errors next to the TypeScript errors in the IDE tool window and, of course, in the editor.

You can fix and suppress TSLint errors and warnings using the intentions available on Alt-Enter.

To start using it, first, install the plugin with npm install typescript-tslint-plugin and then enable it in the project’s tsconfig.json file:

By the way, you may also want to use typescript-tslint-plugin if you have enabled the TSLint rules that require type information (like “deprecation” or “prefer-readonly”) – that way these types of errors will be highlighted in the editor as you type.

Debugging

New debugger console

We have completely re-implemented the debugger console in the JavaScript and Node.js debug tool windows. This console shows you stack traces and everything that was logged in your code (e.g. using console.log()). You can use this interactive console to evaluate arbitrary JavaScript statements – just start typing them in the input at the bottom of the console panel.

Here are some of the new features and improvements that we’ve implemented. You can debug this demo file in WebStorm 2019.1 EAP to see all these features in action.

  • The objects are now nicely displayed using a tree view.
    Objects in debug console
  • Stack traces are now collapsed by default.
  • Warnings (console.warn()), errors (console.error()), and info (console.info()) messages now have different icons and background colors to make them easier to notice.
  • You can filter out any type of log messages using the filter icon on the left side of the console panel.
    Console messages
  • You can now see the log messages styled using CSS and the %c marker.
    CSS styling for messages in debug console
  • The log messages grouped together using console.group() and console.groupEnd() are now displayed as a tree.
  • If you’re using console.groupCollapsed(), the output will be collapsed by default.
    Groups in debug console

Testing

Highlighting for failed line in test

If you’ve run tests in WebStorm and some of them have failed, now you can see where the problem has occurred – right in the editor. The IDE will use the information from the stack trace and highlight the failed code. On hover, you’ll see the error message from the test runner. And you can immediately start debugging the test.

Highlighting for the failed line in test

This works with Jest, Karma, Mocha, and Protractor.

Testing with Cucumber and TypeScript

If you’re using Cucumber and TypeScript, you will notice some major improvements in WebStorm 2019.1. First, you can now jump from the steps in the .feature file to their definitions in the TypeScript file. Second, you can generate missing definitions using a quick fix (Alt-Enter on the highlighted step).

Cucumber steps implemented in TypeScript

Please note that at the moment WebStorm only supports step definitions that are written using regular expressions.

To run such tests in the IDE, use a Cucumber.js run/debug configuration and add Compile TypeScript as a Before launch task (if you don’t have any other build step set up for compiling TS): this way, the IDE will run a TypeScript compiler with the selected tsconfig.json file before running Cucumber.

Cucumber configuration with Compile TypeScript action as a Before Launch task

Cucumber test results in a tool window

If you want to debug these tests, don’t forget to enable source maps ("sourceMap": true) in your tsconfig.json file.

IDE improvements

New UI themes

You can now use the new colorful UI themes in WebStorm that are available as plugins. Choose between the Dark Purple, Gray, and Cyan Light themes, or create your own.

New purple UI theme

Recent Locations

WebStorm 2019.1 adds a new way to navigate around the project – the Recent Locations popup. It can be opened with Cmd-Shift-E on macOS or Ctrl+Shift+E on Windows and Linux.

Recent Locations popup

It shows you the list of files and lines of code in them that you have recently opened in the editor (when navigating to the definition or usage, using the Go to action, or simply opening the file from the project view).

When the popup is open, start typing to filter the results and find the code you need (the search works for the code and file names). Of course, you can also just use the up and down arrows to select the required location.

Recent Locations popup: quick search

If you want to only see the code fragments that have been changed, select the “Show only changed” checkbox.

Save project as a template

Do you have a project that you want to use as a template for other new projects? Now with the new action Save as a Template in the Tools menu you can create custom project templates.

To use the template, click Create New Project on the IDE Welcome Screen and simply select the template from the list.

Create new project from custom template
All project settings in the .idea folder will be saved in the template. So if you want your new project to have some predefined run/debug configurations, check the Share checkbox in the configuration before you save the template.

Soft-wraps for selected file types

You can now enable soft-wraps in the editor for specific file types. To do that, open Preferences/Settings | Editor | General and specify the file types in the “Soft-wrap files” field:

soft-wraps

With the soft wrapping on, the IDE will display long lines wrapped in the editor without actually adding line breaks.

Drag to add multiple cursors

If you want to add cursors at the same position on multiple lines, you now need to press Alt-Shift (instead of Alt), then press the mouse key and drag the cursor up or down. You can change the key combination in Preferences / Settings | Keymap: search for the Add rectangular selection action.

Version Control

Cherry-pick a file from a commit from the VCS log

Now you can cherry-pick select files from a commit, right from the context menu in the VCS log:

VSC: Apply selected changes

Incoming and outgoing commits

The IDE now indicates if the incoming and outgoing commits are available for individual branches in the Branches popup. To see this info, open Preferences/Settings | Version Control | Git and enable the new option, Mark Branches that have incoming/outgoing commits in the Branches popup.

File status for ignored files and folders

In the Project view, the ignored files and folders now use olive-green so that it’s easier to distinguish them from other files. You can modify the color in Preferences/Settings | Version Control | File Status Color.

ignored-folders

DOWNLOAD WEBSTORM 2019.1

Your WebStorm Team

About Ekaterina Prigara

Ekaterina Prigara is WebStorm product marketing manager at JetBrains. She's passionate about new technologies, UX and coffee.
This entry was posted in Release Announcements and tagged , . Bookmark the permalink.

17 Responses to WebStorm 2019.1: smart intentions for JavaScript, improvements in Angular support, updated CSS and HTML docs, and new debug console

  1. Andrii says:

    Now the keywords “import”, “export”, “class”, “function” and many others have become not bold, but thin font. Is this a bug or a feature?

    • Ekaterina Prigara says:

      Hello Andrii, there’s been some changes in the way fonts are rendered on macOS – they became a bit thinner: https://youtrack.jetbrains.com/issue/JBR-1174
      However, it is not specific to the keywords. If you want keywords to be bold, you can configure the font style in the IDE Preferences / Settings | Editor | Color Scheme | Language Defaults – Keyword.

  2. diegocr says:

    > Mark Branches that have incoming/outgoing commits in the Branches popup.

    This option have caused me to get banned from my company’s Gitlab server(s), powered by fail2ban…

    Be aware guys…

  3. BingqiChen says:

    How can I close the feature about ‘Camel case support for CSS Modules’.
    At this point, the old version is more useful for me.

  4. This version looks quite promising so I immediately updated it at work.

    I was quite exited by the “convert to async function” feature. We are progressively migrating to this pattern and it could have help the team to progressively update legacy functions/callback/methods.

    Unfortunately it doesn’t look to be mature enough yet, it failed almost everywhere I waited to use it.

    1. It is not proposed on arrow or anonymous functions

    And trying to use “convert to a named function” first fails. It does more than it says, it in fact convert function expressions to function declarations (and worst, it places it after where it was called, breaking eslint rules) .

    2. It puts an ‘await’ after ‘return’ which makes no sense.

    The return value of an async function will always be a promise, so putting await here has no to limited value.

    3. It doesn’t always convert the inner .then() / .catch() usages

    In the below function it will only add ‘async’
    The issue looks to come from when the then callback is generated by a function call

    function run(durationInSec = DEFAULT_DURATION_SECONDS) {
    return getUrl().then(doConnect(duration * 1000)).catch(err => ({ status: ‘error’, err }));
    }

    the result for that is

    async function run(durationInSec = DEFAULT_DURATION_SECONDS) {
    return getUrl().then(doConnect(duration * 1000)).catch(err => ({ status: ‘error’, err }));
    }

    It also fails the same way when a “then()” callback is defined in another file :-(

    4. It doesn’t support destructuring

    If I try to convert this little function

    function getUrl() {
    return service.getConfig().then(({ url }) => url);
    }

    It generates a broken async function with an undefined variable

    async function getUrl() {
    await service.getConfig();
    return await url
    }

    Thanks for the effort anyway. I hope all those limitations will be fixed in version 2019.2 or even better in a sooner 2019.1.1 version

    • Also found that
      – it doesn’t propose to convert if the function doesn’t return any value
      – it leaves ‘return Promise.resolve(value)’ patterns as is while it should become ‘return value’
      – idem with ‘return Promise.reject(error)’ which should become ‘throw error’

      I looked into youtrack and saw that some of the issues may already have been fixed
      (ex: WEB-38013 “Convert to async function doesn’t play well with destructuring”)

    • Anton Lobov says:

      Hello Alexandre, thanks a lot for your feedback!

      1. It should be proposed there, but look like it is available only on the arrow itself.
      Created a new ticket: https://youtrack.jetbrains.com/issue/WEB-38304.

      Could you please provide some sample when “convert to a named function” fails? It would be better to create a youtrack ticket with a repro.

      2. There exist cases when ‘return await’ and ‘return’ differ a bit in behavior. I created https://youtrack.jetbrains.com/issue/WEB-38307 to investigate this and eliminate the redundant await when possible.

      3. Created https://youtrack.jetbrains.com/issue/WEB-38306, thanks. A good candidate for the next bugfix update (2019.1.2 or .1.3).

      4. Yes, that’s WEB-38013, and it is already fixed, thanks. Comes in 2019.1.1.

      >it doesn’t propose to convert if the function doesn’t return any value
      This is by design. This refactoring now only converts the functions that return promise chains. Could you please provide some sample of where you need it for a function without return value? (We’re going to extend the applicability, so having an extra sample will help immensely.)

      Currently we decided against replacing Promise.resolve and Promise.reject, just to keep this refactoring as simple as possible. But this would be a good improvement for the next version. Created https://youtrack.jetbrains.com/issue/WEB-38308.

      Thanks again for your valuable feedback, it helps us a lot with improving the product.

  5. Hi Anton,

    Thanks for the tickets creation, that awesome :-)

    > Could you please provide some sample when “convert to a named function” fails?

    I created a dedicated ticket: https://youtrack.jetbrains.com/issue/WEB-38314

    > 3. Created https://youtrack.jetbrains.com/issue/WEB-38306, thanks. A good candidate for the next bugfix update (2019.1.2 or .1.3).

    Thanks, and I see it’s already fixed
    But looks like you missed my other issue with callback coming from external modules
    I added the example to that ticket in a comment but it probably deserve a dedicated ticket

    > Could you please provide some sample of where you need it for a function without return value?

    Lot of functions can take advantage of async / await without returning a value as long as they have to internally chain async calls.
    For an even more meaningful context let’s show it in an event listener callback that usually don’t expect return values

    getStateButton.addEventListener('click', async function getState() {
    let result;
    try {
    const response = await fetch(dataUrl);
    result = await response.json();
    } catch (error) {
    result = error;
    }
    outputTag.append(JSON.stringify(result, null, ' '));
    });

    I also found out that the async conversion is not proposed on class method names
    It only suggests “convert to field holding arrow function”
    I created a dedicated ticket:
    https://youtrack.jetbrains.com/issue/WEB-38315

  6. R. La says:

    Hi,

    How do you quickly navigate to the .js source instead of the d.ts? Go To Declaration, Go To Implementation, CMD/CTRL+Click all jump to the d.ts. This question is related to:

    https://youtrack.jetbrains.com/issue/WEB-23618

    which is tagged “fixed”.

    Sometimes, it is useful to access the actual js source becausre the d.ts is inaccurate/buggy.

    Thanks.

    • julia.mochenkova says:

      Hi! We need exact steps on how to reproduce your case. Please, create a new issue with a detailed description.

  7. Tim says:

    Looks like jetbrains own angular support implemetation not consistent with angular language service. After update to 2019.1 almost whole my project become red because of “Component or directive is out of angular’s module scope”
    The common part of this components they all defined in node_modules, not in a project directly.
    Components module imported in current module and it works with Angular compiler without an issue (and it worked with language service, all parameters were checked, autocomplete worked)

    • julia.mochenkova says:

      Hi, Tim.
      Could you clarify, please, how these modules are imported? What syntax do you use?

      • Tim says:

        This is the usual library distributed via npm.
        Library itself built with ng-packagr (following angular package format with metadata generated)

        All components included in angular modules and this module imported in host application.
        Absolutely nothing special, just a regular workflow

        More over new version doesn’t warn about private fileds used in templates wich is crucial for AOT compilation.
        Doesn’t understand type of items if QueryList used *ngFor and other less noticable issued wich I facing almost every day. Overall support feels very unreliable, unfortunately.

        I really don’t understand why JetBrains decided to drop Angular Language Service support and invent your own wheel which alway will be behind of official Angular’s solution.

        BTW is there already opened a ticket about angular support where I can check existing issues and add my own?

        • piotr.tomiak@jetbrains.com says:

          Hi Tim!

          First of all we have dropped support for Angular language service due to it’s lack of support from Google. It is outdated and in some cases gives false errors, not to mention it’s lack of refactoring and good type handling support. Moreover users do not have any way to suppress errors or configure they error level, etc. We were also not able to provide quick fixes and intentions.

          The 2019.1 release was a huge step forward in terms of what kind of inspections we were able to run on the source. We are now able, for instance, to provide better type checking than Angular compiler, not to mention a better content assist in the templates. We’ve added several quick-fixes for issues, including auto-module import. There were however some rough edges especially around support for libraries metadata format of which all got fixed for 2019.1.2. Thank you for filing an issue for QueryList type, which is not treated as NgIterable. I’ll try to get it doen for 2019.1.3.

          You can find other open Angular issues with our issue tracker: https://youtrack.jetbrains.com/issues?q=tag:%20Angular%20%23Unresolved%20

          Support for inspection of private fields in AOT is coming in 2019.1.3: https://youtrack.jetbrains.com/issue/WEB-34765 . It will include a quick-fix which you can apply from the template or component or on every occurrence with “Inspect code…”.

          If you experience other issues with Angular support after updating to 2019.1.2, please file an issue for it using our tracker and I’ll be glad to resolve it.

Leave a Reply

Your email address will not be published. Required fields are marked *