简体   繁体   English

将intellisense从Visual Studio 2015迁移到VSCode

[英]Migrating intellisense from Visual Studio 2015 to VSCode

Hi, 嗨,

In VS2015 I had excellent intellisense support through the use of intellisense.js reference files dotted through out the project. 在VS2015中,我通过使用遍布项目的intellisense.js参考文件获得了极好的智能感知支持。 These combined with JsDoc notation ensured that all my non-library code had intellisense support. 这些结合JsDoc表示法确保我的所有非库代码都具有intellisense支持。

在此输入图像描述

/// <reference path="hudtimer.js" />
/// <reference path="intellisense.js" />
/// <reference path="menulayergametimers.js" />
/// <reference path="menulayerstreakidentifier.js" />
/// <reference path="streakidentifier.js" />
/// <reference path="menulayerpop.js" />
/// <reference path="popentity.js" />
/// <reference path="popentityfactory.js" />
/// <reference path="popactions.js" />
/// <reference path="menulayerpophud.js" />
/// <reference path="popquestion.js" />
/// <reference path="popcharacter.js" />
/// <reference path="popvfxmanager.js" />

In VSCode, these files are essentially ignored which results in very poor intellisense. 在VSCode中,这些文件基本上被忽略,导致智能感知非常差。 It seems to prefer TypeScript definitions, which is not something I've really looked into before and could potentially consume an enormous amount of time to create/generate for each file in the code base (big project!) 它似乎更喜欢TypeScript定义,这不是我以前真正研究的东西,可能会花费大量时间为代码库中的每个文件创建/生成(大项目!)

Is there a way to force/coax VSCode into using the already set-up intellisense.js files? 有没有办法强制/哄VSCode使用已设置的intellisense.js文件?

Try creating a jsconfig.json file at the root of your project with the contents: 尝试使用以下内容在项目的根目录下创建jsconfig.json文件:

{
    "compilerOptions": {
        "target": "ES6"
    },
    "exclude": [
        "node_modules",
        "**/node_modules/*"
    ]
}

This file should ensure that all js file in your workspace—including intellisense.js —are picked up and included in the same JavaScript project. 此文件应确保工作区中的所有js文件(包括intellisense.js )都被选中并包含在同一个JavaScript项目中。

In the future, I also recommend you try to migrate away from using a reference paths file to using the jsconfig to define your project structure 将来,我还建议您尝试从使用reference路径文件迁移到使用jsconfig定义项目结构

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Visual Studio 2015中的AngularJS Intellisense - AngularJS Intellisense in Visual Studio 2015 Visual Studio 2015 JavaScript Intellisense奇怪的行为 - Visual Studio 2015 JavaScript Intellisense strange behaviour Visual Studio 2015中的JavaScript函数参数Intellisense - JavaScript Function Parameter Intellisense in Visual Studio 2015 jQuery UI 打破了 Visual Studio 2015 Intellisense - jQuery UI breaks Visual Studio 2015 Intellisense JavaScript Intellisense在Visual Studio 2015中不起作用 - JavaScript Intellisense is not working in Visual Studio 2015 如何在Visual Studio 2015中为Node.js启用智能感知? - How to enable intellisense for nodejs in visual studio 2015? 如何使用 javascript 中的 vscode (visual studio) 通过智能感知从一个文件访问定义的函数到另一个文件? - How to access functions defined from one file to other via intellisense with vscode (visual studio) in javascript? 在Visual Studio 2015中获取用于JavaScript函数表达式的智能感知 - Getting intellisense working in Visual Studio 2015 for javascript function expressions 在Visual Studio 2013-2015中创建requireJS intellisense - Make requireJS intellisense in Visual Studio 2013-2015 Visual Studio 2015 Update 3中无法使用外部库的JavaScript IntelliSense - JavaScript IntelliSense for external library is not working in Visual Studio 2015 Update 3
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM