Matthias
Matthias

Reputation: 1436

Intellisense and JsHint support for Ext Js in VisualStudio

I want to work with Senach Ext Js in a Website project in VisualStudio 2013.

The problem: VisualStudio respectively WebEssentials throws warnings like:

JsHint (W117): 'Ext' is not defined.

Here is the situation as it looks today:

enter image description here

The project is exactly what Sencha Cmd produced for me. At the moment I want only a Website project and no server sided code involved (therefore I did not make a MVC or Web API project).

I know that there is a way to define some global symbols in each JavaScript file for JsHint, but I want to get the intellisense working too. So I am looking for the correct configuration for both use cases: WebEssential JSHint Warnings and Intellisense.

Maybe both problems need to be addressed separately. That would be fine too.

  1. Is my directory structure correct (just took what Sencha Cmd built for me)?
  2. How to address the problem to make intellisense working?
  3. (How to avoid Webessential JavaScript warnings (it seems most or all of them are JsHint)?)

Update: Related question:

Enabling JSHint Support for Ext.js in Intellij Idea

Update:

"An _references.js file in any other location than “~/Scripts/_references.js” will be just like any other JS file and won’t be used for global intellisense. Even putting the file in the root of your web project will not work as well."

Source: http://gurustop.net/blog/2012/03/03/javascript-js-intellisense-auto_complete-in-visual-studio-11-beta-the-web-_references-js-file/

still not working when I have the _references in a new "Script" folder:

intellisense error

Upvotes: 1

Views: 1253

Answers (1)

Colin Ramsay
Colin Ramsay

Reputation: 16476

So it seems like the final answer was to add a file called ~/scripts/_reference.js and then include a line to reference Ext JS in there. This enables Visual Studio to index the Ext JS source for Intellisense. For example:

/// <reference path="../ext/ext-all-debug-full.js" />

More on the Intellisense and _reference.js:

http://msdn.microsoft.com/en-us/library/bb385682.aspx

Note that due to the size of the Ext JS codebase, Visual Studio might take a few minutes to complete the indexing process and for Intellisense to start working smoothly.

Upvotes: 1

Related Questions