mfussenegger / nvim-jdtls

Extensions for the built-in LSP support in Neovim for eclipse.jdt.ls
GNU General Public License v3.0
1k stars 62 forks source link

Snippet completion for `sout` is not as expected #520

Closed conscious-puppet closed 1 year ago

conscious-puppet commented 1 year ago

LSP client configuration

local config = { cmd = {"jdt-language-server", "-data", workspace_dir}, capabilities = capabilities, root_dir = root_dir,

-- Here you can configure eclipse.jdt.ls specific settings -- See https://github.com/eclipse/eclipse.jdt.ls/wiki/Running-the-JAVA-LS-server-from-the-command-line#initialize-request -- or https://github.com/redhat-developer/vscode-java#supported-vs-code-settings -- for a list of options settings = { java = { eclipse = { downloadSources = true, }, maven = { downloadSources = true, }, implementationsCodeLens = { enabled = false, }, referencesCodeLens = { enabled = false, }, references = { includeDecompiledSources = true, }, inlayHints = { parameterNames = { enabled = "all", -- literals, all, none }, }, }, signatureHelp = { enabled = true }, completion = { enabled = true, -- overwrite = true, favoriteStaticMembers = { "org.hamcrest.MatcherAssert.assertThat", "org.hamcrest.Matchers.", "org.hamcrest.CoreMatchers.", "org.junit.jupiter.api.Assertions.", "java.util.Objects.requireNonNull", "java.util.Objects.requireNonNullElse", "org.mockito.Mockito.", }, }, contentProvider = { preferred = "fernflower" }, extendedClientCapabilities = extendedClientCapabilities, sources = { organizeImports = { starThreshold = 9999, staticStarThreshold = 9999, }, }, codeGeneration = { toString = { template = "${object.className}{${member.name()}=${member.value}, ${otherMembers}}", }, useBlocks = true, }, },

flags = { allow_incremental_sync = true, },

init_options = { bundles = {}, }, handlers = { ['language/status'] = function() end,
}, }

Eclipse.jdt.ls version

1.21.0

Steps to Reproduce

Snippet completion for sout java_snippet

Expected Result

it should replace the prefix with System.out.println()

Actual Result

the prefix does not get replaced and instead i get soSystem.out.println()

mfussenegger commented 1 year ago

This is an issue with your completion/snippet plugin, not nvim-jdtls