【问题标题】:Auto Import on Vim Coc-tsserver using Next.js使用 Next.js 在 Vim Coc-tsserver 上自动导入
【发布时间】:2021-07-24 21:16:58
【问题描述】:

我在 Neovim 上使用 coc-tsserver 来使用 Next.js 进行编程,但自动导入功能不起作用。当我尝试使用 Next 模块时,例如 <Link> 标记,它可以正确识别 "import Link from 'next/link'",但在缺少导入行时无法找到该模块。我已经尝试将 tsserver 配置为使用外部 Eslint 包,但它仍然无法正常工作(即使未指定 yarn Eslint 包也无法找到下一个模块)。 如何在 Eslint/coc-tsserver 上自动导入 Next.js 模块?

【问题讨论】:

    标签: vim next.js eslint neovim typescript-eslint


    【解决方案1】:

    来自 tsserver 文档 https://github.com/neoclide/coc-tsserver

    您可能需要将以下代码添加到您的 coc-config 中

    "javascript.suggest.autoImports": true, 
    "typescript.suggest.autoImports": true
    

    :CocConfig

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-12-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-07-27
      • 1970-01-01
      • 2019-03-27
      • 1970-01-01
      相关资源
      最近更新 更多