微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

vscode emmet 不自动提示

如何解决vscode emmet 不自动提示

我所有的其他项目都可以工作,但我无法弄清楚这个 vanilla 示例与其他包含大量 npm 包的示例有什么不同。

进入时不会自动提示

export type THello = string;
export interface Props {
  hello: string
}
const myvar: Pro // <- expect to see autosuggest happen here...

package.json

{
  "name": "ts","version": "0.0.1","private": true,"license": "ISC","dependencies": {
    "ts-node": "^9.1.1","tslib": "^2.1.0","typescript": "^4.1.2"
  },"devDependencies": {
    "typescript-tslint-plugin": "^1.0.1"
  }
}

tsconfig.json

{
  "compileOnSave": false,"compilerOptions": {
    "baseUrl": "./","module": "commonjs","lib": [
      "es2018","es2015","es5","es6","dom","esnext.asynciterable"
    ],"esModuleInterop": true,"allowSyntheticDefaultImports": true,"plugins": [
      {
        "name": "typescript-tslint-plugin"
      }
    ],"outDir": "./dist/out-tsc","sourceMap": true,"pretty": true,"downlevelIteration": true,"experimentalDecorators": true,"moduleResolution": "node","importHelpers": true,"paths": {
      "src/*": [
        "src/*"
      ],},"watch": true,"strict": true,"allowJs": true,// problem with visual studio code import module resolutions if file does not sit inside src/
    "target": "es5","forceConsistentCasingInFileNames": true
  },"include": [
    "src/**/*"
  ]
}

index.ts

export type THello = string;
export interface Props {
  hello: string
}

解决方法

您是否相信是这一行使我的 vscode emmet 无法正常工作

babel.config.js

console.log(1); // <- this console log is breaking vscode emmet auto suggest.
module.exports = {
  presets: ['next/babel']
};

查看创建的 repo 来演示问题 https://github.com/inspiraller/vscode-emmet

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。