java: make lombok integration optional and don't hardcode my user name. Still want to find an optimal way for selecting the best version of lombok available, or maybe downloading it if not present.
This commit is contained in:
parent
cfea3b5f11
commit
592bd8c628
16
java
16
java
@ -16,14 +16,18 @@ def locate_launcher_configuration (jdt_ls_path):
|
||||
|
||||
# TODO
|
||||
def locate_lombok ():
|
||||
return "/home/malacoda/.m2/repository/org/projectlombok/lombok/1.18.16/lombok-1.18.16.jar"
|
||||
return os.path.join(os.environ['HOME'], ".m2/repository/org/projectlombok/lombok/1.18.16/lombok-1.18.16.jar")
|
||||
|
||||
class Java(LspServer):
|
||||
def __init__ (self, arguments):
|
||||
self.path = arguments[0]
|
||||
super().__init__([
|
||||
"java",
|
||||
f"-javaagent:{locate_lombok()}",
|
||||
|
||||
command = ["java"]
|
||||
if "--enable-lombok" in arguments:
|
||||
arguments.remove("--enable-lombok")
|
||||
command.append(f"-javaagent:{locate_lombok()}")
|
||||
|
||||
command = command + [
|
||||
"-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=1044",
|
||||
"-Declipse.application=org.eclipse.jdt.ls.core.id1",
|
||||
"-Dosgi.bundles.defaultStartLevel=4",
|
||||
@ -36,7 +40,9 @@ class Java(LspServer):
|
||||
"--add-modules=ALL-SYSTEM",
|
||||
"--add-opens", "java.base/java.util=ALL-UNNAMED",
|
||||
"--add-opens", "java.base/java.lang=ALL-UNNAMED"
|
||||
] + arguments[1:])
|
||||
] + arguments[1:]
|
||||
|
||||
super().__init__(command)
|
||||
|
||||
@command("java.apply.workspaceEdit")
|
||||
def workspaceEdit (self, arguments):
|
||||
|
Loading…
x
Reference in New Issue
Block a user