Get VS javascript intellisense for js in a different file

前端 未结 2 1841
误落风尘
误落风尘 2021-01-30 13:38

So I\'ve defined my \'enum\' at the top of my javascript file as so:

var loaderOptions = { \"SHOW\": 0,
    \"CHANGEPAGE\": 1,
    \"HIDE\": 2
};
2条回答
  •  孤城傲影
    2021-01-30 14:20

    Mads Kristensen's blog post on the _references.js file shows a more recent way of handling this than the one epascarello mentions in his answer. Here's a quote from Mads's post:

    Enter _references.js.

    This file must (by default) be located in a folder at the root called /scripts/. That's the naming convention. Any file located at /scripts/_references.js is automatically added to global Intellisense. This is now the only file we need for triple-slash references. Here's what the contents of this file may look like:

    ///  
    ///  
    ///  
    /// 
    

    Just a bunch of references. This is also the only file that is included in Intellisense by default at all times.

提交回复
热议问题