TL DR : how do you include the tsconfig.json file in Visual Studio 2017 and you still run intellisense JavaScript, how is it done by default, giving code hints for both your own code and 3-party libraries? Is it borked, or do I just need to better understand how it works?
Like jQuery, I would like universal access to my own JavaScript namespaces in JavaScript and html files using intellisense. How to achieve this?
EDIT 3 :
I reported this issue at developercommunity.visualstudio.com . Please consider voting to get more attention from Microsoft.
EDIT 2 :
The βsolutionβ for now is Resharper, which provides what you would expect right out of the box. But it is not perfect at a price of $ 299 / year / user for something in the Visual Studio market that it provides itself.
EDIT 1:
In case my JavaScript intellisense expectations in Visual Studio are inaccurate, below is a contrived example of how I expect it to work.
Let's say I create three TypeScript files in my folder. / Scripts, we will call them A.ts, B.ts and C.ts. Each of them will contain its own namespace:
A.ts
namespace A {
export function f1(s: string) {
return s;
}
}
B.ts
namespace B {
export function f1(n: number) {
return n;
}
}
C.ts
namespace C {
export function f1(b: boolean) {
return b;
}
}
, intellisense , , A.ts, B.ts C.ts intellisense . .
, , /Home/Index.cshtml. Index.cshtml A, B C. ..js , , TypeScript Declaration (.d.ts).
, tsconfig.json , . .ts , .d.ts . /Scripts/out. intellisense Index.cshtml .js?... .
, , Visual Studio intellisense ( ). . Intellisense? . JQuery intellisense? , , , ?.....? , intellisense , , :
- intellisense A C3.js(: JavaScript), . ?
, , Intellisense. Visual Studio ...
... intellisense A. !?
. , import .js , intellisense /. !
Index.cshtml intellisense .
, .js , intellisense Index.cshtml. ?? JavaScript, intellisense :
, ,... :
back-and-forth, - , Visual Studio JavaScript intellisense. , .
Windows 10
VS2017 15.0.0 + 26228.10
JavaScript
, Visual Studio 2017 JavaScript intellisense . , - IDE .
, VS2017 JS intellisense, TypeScript .d.ts. , intellisense, TypeScript/JavaScript, , .
ASP.NET MVC 4.5.2, JS intellisense , , ($) .js <script> , intellisense jQuery. . , TypeScript (.ts) TypeScript , .d.ts , intellisense , tsconfig.json , .
tsconfig.json JS intellisense . ($) .js <script> , zero intellisense jQuery. , , :
. , tsconfig.json , , ).
" " " , JavaScript ... IntelliSense". , intellisense , tsconfig.json, , . , .
tsconfig, enableAutoDiscovery, " , ". , , , , Salsa intellisense. tsconfig.json ... ; JS intellisense.
, typingOptions.enableAutoDiscovery typeAcquisition.enable. Grrrrr. , tsconfig.json aaaaaaand... JS intellisense.
.d.ts , Visual Studio intellisense ( ...), intellisense , jQuery, .
tsconfig.json:
{
"compilerOptions": {
"noEmitOnError": true,
"noImplicitAny": false,
"removeComments": false,
"target": "es5",
"declaration": true,
"declarationDir": "./Scripts/out"
},
"compileOnSave": true,
"typeAcquisition": {
"enable": true,
"include": ["jquery"]
},
"include": [
"./Scripts/app/**/*"
],
"exclude": [
"./Scripts/vendors/**/*",
"./Scripts/out/**/*"
]
}
TypeScript , .tts , jQuery % LOCALAPPDATA%\Microsoft\TypeScript\node_modules\@types.
, intellisense .ts ( , , ; jQuery ). ... . jQuery intellisense.
, jQuery, jQuery intellisense
... . , , ; , Visual Studio intellisense , , intellisense , .