Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: java-debug-adapter, java-test #482

Merged
merged 4 commits into from
Sep 30, 2022
Merged

feat: java-debug-adapter, java-test #482

merged 4 commits into from
Sep 30, 2022

Conversation

lvimuser
Copy link
Contributor

@lvimuser lvimuser commented Sep 29, 2022

closes #433

I've opted for using the prebuilt files extracted from .vsix because maven takes a while to build.

Not sure if we should link java-test or not, since it's more like a 'lib' than an executable (should it still be in the DAP category?).

usage with nvim-jdtls#java-debug / nvim-jdtls#vscode-java-test:

local function get_install_path(package_name)
  return require("mason-registry").get_package(package_name):get_install_path()
end

local bundles = {
  vim.fn.glob(
    -- or
    -- get_install_path("java-debug-adapter") .. "extension/server/com.microsoft.java.debug.plugin-*",
    vim.fn.stdpath "data"
      .. "/mason/packages/java-debug-adapter/extension/server/com.microsoft.java.debug.plugin-*.jar",
    true
  ),
}

vim.list_extend(
  bundles,
  vim.split(
    vim.fn.glob(
      -- or
      -- get_install_path("java-test") .. "extension/server/*.jar",
      vim.fn.stdpath "data" .. "/mason/packages/java-test/extension/server/*.jar",
      true
    ),
    "\n"
  )
  
-- if not filtered, raises the following error
--[[
  Failed to load extension bundles
  Failed to get bundleInfo for bundle from com.microsoft.java.test.runner-jar-with-dependencies.jar
]]
bundles = vim.tbl_filter(function(s)
  return not vim.endswith(s, "com.microsoft.java.test.runner-jar-with-dependencies.jar")
end, bundles) or {}

@lvimuser lvimuser marked this pull request as ready for review September 29, 2022 11:03
Copy link
Owner

@williamboman williamboman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coo! few comments

lua/mason-registry/java-debug-adapter/init.lua Outdated Show resolved Hide resolved
lua/mason-registry/java-test/init.lua Outdated Show resolved Hide resolved
lua/mason-registry/java-test/init.lua Outdated Show resolved Hide resolved
lua/mason-registry/java-debug-adapter/init.lua Outdated Show resolved Hide resolved
lua/mason-registry/java-debug-adapter/init.lua Outdated Show resolved Hide resolved
@williamboman

This comment has been minimized.

Copy link
Owner

@williamboman williamboman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! I added some to the description of java-test (removed specific mention of nvim-jdtls). I also removed the _.gsub("^v", "") as it's not needed

@williamboman williamboman merged commit ac0bbad into williamboman:main Sep 30, 2022
@lvimuser
Copy link
Contributor Author

Thanks!

This was referenced Apr 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[New package]: java-debug
3 participants