FAQ Database Discussion Community

TypeScript problems in webstorm using the “import” statement

When I tried using the import statement in webstorm with TypeScript enabled I get the error Error:(14, 1) TS1148: Cannot compile external modules unless the '--module' flag is provided. However if I add the --module flag to the TypeScript command line options under "webstorm Preferences -> Languages and Frameworks ->...

Define same type for multiple variables, recognition in Webstorm

var foo, bar; For this statement and using JSDoc, how to set both variables as a given type in one line so that WebStorm recognizes it? Arbitrarily, let's take String and use a working example: /** * @type {String} */ var foo; /** * @type {String} */ var bar; Both...

WebStorm - Jasmine jQuery

I'm quite new to the usage of WebStorm, but it's not working as epected. I had a project in the past, but now I try to recreate it and try to unit test my code. I'm very new to unit testing JavaScript code. So, I have a file karma.conf.js which...

typescript unable to add definition files to webstorm

i want to use baconjs with TS,but after copy baconjs def file for ts,i got that msg: bacon.ts(216,1): error TS1148: Cannot compile external modules unless the '--module' flag is provided. to solve that,i should add a file watcher with --module cmd for tsc,but i cannot find how to distinguish between...

image in .ejs not showing when using WebStorm

I'm using Webstorm to create a page and I can't get images to show when rendering .ejs. Here is my code: test.js http = require('http') express = require('express') app = express() app.engine('.ejs', require('ejs').__express) var port = process.env.PORT ? process.env.PORT : 3000 http.createServer(app).listen(port, null, null, function(){ console.log('Listening to port ' +...

Does JetBrains Webstorm have a keyboard shortcut for copying the current function?

In JetBrains Webstorm I would like to have a keyboard shortcut that copies the entirety of the Javascript function my cursor is currently within. Does it support such functionality?

Webstorm IDE: Live Template - Accessing the project name

I am brand new to Webstorm and live templates. But after doing some researching I can't figure out how to include the project name into a live template. It looks like its easy enough in a regular template ${PROJECT_NAME} but I can't find a $PROJECTNAME$ equivalent for live templates. Does...

Webstorm helper for requiring module

I'm looking for a way to require module easily with Webstorm (shortcut, plugin, intention, ...). Here is my use case : Given my cursor located at the end of a unknown variable myVar somewhere in my JS file. When I press a shortcut, I jump at the top of the...

Jade language injection in Webstorm

I have an HTML element whose contents I want to be treated as Jade (it will be compiled to pure html later). Webstorm obviously doesn't recognise this so it has no syntax highlighting: If I go to add jade as a language injection, it isn't listed as one of the...

WebStorm 10, issue with terminal on Windows 10

I decided to try Windows 10, but having problem to make terminal works inside WebStorm. When I open terminal, sometimes it's completely black, sometimes it loads project folder but I cannot type there. There is a way to run it in the external window, but I just got accustomed to...

Should I configure a watcher for less files in a meteor project

I'm setting up a meteor project in Webstorm and so I added less, and converted my .css file to .less. Webstorm sees that this is a .less file and prompts me to add a watcher. Given that this is a meteor project, is it necessary to add the watcher or...

Webstorm SystemJS import resolve error

SystemJS makes it possible to specify what kind of content is rendered from the imported files: CSS System.import('my/file.css!') Image System.import('some/image.png!image') JSON System.import('some/data.json!').then(function(json){}) Text System.import('some/text.txt!text').then(function(text) {}) (Source) Using SystemJS, importing from a file with a type appended, gives an error in Webstorm. So when I do this: import template from './404.template.html!text';...

WebStorm: Hide html selector toolbar

In WebStorm I want to hide the toolbar that appears on html files at the top. It shows the html selectors and ids drill down. I've circled it in the below picture... ...

IntelliJ(WebStorm) Mongo Explorer doesn't work

I'm trying to use Mongo Explorer plugin on WebStorm, but it doesn't work. I added mongo executable pass and server's path from Preferences dialog. It shows the server, but it doesn't show the contents below the server. Why? ...

WebStorm: How can I link the HTML to an installed JS library?

I'm working with WebStorm. I used it's built-in feature to install jQuery. It now appears in the External Libraries section of the project. But I can't link my Html files to it (<script src="???"></script>). How can this be done?...

'require' keyword not being recognized by webstorm

I'm using WebStorm as the IDE. Here's my folder structure and express.js insalled: But my sample code is not aware of the require keyword: var express = require('express'); var app = express(); app.listen(1337, function(){ console.log("ready"); }); Update Per Darin's answer Here's my package.json file which now sits in the root...

Node Express.js 4 Route Not working, Getting 404

I've been trying to debug my route in my express app. The request is undefined but not sure why. I'm using Express 4.0 but running it Express 3.0 style (no bin/www). server.js var app = require('./app') var port = process.env.PORT || 3000; app.set('port', port); app.listen(app.get('port', function(){ console.log('Express web server is...

Language level inconsistency between Android Studio and WebStorm

Currently working with Google Backend APIs again and I tend to switch between Android Studio and WebStorm for proper syntax in both Java and HTML. This works flawlessly, except for one thing. Each time I even look at the code through any of the mentioned programs, the modules language level...

Shortcut to create automatic tags for JS and CSS files in my project in WebStorm

WebStorm is packed with nice features and shorcuts, but I'm not able to find a quick way to add JavaScript or CSS file to my HTML page. I have a new project, I create a file index.html and a script.js (or it can be a library I downloaded or a...

In Jetbrains IDEs, is there a way to see changed rows since a specific commit, instead of working copy changes?

In Jetbrains IDEs, rows that reflect working copy changes are annotated in the left hand side in green/blue or a small triangle for removed rows. For example, see the green annotation in the following screenshot: Is there a way to configure the SVN integration that will allow showing changed rows...

Typescript and webstorm, missing --module flag

Editing a typescript project, that was created on VisualStudio, in WebStorm is replying this error: Error:(1, 1) TS1148: Cannot compile external modules unless the '--module' flag is provided. the code is simple like this: in file Test.ts class helloWorld{ } export = helloWorld; Thanks in advance for your help EDITED...

JQuery DefinitelyTyped, typescript 1.4 and Webstorm error highlight

I update my jquery.d.ts definition file from https://github.com/borisyankov/DefinitelyTyped/blob/master/jquery/jquery.d.ts but it generate a lot of error if I open it inside WebStorm IDE. I found on internet that may be WebStorm compiler couldn't be up-to-date so I went on "Preference"->"Languages&Framework"->"Javascript"->"Node.js and NPM" and I update the typescript package to 1.4.1 but...

How to tell WebStorm to only preview file by single click, not create a tab?

By default, clicking on file name in Project View panel will create new editor tab in WebStorm, which is annoying. At the same time in Sublime only double click on file name will create it. How can I achieve the same behaviour in WebStorm?...

Custom surround template

How can I define my own custom surround template that I can use to wrap around a selection of javascript code followed by reformat. I've used Alt + Cmd + T to bring up this option panel....

Shortcut to move the cursor to certain characters in Webstorm

I've seen several videos where the user is using Webstorm and hits a keyboard shortcut which brings up a small input field that the user can type a letter, number or other character into. Webstorm then presents the user with several choices denoted by "A", "B", "C", etc. which the...

WebStorm not tabbing correctly on a single file

For some strange reason, WebStorm has decided that all tabs typed in for a single file shall be single spaces, instead of the 4 the editor is set for. I have checked, all my other source files are still working correctly. Things I have tried: Closing tab and reopening Renaming...

How to use PyCharm and WebStorm in the same editor

I'm working on a project involving python and javascript (react). I would like to know if someone knows a way to use pycharm and webstorm in the same editor or if there is a plugin to add react support to PyCharm. Thanks for your help....

How to create a NodeJS + LoopBack Application using WebStorm?

I am using WebStorm v 9.0.3. I would like to create a Strongloop/Loopback Application + NodeJS Application. Is there a way to create it directly through WebStorm IDE or should we manually do it using commandline. Currently I can see only NodeJS Express App provision during project creation in WebStorm....

How to perform grunt remote debug in IntelliJ IDEA?

I build and run my typescript application by Grunt and connect(grunt-contrib-connect) and livereload plugins. While grunt compile .ts files, it also generate sourcemap. My application is oppening on google chrome. How can I remotely connect by Intellij Idea to this application that was run by Grunt and oppened in Chrome...

WebStorm Marking Files as Invalid when using Require

I' using the latest release version of webstorm (9.03) and most of my JavaScript files show up as invalid. I'm showing the code below. 'use strict'; function SpeakerDetailsController (speaker, CONFIG, $sce, $scope) { this.speaker = speaker; this.showSessions = CONFIG.showSessions === 'True'; $scope.someSafeContent = $sce.trustAsHtml("<i>Hello</i> <b>World!</b>"); } SpeakerDetailsController.$inject = ['speaker', 'CONFIG',...

How to get intellisense for Bootstrap 3?

I am using WebStorm 10 for OS X Yosemite and trying to get intellisense for bootstrap. I used this link but so far it has not worked out: http://blog.jetbrains.com/webstorm/2014/07/how-webstorm-works-completion-for-javascript-libraries/ Any ideas how to fix this?...

Webstorm localhost from mobile

I can't access my Webstrom localhost on port 63342 from mobile. I opened the port in Windows firewall and ESET (but port online checkers say me that the port still close). I checked option "Can accept external connections" in Webstorm (but it caused message that Built-in HTTP server on...

Angular parameter types on jsdoc

I'm wondering what are the "proper" parameter types on angular specified stuff within jsdoc? Eg. if I have something like: /** * Some comment * * @param {WhatHere} $http * @param {WhatHere} $timeout */ function FooBar($http, $timeout) { } What are the proper types for those $http and $timeout so...

IntelliJ/Webstorm not finding import reference

I have the following project structure: root src scripts main.js foo.js Inside of my main.js file, I'm importing foo.js like so: import 'src/scripts/foo.js' When I click on the import statement above and go to Navigate -> Declaration I get a super helpful message that says Cannot find declaration to go....

Yeoman generator code highlight for webstorm

I am creating yeoman generator and i came accross problem with code inspection in webstorm. Here is my code: module.exports = function(grunt) { grunt.initConfig({ // Process main less file to css file in build folder less: { <% if (includeBootstrap) { %> i get syntax error near <% and the...

Prevent webstorm watcher from running on checkout new branch

Add the moment my less and handlebar files get recompiled every time I check out another branch. Is there a way to run the watcher only when file was saved and not when it was changed in cause of checking out a branch.

How do I remove the “stripe marks” from navigation bar and project window?

I use a handlebars plugin to be used with requirejs in my project. This makes Webstorm report an error if I require a template using the plugin-specific syntax: var template = require('hbs!./sometemplate.hbs'); This is fine; I can easily control how the editor should present this error in my javascript file....

compass:dist & execFile(“compass.bat”, …) - Warning: spawn EPERM

First of all, I am pretty new to (modern) web development and I tried to import an existing project into my WebStorm and run a Grunt task. It stops at "compass:dist" with: $ node.exe C:\Users\lgr\AppData\Roaming\npm\node_modules\grunt-cli\bin\grunt --gruntfile C:\Users\lgr\workspace\js\rit-workshop\ui\Gruntfile.js buildall Initializing Command-line options: --gruntfile=C:\Users\lgr\workspace\js\rit-workshop\ui\Gruntfile.js, --verbose Reading "Gruntfile.js" Gruntfile...OK Registering Gruntfile tasks. Registering...

Webstorm special character encoding

Does Web storm automatically convert special characters to HTML entities ? I tried to find something on Internet,had no luck.

getter/setter on a module in TypeScript

I am using AMD modules (compiler flag "--module amd") in my TypeScript project. While I can easily use getters/setters on my classes I would like to do the same on my modules but export get abc() : string { return "abc"; } returns error TS1008: Unexpected token; 'module, class, interface,...

How to completely uninstall webstorm on ubuntu [closed]

I am trying to remove Webstorm editor completely from my Ubuntu 14.04, I have already tried by removing its installation folder but its settings still exists, is there any command exist to remove it completely or what any other way? please help me out?

How to make the generated HTML file auto-indent in WebStorm 10

I'm using WebStorm 10 with Jade. The generated HTML is not auto-indent, for e.g: index.jade: extends layout block content h1= title p Welcome to #{title} index.html <!DOCTYPE html><html><head><title></title><link rel="stylesheet" href="/stylesheets/style.css"></head><body><h1></h1><p>Welcome to </p></body></html> Is there a way to auto-indent the generated HTML ?...

WebStorm: Client and Server at same port

I am new in WebStorm. I have got a sample application that consist two projects: client(angularJs) and server (node.js). When I start server app.js (api that return json), it listening port 7200 Wnen start client (AngularJS app) index.html, it works on port 63342 But the api call from client to...

Using TypeScript type definitions with Webstorm 10 [duplicate]

This question already has an answer here: intellisense and code complete for DefinitelyTyped (TypeScript type definitions) on WebStorm IDE 2 answers I am trying to use Webstorm 10's new built-in TypeScript compiler. When compiling a simple Node.js file such as below, it gives a TS compilation error of "Error:(1,...

Visual Studio MVC and WebStorm working together and minimizing assets

I'm developing a SPA application in VS. I have separated html (angularjs) and webapi services. I develop html pages and css in WebStorm (which is perfect for the job) and VS for webapi (WebStorm and VS project folders are the same). Everything works fine but I want to minimize html...

Search file names that contain a string

I have a module named flume and file names that include that module name, like flumeIndexController, flumePlugin etc. Now I've decided to rename the module to oozie so I want to have these files renamed to include new module's name like oozieIndexController, ooziePlugin. How can I get a list of...

What exactly I should do to make 'angular' resolved in .ts file in WebStorm

I wonder.. what exactly I should do to make WebStrom (or IntelliJ IDEA) resolve my 'angular' variable. I follows this guy but that maybe deprecated already. On my vendor.d.ts: /// <reference path="../typings/jquery/jquery.d.ts" /> /// <reference path="../typings/angularjs/angular.d.ts" /> My package json: { "name": "angular_ts", "version": "0.1.0", "description": "", "repository": {}, "dependencies":...

Using chrome extension apis in typescript

I'm building a chrome extension written in TypeScript. I'm using WebStorm and I added the chrome-DefiniteltyTyped library in my project. However, when I write this in my typescript code : chrome.extension.getURL I got an error : cannot find name 'chrome'. Because of this, my javascript file is not generated and...

I just created an HTML 5 Boilerplate project in WebStorm. Is there a standard command for compiling the “dist” folder?

I'm getting started with WebStorm 9. I created an HTML 5 Boilerplate project and I noticed a src and a dist folder. Is there a standard command to compile the content of the src folder into the dist folder? This is how my project looks like: ...

How can I find obsolete “noinspection” annotations?

I just went through a project and resolved all code hints WebStorm provided. For most of these, that meant adding a noinspection comment, because either WebStorm was unable to understand the code, but the code is legit there is a bug in WebStorm I reported the bugs and am now...

Webstorm not ignoring directories marked “excluded”

I have marked the WebContent/desktop/build directory as excluded, but Webstorm is still trying to index it. This is annoying whenever I build, and I have to wait for Webstorm to finish indexing before I can do anything. How do I make it not index anything in the folder? Here's what...

Intellij - Hide file paths from Favorites window

I organized my project files in the Favourites window according to the programming language e.g. python, javascript etc. However, the path to each file takes a lot of space and requires you to horizontaly scroll the window. Is there a way to hide path from the Favourites, so only file...

How to Debug Ionic WebApp?

I want to debug my ionic application in WebStorm. I am able to run the app in browser. But how can I debug? I tried: ionic serve --debug which doesn't seem to trigger any debugging? How can I debug the app when it runs in browser?...

Make Webstorm highlight .txt files as HTML

So I have some project files all with .txt extensions which are really HTML templates. I am trying to syntax highlight those .txt files as HTML using Webstorm. Any tips on how to do that?

Error: Unexpected request: POST Karma-jasmine-angular

the actual scenario is like when I am trying to test my angular js controller and service together in which first I call a get ajax request and on its success I call a user service which also contains a post ajax request. When I run test I got the...

Stylesheets not showing up for Ionic App

I've built a small Ionic App in WebStorm using a simple tutorial for building a side-menu. It runs and everything when I bring it up in an emulator using Cordova, but none of the styling from Ionic seems to be working, even though it all appears to be part of...

Unresolved property variable when returned from method

... doChunk().then(function (results) { angular.forEach(results, function (info) { if (info.data.fields.worklog) { configProcess.results.push(info.data); ... The above is just a sample from my AngularJS application, but it's the same issue for all data (and vanilla JS) that's returned from somewhere else - like an HTTP request in this case. results - is...

WebStorm after reformat code - what is this?

This is my HTML structure: <ul class="list-unstyled"> <li><a href="#">Superga</a></li> <li><a href="#">Nike</a></li> <li><a href="#">New Balance</a></li> <li><a href="#">Birkenstock</a></li> <li><a href="#">Havaianas</a></li> <li><a href="#">Punto</a></li> <li><a href="#">Marjin</a></li> <li><a href="#">Puma</a></li>...

Group files in Webstorm / IntelllijIDEA

Is it possible to group related items in Webstorm same way as in Visual Studio (Group files in Visual Studio)?

Braces placement in object definition in PhpStorm

Is there any way to make PhpStorm place curly brackets on new line in this situation? var test = { '*': { // something } } instead of making this (after reformatting): var test = { '*': { // something } } ...

I get an error — Error: [$injector:nomod] http://errors.angularjs.org/1.3.15/$injector/nomod?p0=decisionTree when I run karma.cong.js in Webstorm

Here is my karma.conf.js file module.exports = function(config) { var configuration = { basePath : '', autoWatch : false, frameworks: ['jasmine'], files: [ 'bower_components/angular/angular.min.js', 'bower_components/angular-mocks/angular-mocks.js', 'bower_components/angular-resource/angular-resource.min.js', 'bower_components/angular-animate/angular-animate.min.js', 'bower_components/angular-bootstrap/ui-bootstrap-tpls.min.js', 'bower_components/angular-cookies/angular-cookies.min.js',...

Is it possible to hide JavaScript framework call stacks when debugging, only step over application JavaScript code

I'm fairly new to JavaScript, but got assigned working on a front-end project written in a mvc frontend framework, every time when I try to debug the code base to better understand the application logic, I got suck in to the framework code, for now, I dont really wanna dig...

Browserify paths and Webstorm configuration

I build my project with gulp and use browserify. To make path resolution easier i configurated browserify var b = browserify('./app', {paths: ['./node_modules','./src/js']}); The problem is that WebStorm IDE don't know about this and doesn't help me with intellisense when i require files. For example intellisense does't work on the...

Show `.map` files under their respectives files in WebStorm/IntelliJ

Using Filewatchers it's possible to show a generated file under it's respective source file: The problem I am having is that only the generated .jsfile is 'watched' and grouped whilst the .map file still shows up separately. Is there a way to set it up so that both files are...

How to use WebStorm JavaScript Debug configuration without Google Chrome?

I have FF (v.35), Opera (v.12), and IE (v.11) installed on my Win 7 x64 PC and wanted to debug a (locally stored) HTML file that loads a JS script. After adding the file to a new project, I went to File > Settings > Tools > Web Browsers and...

Confusion of WebStorm type recognition of function return types

Using the following code: /** * @typedef {foo} MyFoo * @property {String} fooText * @property {Number} fooValue */ /** * @type {MyFoo} */ var foo = { fooText : '', fooValue : 0 }; /** * @param {MyFoo} someFoo * @returns {MyFoo} */ function doStuff(someFoo) { var result = Object.create(foo);...

Webstorm: Ctrl + Arrow not working. How to fix?

I downloaded Webstorm 10.0.2 and noticed that when I pressing Ctrl+Left/Right it selects char as Shift+Left/Right but not jumps over word. And at Keymap Settings when I'm trying to add shortcut and pressing Ctrl+Left/Right it doesn't show this shortcut, but Ctrl+Any other works normally. Also, at PhpStorm 7.1.3 Ctrl+Left/Right works...

[WebStorm]: Change Debugging WebServer Project Root

Since recently, I've been using JetBrains WebStorm and I absolutely love it, but I do have an issue, and after hours of searching here and in the documentation, I decided to open my own question because I just don't find it. I do have a project which is stored on...

Update multiple vendor prefix styles in webstorm

In Webstorm 10, you can insert all vendor prefix styles using built in emmet. For instance, you type in -border-radius followed by the TAB key, it will automatically create the vendor specific styles for you. Then you can type in eg. 10px and it will apply the style to all...

WebStorm: Disabling language injection coloring

WebStorm is injecting the css coloring rules in my JavaScript. For example in the following code block... $('.navbar-collapse ul li a').click(function() { $('.navbar-toggle:visible').click(); }); Everything inside '.navbar-collapse ul li a' is colored according to the css color rules. I would like this to be colored like a normal javascript string....

How do I configure Webstorm 10 to run npm install --force before debugging?

I have a shared submodule that requires me to run "npm install --force" before I can run webstorm and debug the application. I would really like to edit my debug configuration to have a before launch action that will run the npm command for me. Can this be done?

node does not output using console log

I fairly new to nodejs and I put the following code in some module, module.exports = function (app) { app.get('/aa', function(req, res) { console.log("test"); debugger; res.send('file updated'); ... the application is working and I see in the browser "file updated" but I've two problems: why don't I see "test" in...

Refactor angular module name in Webstorm

Is there a possibility or trick to rename an angular module in Webstorm with refactoring in the whole project? 'Cause when I have something like this angular.module('my-module', []); and my caret is on the 'my-module' string, I cannot refactor the module name. Is there an appropriate place (or plugin) to...

What is the type of an object literal key as defined in TypeScript?

I'm not using TypeScript as the primary language for this application, but as the type-hinting assist for JetBrains' WebStorm alongside JSDocs. I'm also using the keyMirror utility to create quasi-enum object literals. Given the following: //enums.js var keyMirror = require('keyMirror'); module.exports = { CRUDVerbs: keyMirror({ //keymirror mirrors the key to...

Custom syntax highlighting for content of