Skip to content

Commit bac9c57

Browse files
committed
Fix up the classpath after import (Initial implementation)
Signed-off-by: Thomas Mäder <t.s.maeder@gmail.com>
1 parent 99f4812 commit bac9c57

2 files changed

Lines changed: 60 additions & 0 deletions

File tree

package.json

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,65 @@
579579
"default": "ignore",
580580
"markdownDescription": "Project encoding settings",
581581
"scope": "window"
582+
},
583+
"java.import.classpath": {
584+
"type": "object",
585+
"description": "Fix up the classpath after import",
586+
"scope": "window",
587+
"order": 11,
588+
"additionalProperties": true,
589+
"patternProperties": {
590+
"^.*$": {
591+
"oneOf": [
592+
{
593+
"enum": [
594+
"remove"
595+
]
596+
},
597+
{
598+
"type": "object",
599+
"description": "The classpath fixes for a single Java project.",
600+
"properties": {
601+
"path": {
602+
"type": "string",
603+
"description": "The path to the java project folder in the file system in OS-specific format",
604+
"format": "path"
605+
},
606+
"classpath": {
607+
"type": "object",
608+
"patternProperties": {
609+
"^.*$": {
610+
"oneOf": [
611+
{
612+
"enum": [
613+
"remove"
614+
]
615+
},
616+
{
617+
"type": "object",
618+
"properties": {
619+
"requiredProperties": [
620+
"type"
621+
],
622+
"type": {
623+
"enum": [
624+
"source"
625+
]
626+
},
627+
"output": {
628+
"type": "string"
629+
}
630+
}
631+
}
632+
]
633+
}
634+
}
635+
}
636+
}
637+
}
638+
]
639+
}
640+
}
582641
}
583642
}
584643
},

src/utils.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ export async function getJavaConfig(javaHome: string) {
228228
// we avoid reading the value from the global scope.
229229
javaConfig.project.outputPath = origConfig.inspect<string>("project.outputPath").workspaceValue;
230230
javaConfig.project.sourcePaths = origConfig.inspect<string[]>("project.sourcePaths").workspaceValue;
231+
javaConfig.import.classpath = origConfig.inspect<any>("import.classpath").workspaceValue || {};
231232

232233
const editorConfig = workspace.getConfiguration('editor');
233234
javaConfig.format.insertSpaces = editorConfig.get('insertSpaces');

0 commit comments

Comments
 (0)