Skip to content

Commit

Permalink
Merge pull request #7082 from Achal1607/vscode-warnings-integrate
Browse files Browse the repository at this point in the history
Integrate hints preferences option in the vscode extension
  • Loading branch information
lahodaj committed Apr 16, 2024
2 parents 8c75f2d + 89d8dbb commit e6f0f68
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2093,7 +2093,7 @@ void updateJavaHintPreferences(JsonObject configuration) {
String path = pathPrimitive.getAsString();
Path p = Paths.get(path);
FileObject preferencesFile = FileUtil.toFileObject(p);
if (preferencesFile != null && preferencesFile.isValid() && preferencesFile.canRead() && preferencesFile.getName().endsWith(".xml")) {
if (preferencesFile != null && preferencesFile.isValid() && preferencesFile.canRead() && preferencesFile.getExt().equals("xml")) {
this.hintsPrefsFile = preferencesFile;
}
else {
Expand Down
5 changes: 5 additions & 0 deletions java/java.lsp.server/vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,11 @@
"description": "Path to the file containing exported formatter settings",
"default": null
},
"netbeans.hints.preferences": {
"type": "string",
"description": "Path to the file containing exported hints preferences",
"default": null
},
"netbeans.java.onSave.organizeImports": {
"type": "boolean",
"default": true,
Expand Down
1 change: 1 addition & 0 deletions java/java.lsp.server/vscode/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1000,6 +1000,7 @@ function doActivateWithJDK(specifiedJDK: string | null, context: ExtensionContex
documentSelector: documentSelectors,
synchronize: {
configurationSection: [
'netbeans.hints',
'netbeans.format',
'netbeans.java.imports',
'java+.runConfig.vmOptions'
Expand Down

0 comments on commit e6f0f68

Please sign in to comment.