lsp-lens.nvim 项目教程

lsp-lens.nvim 项目教程

lsp-lens.nvimNeovim plugin for displaying references and difinition infos upon functions like JB's IDEA.项目地址:https://gitcode.com/gh_mirrors/ls/lsp-lens.nvim

1. 项目的目录结构及介绍

lsp-lens.nvim/
├── LICENSE
├── README.md
├── lua/
│   └── lsp-lens/
│       ├── init.lua
│       └── ...
├── github/
│   └── workflows/
│       └── ...
├── stylua.toml
└── ...
  • LICENSE: 项目的许可证文件。
  • README.md: 项目的介绍和使用说明。
  • lua/lsp-lens/: 包含项目的主要代码文件。
    • init.lua: 项目的入口文件。
  • github/workflows/: 包含GitHub Actions的工作流配置文件。
  • stylua.toml: 代码格式化工具StyLua的配置文件。

2. 项目的启动文件介绍

项目的启动文件是 lua/lsp-lens/init.lua。这个文件负责初始化和配置lsp-lens插件。以下是启动文件的主要内容:

require'lsp-lens'.setup({
  enable = true,
  include_declaration = false,
  sections = {
    definition = false,
    references = true,
    implements = true,
    git_authors = true
  },
  ignore_filetype = { "prisma" },
  target_symbol_kinds = {
    SymbolKind.Function,
    SymbolKind.Method,
    SymbolKind.Interface
  },
  wrapper_symbol_kinds = {
    SymbolKind.Class,
    SymbolKind.Struct
  }
})

3. 项目的配置文件介绍

项目的配置文件主要是 lua/lsp-lens/init.lua 中的 setup 函数。以下是默认配置的介绍:

require'lsp-lens'.setup({
  enable = true,
  include_declaration = false,
  sections = {
    definition = function(count) return "Definitions: " .. count end,
    references = function(count) return "References: " .. count end,
    implements = function(count) return "Implements: " .. count end,
    git_authors = function(latest_author, count)
      return " " .. latest_author .. (count - 1 == 0 and "" or (" + " .. count - 1))
    end
  },
  ignore_filetype = { "prisma" },
  target_symbol_kinds = {
    SymbolKind.Function,
    SymbolKind.Method,
    SymbolKind.Interface
  },
  wrapper_symbol_kinds = {
    SymbolKind.Class,
    SymbolKind.Struct
  }
})
  • enable: 是否启用插件。
  • include_declaration: 是否包含声明。
  • sections: 定义各个部分的显示格式。
  • ignore_filetype: 忽略的文件类型。
  • target_symbol_kinds: 目标符号类型。
  • wrapper_symbol_kinds: 包装符号类型。

lsp-lens.nvimNeovim plugin for displaying references and difinition infos upon functions like JB's IDEA.项目地址:https://gitcode.com/gh_mirrors/ls/lsp-lens.nvim

  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

洪新龙

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值