@@ -45,29 +45,44 @@ local function bootls_cmd(rt_dir, java_cmd)
4545 vim .notify (" Spring Boot LS is not installed" , vim .log .levels .WARN )
4646 return
4747 end
48- local boot_classpath = {}
49- table.insert (boot_classpath , boot_path .. " /BOOT-INF/classes" )
50- table.insert (boot_classpath , boot_path .. " /BOOT-INF/lib/*" )
48+ if config .exploded_ls_jar_data then
49+ local boot_classpath = {}
50+ table.insert (boot_classpath , boot_path .. " /BOOT-INF/classes" )
51+ table.insert (boot_classpath , boot_path .. " /BOOT-INF/lib/*" )
5152
52- local cmd = {
53- java_cmd or util .java_bin (),
54- " -XX:TieredStopAtLevel=1" ,
55- " -Xmx1G" ,
56- " -XX:+UseZGC" ,
57- " -cp" ,
58- table.concat (boot_classpath , util .is_win and " ;" or " :" ),
59- " -Dsts.lsp.client=vscode" ,
60- " -Dsts.log.file=" .. logfile (rt_dir ),
61- " -Dspring.config.location=file:" .. boot_path .. " /BOOT-INF/classes/application.properties" ,
62- -- "-Dlogging.level.org.springframework=DEBUG",
63- " org.springframework.ide.vscode.boot.app.BootLanguageServerBootApp" ,
64- }
65-
66- return cmd
53+ local cmd = {
54+ java_cmd or util .java_bin (),
55+ " -XX:TieredStopAtLevel=1" ,
56+ " -Xmx1G" ,
57+ " -XX:+UseZGC" ,
58+ " -cp" ,
59+ table.concat (boot_classpath , util .is_win and " ;" or " :" ),
60+ " -Dsts.lsp.client=vscode" ,
61+ " -Dsts.log.file=" .. logfile (rt_dir ),
62+ " -Dspring.config.location=file:" .. boot_path .. " /BOOT-INF/classes/application.properties" ,
63+ -- "-Dlogging.level.org.springframework=DEBUG",
64+ " org.springframework.ide.vscode.boot.app.BootLanguageServerBootApp" ,
65+ }
66+ return cmd
67+ else
68+ local server_jar = vim .split (vim .fn .glob (boot_path .. " /spring-boot-language-server*.jar" ), " \n " )
69+ if # server_jar == 0 then
70+ vim .notify (" Spring Boot LS jar not found" , vim .log .levels .WARN )
71+ return
72+ end
73+ local cmd = {
74+ java_cmd or util .java_bin (),
75+ " -XX:TieredStopAtLevel=1" ,
76+ " -Xmx1G" ,
77+ " -XX:+UseZGC" ,
78+ " -jar" ,
79+ server_jar [1 ],
80+ }
81+ return cmd
82+ end
6783end
6884
6985local ls_config = {
70- -- cmd = bootls_cmd(),
7186 name = " spring-boot" ,
7287 filetypes = { " java" , " yaml" , " jproperties" },
7388 -- root_dir = root_dir,
0 commit comments