Skip to content

Commit d7aab29

Browse files
committed
remove additional setting and add check for previous setting
1 parent 01897f2 commit d7aab29

File tree

3 files changed

+33
-21
lines changed

3 files changed

+33
-21
lines changed

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,7 @@ The following settings are supported:
123123
* `java.configuration.maven.userSettings` : Path to Maven's user settings.xml.
124124
* `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`.
125125
* `java.referencesCodeLens.enabled` : Enable/disable the references code lenses.
126-
* `java.implementationsCodeLens.enabled` : Enable/disable the implementations code lenses.
127-
* `java.methodImplementationsCodeLens.enabled` : Enable/disable the method implementations code lenses.
126+
* `java.implementationCodeLens` : Enable/disable the implementations code lens for the provided categories.
128127
* `java.signatureHelp.enabled` : Enable/disable signature help support (triggered on `(`).
129128
* `java.signatureHelp.description.enabled` : Enable/disable to show the description in signature help. Defaults to `false`.
130129
* `java.contentProvider.preferred` : Preferred content provider (see 3rd party decompilers available in [vscode-java-decompiler](https://github.com/dgileadi/vscode-java-decompiler)).

package.json

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1409,54 +1409,59 @@
14091409
"scope": "window",
14101410
"order": 10
14111411
},
1412-
"java.implementationsCodeLens.enabled": {
1413-
"type": "boolean",
1414-
"default": false,
1415-
"description": "Enable/disable the implementations code lens.",
1412+
"java.implementationCodeLens": {
1413+
"type": "string",
1414+
"enum": [
1415+
"none",
1416+
"types",
1417+
"methods",
1418+
"all"
1419+
],
1420+
"enumDescriptions": [
1421+
"Disable the implementations code lens",
1422+
"Enable the implementations code lens only for types",
1423+
"Enable the implementations code lens only for methods",
1424+
"Enable the implementations code lens for types and methods"
1425+
],
1426+
"default": "none",
1427+
"description": "Enable/disable the implementations code lens for the provided categories.",
14161428
"scope": "window",
14171429
"order": 20
14181430
},
1419-
"java.methodImplementationsCodeLens.enabled": {
1420-
"type": "boolean",
1421-
"default": false,
1422-
"description": "Enable/disable the method implementations code lens.",
1423-
"scope": "window",
1424-
"order": 30
1425-
},
14261431
"java.references.includeAccessors": {
14271432
"type": "boolean",
14281433
"default": true,
14291434
"description": "Include getter, setter and builder/constructor when finding references.",
14301435
"scope": "window",
1431-
"order": 40
1436+
"order": 30
14321437
},
14331438
"java.references.includeDeclarations": {
14341439
"type": "boolean",
14351440
"default": true,
14361441
"description": "Include declarations when finding references.",
14371442
"scope": "window",
1438-
"order": 50
1443+
"order": 40
14391444
},
14401445
"java.references.includeDecompiledSources": {
14411446
"type": "boolean",
14421447
"default": true,
14431448
"description": "Include the decompiled sources when finding references.",
14441449
"scope": "window",
1445-
"order": 60
1450+
"order": 50
14461451
},
14471452
"java.symbols.includeSourceMethodDeclarations": {
14481453
"type": "boolean",
14491454
"markdownDescription": "Include method declarations from source files in symbol search.",
14501455
"default": false,
14511456
"scope": "window",
1452-
"order": 70
1457+
"order": 60
14531458
},
14541459
"java.typeHierarchy.lazyLoad": {
14551460
"type": "boolean",
14561461
"default": false,
14571462
"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.",
14581463
"scope": "window",
1459-
"order": 80
1464+
"order": 70
14601465
},
14611466
"java.inlayHints.parameterNames.enabled": {
14621467
"type": "string",
@@ -1473,7 +1478,7 @@
14731478
"default": "literals",
14741479
"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.",
14751480
"scope": "window",
1476-
"order": 90
1481+
"order": 80
14771482
},
14781483
"java.inlayHints.parameterNames.exclusions": {
14791484
"type": "array",
@@ -1483,7 +1488,7 @@
14831488
"default": [],
14841489
"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'.",
14851490
"scope": "window",
1486-
"order": 100
1491+
"order": 90
14871492
},
14881493
"java.search.scope": {
14891494
"type": "string",
@@ -1498,7 +1503,7 @@
14981503
"default": "all",
14991504
"markdownDescription": "Specifies the scope which must be used for search operation like \n - Find Reference\n - Call Hierarchy\n - Workspace Symbols",
15001505
"scope": "window",
1501-
"order": 110
1506+
"order": 100
15021507
}
15031508
}
15041509
},

src/utils.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,14 @@ export async function getJavaConfig(javaHome: string) {
272272
const userConfiguredJREs: any[] = javaConfig.configuration.runtimes;
273273
javaConfig.configuration.runtimes = await addAutoDetectedJdks(userConfiguredJREs);
274274
}
275+
276+
if (!isPreferenceOverridden("java.implementationCodeLens") && javaConfig.implementationsCodeLens){
277+
const deprecatedImplementations: boolean | undefined = javaConfig.implementationsCodeLens.enabled;
278+
if (deprecatedImplementations !== undefined){
279+
javaConfig.implementationCodeLens = deprecatedImplementations ? "types" : "none";
280+
}
281+
}
282+
275283
return javaConfig;
276284
}
277285

0 commit comments

Comments
 (0)