Skip to content

Commit 2cecd45

Browse files
committed
New Live Hovers preference settings for VSCode and Theia
1 parent a6c1d4e commit 2cecd45

File tree

3 files changed

+21
-12
lines changed

3 files changed

+21
-12
lines changed

theia-extensions/theia-spring-boot/spring-boot/src/browser/boot-preferences.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,22 @@ import { createPreferenceProxy, PreferenceProxy, PreferenceService, PreferenceCo
1313

1414
// tslint:disable:max-line-length
1515

16-
export const HIGHLIGHTS_PREF_NAME = 'boot-java.boot-hints.on';
1716
export const XML_SUPPORT_PREF_NAME = 'boot-java.support-spring-xml-config.on';
1817
export const CODELENS_PREF_NAME = 'boot-java.highlight-codelens.on';
1918

2019
export const BootConfigSchema: PreferenceSchema = {
2120
'type': 'object',
2221
'title': 'Spring Boot Configuration',
2322
properties: {
24-
'boot-java.boot-hints.on': {
23+
'boot-java.live-information.automatic-tracking.on': {
2524
type: 'boolean',
26-
description: 'Enable/Disable Spring running Boot application live hints decorators in Java source code.',
27-
default: true
25+
description: 'Live Information - Automatic Process Tracking Enabled',
26+
default: false
27+
},
28+
'boot-java.live-information.automatic-tracking.delay': {
29+
type: 'number',
30+
description: 'Live Information - Automatic Process Tracking Delay in ms',
31+
default: 5000
2832
},
2933
'boot-java.scan-java-test-sources.on': {
3034
type: 'boolean',
@@ -75,7 +79,8 @@ export const BootConfigSchema: PreferenceSchema = {
7579
};
7680

7781
export interface BootConfiguration {
78-
'boot-java.boot-hints.on': boolean;
82+
'boot-java.live-information.automatic-tracking.on': boolean;
83+
'boot-java.live-information.automatic-tracking.delay': number;
7984
'boot-java.scan-java-test-sources.on': boolean;
8085
'boot-java.support-spring-xml-config.on': boolean;
8186
'boot-java.support-spring-xml-config.hyperlinks': boolean;

theia-extensions/theia-spring-boot/spring-boot/src/browser/language-client-contribution.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import {
2020
import { DocumentSelector } from '@theia/languages/lib/browser';
2121
import { JAVA_LANGUAGE_ID } from '@theia/java/lib/common';
2222
import { HighlightService} from './highlight-service';
23-
import {BootConfiguration, BootPreferences, CODELENS_PREF_NAME, HIGHLIGHTS_PREF_NAME} from './boot-preferences';
23+
import {BootConfiguration, BootPreferences, CODELENS_PREF_NAME} from './boot-preferences';
2424
import { StsLanguageClientContribution } from '@pivotal-tools/theia-languageclient/lib/browser/language-client-contribution';
2525
import { ClasspathService } from './classpath-service';
2626
import { HighlightCodeLensService } from './codelens-service';
@@ -69,16 +69,15 @@ export class SpringBootClientContribution extends StsLanguageClientContribution<
6969
this.javaDataService.attach(client);
7070

7171
this.preferences.onPreferenceChanged(event => {
72-
if (event.preferenceName === CODELENS_PREF_NAME
73-
|| event.preferenceName === HIGHLIGHTS_PREF_NAME) {
72+
if (event.preferenceName === CODELENS_PREF_NAME) {
7473
this.toggleHighlightCodeLenses();
7574
}
7675
});
7776
this.toggleHighlightCodeLenses();
7877
}
7978

8079
private toggleHighlightCodeLenses() {
81-
if (this.preferences[CODELENS_PREF_NAME] && this.preferences[HIGHLIGHTS_PREF_NAME]) {
80+
if (this.preferences[CODELENS_PREF_NAME]) {
8281
if (!this.codeLensProviderRegistration) {
8382
this.codeLensProviderRegistration = monaco.languages.registerCodeLensProvider(JAVA_LANGUAGE_ID, this.highlightCodeLensService);
8483
}

vscode-extensions/vscode-spring-boot/package.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,15 @@
7474
"type": "object",
7575
"title": "Boot-Java Configuration",
7676
"properties": {
77-
"boot-java.boot-hints.on": {
77+
"boot-java.live-information.automatic-tracking.on": {
7878
"type": "boolean",
79-
"default": true,
80-
"description": "Enable/Disable Spring running Boot application live hints decorators in Java source code"
79+
"default": false,
80+
"description": "Live Information - Automatic Process Tracking Enabled"
81+
},
82+
"boot-java.live-information.automatic-tracking.delay": {
83+
"type": "number",
84+
"default": 5000,
85+
"description": "Live Information - Automatic Process Tracking Delay in ms"
8186
},
8287
"boot-java.scan-java-test-sources.on": {
8388
"type": "boolean",

0 commit comments

Comments
 (0)