将 intellisense 从 Visual Studio 2015 迁移到 VSCode

Migrating intellisense from Visual Studio 2015 to VSCode

嗨,

在 VS2015 中,通过使用点缀在项目中的 intellisense.js 参考文件,我获得了出色的智能感知支持。这些与 JsDoc 符号相结合确保我所有的非库代码都具有智能感知支持。

/// <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" />

在 VSCode 中,这些文件基本上被忽略,导致智能感知非常差。它似乎更喜欢 TypeScript 定义,这不是我之前真正研究过的东西,并且可能会消耗大量时间来 create/generate 代码库中的每个文件(大项目!)

有没有办法 force/coax VSCode 使用已经设置好的 intellisense.js 文件?

尝试在项目的根目录下创建一个 jsconfig.json 文件,内容如下:

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

此文件应确保您工作区中的所有 js 文件(包括 intellisense.js)都被选取并包含在同一个 JavaScript 项目中。

将来,我还建议您尝试从使用 reference 路径文件迁移到使用 jsconfig 来定义项目结构