Skip to content

Commit

Permalink
remove additional setting and add check for previous setting
Browse files Browse the repository at this point in the history
  • Loading branch information
hopehadfield committed Dec 10, 2024
1 parent 01897f2 commit d7aab29
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 21 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,7 @@ The following settings are supported:
* `java.configuration.maven.userSettings` : Path to Maven's user settings.xml.
* `java.configuration.checkProjectSettingsExclusions`: **Deprecated, please use 'java.import.generatesMetadataFilesAtProjectRoot' to control whether to generate the project metadata files at the project root. And use 'files.exclude' to control whether to hide the project metadata files from the file explorer.** Controls whether to exclude extension-generated project settings files (`.project`, `.classpath`, `.factorypath`, `.settings/`) from the file explorer. Defaults to `false`.
* `java.referencesCodeLens.enabled` : Enable/disable the references code lenses.
* `java.implementationsCodeLens.enabled` : Enable/disable the implementations code lenses.
* `java.methodImplementationsCodeLens.enabled` : Enable/disable the method implementations code lenses.
* `java.implementationCodeLens` : Enable/disable the implementations code lens for the provided categories.
* `java.signatureHelp.enabled` : Enable/disable signature help support (triggered on `(`).
* `java.signatureHelp.description.enabled` : Enable/disable to show the description in signature help. Defaults to `false`.
* `java.contentProvider.preferred` : Preferred content provider (see 3rd party decompilers available in [vscode-java-decompiler](https://github.com/dgileadi/vscode-java-decompiler)).
Expand Down
43 changes: 24 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1409,54 +1409,59 @@
"scope": "window",
"order": 10
},
"java.implementationsCodeLens.enabled": {
"type": "boolean",
"default": false,
"description": "Enable/disable the implementations code lens.",
"java.implementationCodeLens": {
"type": "string",
"enum": [
"none",
"types",
"methods",
"all"
],
"enumDescriptions": [
"Disable the implementations code lens",
"Enable the implementations code lens only for types",
"Enable the implementations code lens only for methods",
"Enable the implementations code lens for types and methods"
],
"default": "none",
"description": "Enable/disable the implementations code lens for the provided categories.",
"scope": "window",
"order": 20
},
"java.methodImplementationsCodeLens.enabled": {
"type": "boolean",
"default": false,
"description": "Enable/disable the method implementations code lens.",
"scope": "window",
"order": 30
},
"java.references.includeAccessors": {
"type": "boolean",
"default": true,
"description": "Include getter, setter and builder/constructor when finding references.",
"scope": "window",
"order": 40
"order": 30
},
"java.references.includeDeclarations": {
"type": "boolean",
"default": true,
"description": "Include declarations when finding references.",
"scope": "window",
"order": 50
"order": 40
},
"java.references.includeDecompiledSources": {
"type": "boolean",
"default": true,
"description": "Include the decompiled sources when finding references.",
"scope": "window",
"order": 60
"order": 50
},
"java.symbols.includeSourceMethodDeclarations": {
"type": "boolean",
"markdownDescription": "Include method declarations from source files in symbol search.",
"default": false,
"scope": "window",
"order": 70
"order": 60
},
"java.typeHierarchy.lazyLoad": {
"type": "boolean",
"default": false,
"description": "Enable/disable lazy loading the content in type hierarchy. Lazy loading could save a lot of loading time but every type should be expanded manually to load its content.",
"scope": "window",
"order": 80
"order": 70
},
"java.inlayHints.parameterNames.enabled": {
"type": "string",
Expand All @@ -1473,7 +1478,7 @@
"default": "literals",
"markdownDescription": "Enable/disable inlay hints for parameter names:\n```java\n\nInteger.valueOf(/* s: */ '123', /* radix: */ 10)\n \n```\n `#java.inlayHints.parameterNames.exclusions#` can be used to disable the inlay hints for methods.",
"scope": "window",
"order": 90
"order": 80
},
"java.inlayHints.parameterNames.exclusions": {
"type": "array",
Expand All @@ -1483,7 +1488,7 @@
"default": [],
"markdownDescription": "The patterns for the methods that will be disabled to show the inlay hints. Supported pattern examples:\n - `java.lang.Math.*` - All the methods from java.lang.Math.\n - `*.Arrays.asList` - Methods named as 'asList' in the types named as 'Arrays'.\n - `*.println(*)` - Methods named as 'println'.\n - `(from, to)` - Methods with two parameters named as 'from' and 'to'.\n - `(arg*)` - Methods with one parameter whose name starts with 'arg'.",
"scope": "window",
"order": 100
"order": 90
},
"java.search.scope": {
"type": "string",
Expand All @@ -1498,7 +1503,7 @@
"default": "all",
"markdownDescription": "Specifies the scope which must be used for search operation like \n - Find Reference\n - Call Hierarchy\n - Workspace Symbols",
"scope": "window",
"order": 110
"order": 100
}
}
},
Expand Down
8 changes: 8 additions & 0 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,14 @@ export async function getJavaConfig(javaHome: string) {
const userConfiguredJREs: any[] = javaConfig.configuration.runtimes;
javaConfig.configuration.runtimes = await addAutoDetectedJdks(userConfiguredJREs);
}

if (!isPreferenceOverridden("java.implementationCodeLens") && javaConfig.implementationsCodeLens){
const deprecatedImplementations: boolean | undefined = javaConfig.implementationsCodeLens.enabled;
if (deprecatedImplementations !== undefined){
javaConfig.implementationCodeLens = deprecatedImplementations ? "types" : "none";
}
}

return javaConfig;
}

Expand Down

0 comments on commit d7aab29

Please sign in to comment.