Skip to content

Commit

Permalink
POC of google-java-format support
Browse files Browse the repository at this point in the history
Signed-off-by: Shi Chen <[email protected]>
  • Loading branch information
CsCherrYY committed Apr 14, 2023
1 parent bff3ff6 commit 4d51978
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
12 changes: 8 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -648,10 +648,12 @@
{
"type": "string",
"enum": [
"eclipse"
"eclipse",
"google"
],
"enumDescriptions": [
"Use the eclipse formatter."
"Use the eclipse formatter.",
"Use the google-java-format formatter."
],
"markdownDescription": "Specifies the formatter style."
},
Expand All @@ -664,10 +666,12 @@
"style": {
"type": "string",
"enum": [
"eclipse"
"eclipse",
"google"
],
"enumDescriptions": [
"Use the eclipse formatter."
"Use the eclipse formatter.",
"Use the google-java-format formatter."
],
"markdownDescription": "Specifies the formatter style."
},
Expand Down
13 changes: 13 additions & 0 deletions src/javaServerStarter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,19 @@ function prepareParams(requirements: RequirementsData, javaConfiguration, worksp
'java.base/java.util=ALL-UNNAMED',
'--add-opens',
'java.base/java.lang=ALL-UNNAMED',
// See https://github.com/google/google-java-format#as-a-library
'--add-opens',
'jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED',
'--add-opens',
'jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED',
'--add-opens',
'jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED',
'--add-opens',
'jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED',
'--add-opens',
'jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED',
'--add-opens',
'jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED',
// See https://github.com/redhat-developer/vscode-java/issues/2264
// It requires the internal API sun.nio.fs.WindowsFileAttributes.isDirectoryLink() to check if a Windows directory is symlink.
'--add-opens',
Expand Down

0 comments on commit 4d51978

Please sign in to comment.