You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lua/jdtls/dap.lua
+30Lines changed: 30 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -657,6 +657,10 @@ function M.setup_dap_main_class_configs(opts)
657
657
print('nvim-dap is not available')
658
658
return
659
659
end
660
+
ifdap.providersanddap.providers.configsthen
661
+
-- If users call this manually disable the automatic discovery on dap.continue()
662
+
dap.providers.configs["jdtls"] =nil
663
+
end
660
664
ifopts.verbosethen
661
665
vim.notify('Fetching debug configurations')
662
666
end
@@ -711,6 +715,32 @@ function M.setup_dap(opts)
711
715
end
712
716
end
713
717
dap.adapters.java=start_debug_adapter
718
+
719
+
ifdap.providersanddap.providers.configsthen
720
+
dap.providers.configs["jdtls"] =function (bufnr)
721
+
ifvim.bo[bufnr].filetype~="java" then
722
+
return {}
723
+
end
724
+
localco=coroutine.running()
725
+
localresumed=false
726
+
vim.defer_fn(function()
727
+
ifnotresumedthen
728
+
resumed=true
729
+
coroutine.resume(co, {})
730
+
vim.schedule(function()
731
+
vim.notify("Discovering main classes took too long", vim.log.levels.INFO)
732
+
end)
733
+
end
734
+
end, 2000)
735
+
M.fetch_main_configs(nil, function(configs)
736
+
ifnotresumedthen
737
+
resumed=true
738
+
coroutine.resume(co, configs)
739
+
end
740
+
end)
741
+
returncoroutine.yield()
742
+
end
743
+
end
714
744
end
715
745
---@classJdtSetupDapOpts
716
746
---@fieldconfig_overridesJdtDapConfig These will be used as default overrides for |jdtls.dap.test_class|, |jdtls.dap.test_nearest_method| and discovered main classes
0 commit comments