简体   繁体   中英

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. These combined with JsDoc notation ensured that all my non-library code had intellisense support.

在此输入图像描述

/// <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. 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!)

Is there a way to force/coax VSCode into using the already set-up intellisense.js files?

Try creating a jsconfig.json file at the root of your project with the contents:

{
    "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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM