Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Neovim + Spring Boot LS

License

NotificationsYou must be signed in to change notification settings

JavaHello/spring-boot.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

English

Spring Boot Nvim

参考VScode Spring Boot 插件, 将它的部分功能集成到Neovim 中。

  • 查找使用了Spring 注解的Bean
  • 查找 Web Endpoints。
  • application.properties,application.yml 文件补全提示, 以及跳转。
  • Spring 注解依赖提示补全。
  • Code Action

安装

  • lazy.nvim
    -- 使用 `autocmd` 方式启动(默认)-- 默认使用 mason 或 ~/.vscode/extensions/vmware.vscode-spring-boot-x.xx.x 中的 jar{"JavaHello/spring-boot.nvim",ft= {"java","yaml","jproperties"},dependencies= {"mfussenegger/nvim-jdtls",-- or nvim-java, nvim-lspconfig"ibhagwan/fzf-lua",-- 可选,用于符号选择等UI功能。也可以使用其他选择器(例如 telescope.nvim)。  },---@typebootls.Configopts= {}},
  • Visual Studio Code 中安装VScode Spring Boot(可选的)

jdtls 配置

选项 1: 使用nvim-jdtls

详细配置参考nvim-jdtls项目

localjdtls_config= {bundles= {}}-- 添加 spring-boot jdtls 扩展 jar 包vim.list_extend(jdtls_config.bundles,require("spring_boot").java_extensions())

选项 2: 使用nvim-lspconfig

-- 添加全局命令处理器require('spring_boot').init_lsp_commands()-- 添加 spring-boot jdtls 扩展 jar 包require("lspconfig").jdtls.setup {init_options= {bundles=require("spring_boot").java_extensions(),  },}

使用

  • 查找使用了Spring 注解的Bean。此功能利用 LSP 工作区符号。您可以使用您偏好的、支持显示 LSP 工作区符号的模糊查找器。例如:
    • 如果您正在使用fzf-lua
      :FzfLua lsp_live_workspace_symbols
    • 如果您正在使用telescope.nvim
      :lua require'telescope.builtin'.lsp_workspace_symbols{}
    (注意:具体命令可能因您选择的选取器及其配置而异。请确保您的选取器已配置为处理 LSP 符号。)lsp_live_workspace_symbols

About

Neovim + Spring Boot LS

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

    Packages

    No packages published

    Languages


    [8]ページ先頭

    ©2009-2025 Movatter.jp