Skip to content

Commit 055d107

Browse files
authored
Merge pull request #613 from mezarin/useMetadataToFormat
Add settings
2 parents 676c4a1 + d63f353 commit 055d107

File tree

64 files changed

+2032
-884
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+2032
-884
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
eclipse.preferences.version=1
2+
encoding/<project>=UTF-8

bundles/io.openliberty.tools.eclipse.lsp4e/.settings/org.eclipse.jdt.core.prefs

Lines changed: 284 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
cleanup.add_default_serial_version_id=false
2+
cleanup.add_generated_serial_version_id=true
3+
cleanup.add_missing_annotations=true
4+
cleanup.add_missing_deprecated_annotations=true
5+
cleanup.add_missing_methods=false
6+
cleanup.add_missing_nls_tags=false
7+
cleanup.add_missing_override_annotations=true
8+
cleanup.add_missing_override_annotations_interface_methods=true
9+
cleanup.add_serial_version_id=false
10+
cleanup.always_use_blocks=true
11+
cleanup.always_use_parentheses_in_expressions=false
12+
cleanup.always_use_this_for_non_static_field_access=false
13+
cleanup.always_use_this_for_non_static_method_access=false
14+
cleanup.convert_to_enhanced_for_loop=false
15+
cleanup.correct_indentation=true
16+
cleanup.format_source_code=false
17+
cleanup.format_source_code_changes_only=false
18+
cleanup.make_local_variable_final=false
19+
cleanup.make_parameters_final=true
20+
cleanup.make_private_fields_final=false
21+
cleanup.make_type_abstract_if_missing_method=false
22+
cleanup.make_variable_declarations_final=false
23+
cleanup.never_use_blocks=false
24+
cleanup.never_use_parentheses_in_expressions=true
25+
cleanup.organize_imports=false
26+
cleanup.qualify_static_field_accesses_with_declaring_class=false
27+
cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
28+
cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
29+
cleanup.qualify_static_member_accesses_with_declaring_class=true
30+
cleanup.qualify_static_method_accesses_with_declaring_class=false
31+
cleanup.remove_private_constructors=true
32+
cleanup.remove_trailing_whitespaces=true
33+
cleanup.remove_trailing_whitespaces_all=true
34+
cleanup.remove_trailing_whitespaces_ignore_empty=false
35+
cleanup.remove_unnecessary_casts=true
36+
cleanup.remove_unnecessary_nls_tags=true
37+
cleanup.remove_unused_imports=true
38+
cleanup.remove_unused_local_variables=false
39+
cleanup.remove_unused_private_fields=true
40+
cleanup.remove_unused_private_members=false
41+
cleanup.remove_unused_private_methods=true
42+
cleanup.remove_unused_private_types=true
43+
cleanup.sort_members=false
44+
cleanup.sort_members_all=false
45+
cleanup.use_blocks=true
46+
cleanup.use_blocks_only_for_return_and_throw=false
47+
cleanup.use_parentheses_in_expressions=true
48+
cleanup.use_this_for_non_static_field_access=false
49+
cleanup.use_this_for_non_static_field_access_only_if_necessary=true
50+
cleanup.use_this_for_non_static_method_access=false
51+
cleanup.use_this_for_non_static_method_access_only_if_necessary=true
52+
eclipse.preferences.version=1
53+
editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=false
54+
org.eclipse.jdt.ui.exception.name=e
55+
org.eclipse.jdt.ui.gettersetter.use.is=false
56+
org.eclipse.jdt.ui.ignorelowercasenames=true
57+
org.eclipse.jdt.ui.importorder=java;javax;org;com;
58+
org.eclipse.jdt.ui.javadoc=true
59+
org.eclipse.jdt.ui.keywordthis=false
60+
org.eclipse.jdt.ui.ondemandthreshold=99
61+
org.eclipse.jdt.ui.overrideannotation=true
62+
org.eclipse.jdt.ui.staticondemandthreshold=99
63+
sp_cleanup.add_default_serial_version_id=true
64+
sp_cleanup.add_generated_serial_version_id=false
65+
sp_cleanup.add_missing_annotations=true
66+
sp_cleanup.add_missing_deprecated_annotations=true
67+
sp_cleanup.add_missing_methods=false
68+
sp_cleanup.add_missing_nls_tags=false
69+
sp_cleanup.add_missing_override_annotations=true
70+
sp_cleanup.add_missing_override_annotations_interface_methods=true
71+
sp_cleanup.add_serial_version_id=false
72+
sp_cleanup.always_use_blocks=true
73+
sp_cleanup.always_use_parentheses_in_expressions=false
74+
sp_cleanup.always_use_this_for_non_static_field_access=false
75+
sp_cleanup.always_use_this_for_non_static_method_access=false
76+
sp_cleanup.convert_to_enhanced_for_loop=false
77+
sp_cleanup.correct_indentation=false
78+
sp_cleanup.format_source_code=true
79+
sp_cleanup.format_source_code_changes_only=false
80+
sp_cleanup.make_local_variable_final=false
81+
sp_cleanup.make_parameters_final=false
82+
sp_cleanup.make_private_fields_final=true
83+
sp_cleanup.make_type_abstract_if_missing_method=false
84+
sp_cleanup.make_variable_declarations_final=true
85+
sp_cleanup.never_use_blocks=false
86+
sp_cleanup.never_use_parentheses_in_expressions=true
87+
sp_cleanup.on_save_use_additional_actions=true
88+
sp_cleanup.organize_imports=true
89+
sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
90+
sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
91+
sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
92+
sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
93+
sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
94+
sp_cleanup.remove_private_constructors=true
95+
sp_cleanup.remove_trailing_whitespaces=true
96+
sp_cleanup.remove_trailing_whitespaces_all=true
97+
sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
98+
sp_cleanup.remove_unnecessary_casts=true
99+
sp_cleanup.remove_unnecessary_nls_tags=true
100+
sp_cleanup.remove_unused_imports=true
101+
sp_cleanup.remove_unused_local_variables=false
102+
sp_cleanup.remove_unused_private_fields=true
103+
sp_cleanup.remove_unused_private_members=false
104+
sp_cleanup.remove_unused_private_methods=true
105+
sp_cleanup.remove_unused_private_types=true
106+
sp_cleanup.sort_members=false
107+
sp_cleanup.sort_members_all=false
108+
sp_cleanup.use_blocks=false
109+
sp_cleanup.use_blocks_only_for_return_and_throw=false
110+
sp_cleanup.use_parentheses_in_expressions=false
111+
sp_cleanup.use_this_for_non_static_field_access=false
112+
sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
113+
sp_cleanup.use_this_for_non_static_method_access=false
114+
sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true

bundles/io.openliberty.tools.eclipse.lsp4e/src/io/openliberty/tools/eclipse/jakarta/languageserver/JakartaLSClientImpl.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@
3838
import org.eclipse.lsp4jakarta.commons.JakartaJavaProjectLabelsParams;
3939
import org.eclipse.lsp4jakarta.commons.JavaCursorContextResult;
4040
import org.eclipse.lsp4jakarta.commons.ProjectLabelInfoEntry;
41+
import org.eclipse.lsp4jakarta.commons.codeaction.CodeActionResolveData;
42+
import org.eclipse.lsp4jakarta.commons.utils.JSONUtility;
4143
import org.eclipse.lsp4jakarta.jdt.core.ProjectLabelManager;
4244
import org.eclipse.lsp4jakarta.jdt.core.PropertiesManagerForJava;
4345
import org.eclipse.lsp4jakarta.jdt.internal.core.ls.JDTUtilsLSImpl;
4446
import org.eclipse.lsp4jakarta.ls.api.JakartaLanguageClientAPI;
45-
import org.eclipse.lsp4jakarta.commons.codeaction.CodeActionResolveData;
46-
import org.eclipse.lsp4jakarta.commons.utils.JSONUtility;
4747

4848
import io.openliberty.tools.eclipse.ls.plugin.LibertyToolsLSPlugin;
4949

@@ -79,7 +79,7 @@ public CompletableFuture<JakartaJavaCompletionResult> getJavaCompletion(JakartaJ
7979
try {
8080
completionList = PropertiesManagerForJava.getInstance().completion(javaParams, JDTUtilsLSImpl.getInstance(), monitor);
8181
JavaCursorContextResult javaCursorContext = PropertiesManagerForJava.getInstance().javaCursorContext(javaParams,
82-
JDTUtilsLSImpl.getInstance(), monitor);
82+
JDTUtilsLSImpl.getInstance(), monitor);
8383
return new JakartaJavaCompletionResult(completionList, javaCursorContext);
8484
} catch (JavaModelException e) {
8585
LibertyToolsLSPlugin.logException(e.getLocalizedMessage(), e);
@@ -145,7 +145,7 @@ public CompletableFuture<List<CodeAction>> getJavaCodeAction(JakartaJavaCodeActi
145145
IProgressMonitor monitor = getProgressMonitor(cancelChecker);
146146
try {
147147
return (List<CodeAction>) PropertiesManagerForJava.getInstance().codeAction(javaParams, JDTUtilsLSImpl.getInstance(),
148-
monitor);
148+
monitor);
149149
} catch (JavaModelException e) {
150150
LibertyToolsLSPlugin.logException(e.getLocalizedMessage(), e);
151151
return Collections.emptyList();
@@ -164,7 +164,7 @@ public CompletableFuture<CodeAction> resolveCodeAction(CodeAction unresolved) {
164164
CodeActionResolveData resolveData = JSONUtility.toModel(unresolved.getData(), CodeActionResolveData.class);
165165
unresolved.setData(resolveData);
166166
return (CodeAction) PropertiesManagerForJava.getInstance().resolveCodeAction(unresolved, JDTUtilsLSImpl.getInstance(),
167-
monitor);
167+
monitor);
168168
} catch (JavaModelException e) {
169169
LibertyToolsLSPlugin.logException(e.getLocalizedMessage(), e);
170170
return null;

bundles/io.openliberty.tools.eclipse.lsp4e/src/io/openliberty/tools/eclipse/jakarta/languageserver/JakartaLSConnection.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,7 @@ public JakartaLSConnection() {
6060
setCommands(commands);
6161
setWorkingDirectory(System.getProperty("user.dir"));
6262
} catch (IOException e) {
63-
LibertyToolsLSPlugin.getDefault().getLog()
64-
.log(new Status(IStatus.ERROR, LibertyToolsLSPlugin.getDefault().getBundle().getSymbolicName(), e.getMessage(), e));
63+
LibertyToolsLSPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, LibertyToolsLSPlugin.getDefault().getBundle().getSymbolicName(), e.getMessage(), e));
6564
}
6665
}
6766

bundles/io.openliberty.tools.eclipse.lsp4e/src/io/openliberty/tools/eclipse/liberty/languageserver/LibertyLSClientImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ public boolean visit(IResourceDelta delta) {
8383

8484
// Look for changes to liberty-plugin-config.xml, *.properties, and *.env
8585
if ("liberty-plugin-config.xml".equalsIgnoreCase(resource.getName())
86-
|| "properties".equalsIgnoreCase(resource.getFileExtension())
87-
|| "env".equalsIgnoreCase(resource.getFileExtension())) {
86+
|| "properties".equalsIgnoreCase(resource.getFileExtension())
87+
|| "env".equalsIgnoreCase(resource.getFileExtension())) {
8888
changed.add(resource.getLocationURI().toString());
8989
}
9090
}

bundles/io.openliberty.tools.eclipse.lsp4e/src/io/openliberty/tools/eclipse/liberty/languageserver/LibertyLSConnection.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ public LibertyLSConnection() {
4848
setCommands(commands);
4949
setWorkingDirectory(System.getProperty("user.dir"));
5050
} catch (IOException e) {
51-
LibertyToolsLSPlugin.getDefault().getLog()
52-
.log(new Status(IStatus.ERROR, LibertyToolsLSPlugin.getDefault().getBundle().getSymbolicName(), e.getMessage(), e));
51+
LibertyToolsLSPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, LibertyToolsLSPlugin.getDefault().getBundle().getSymbolicName(), e.getMessage(), e));
5352
}
5453
}
5554

bundles/io.openliberty.tools.eclipse.lsp4e/src/io/openliberty/tools/eclipse/ls/plugin/LibertyToolsLSPlugin.java

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -23,55 +23,55 @@
2323
*/
2424
public class LibertyToolsLSPlugin extends AbstractUIPlugin {
2525

26-
// The plug-in ID
27-
public static final String PLUGIN_ID = "io.openliberty.tools.eclipse.lsp4e"; //$NON-NLS-1$
26+
// The plug-in ID
27+
public static final String PLUGIN_ID = "io.openliberty.tools.eclipse.lsp4e"; //$NON-NLS-1$
2828

29-
// The shared instance
30-
private static LibertyToolsLSPlugin plugin;
29+
// The shared instance
30+
private static LibertyToolsLSPlugin plugin;
3131

32-
/**
33-
* The constructor
34-
*/
35-
public LibertyToolsLSPlugin() {
36-
}
32+
/**
33+
* The constructor
34+
*/
35+
public LibertyToolsLSPlugin() {
36+
}
3737

38-
@Override
39-
public void start(BundleContext context) throws Exception {
40-
super.start(context);
41-
plugin = this;
42-
}
38+
@Override
39+
public void start(BundleContext context) throws Exception {
40+
super.start(context);
41+
plugin = this;
42+
}
4343

44-
@Override
45-
public void stop(BundleContext context) throws Exception {
46-
plugin = null;
47-
super.stop(context);
48-
}
44+
@Override
45+
public void stop(BundleContext context) throws Exception {
46+
plugin = null;
47+
super.stop(context);
48+
}
4949

50-
/**
51-
* Returns the shared instance
52-
*
53-
* @return the shared instance
54-
*/
55-
public static LibertyToolsLSPlugin getDefault() {
56-
return plugin;
57-
}
50+
/**
51+
* Returns the shared instance
52+
*
53+
* @return the shared instance
54+
*/
55+
public static LibertyToolsLSPlugin getDefault() {
56+
return plugin;
57+
}
5858

59-
public static void logException(String localizedMessage, JavaModelException e) {
60-
// TODO Auto-generated method stub
59+
public static void logException(String localizedMessage, JavaModelException e) {
60+
// TODO Auto-generated method stub
6161

62-
}
62+
}
6363

64-
public static String getPluginId() {
65-
return LibertyToolsLSPlugin.PLUGIN_ID;
66-
}
64+
public static String getPluginId() {
65+
return LibertyToolsLSPlugin.PLUGIN_ID;
66+
}
6767

68-
public static void log(IStatus status) {
69-
getDefault().getLog().log(status);
70-
}
68+
public static void log(IStatus status) {
69+
getDefault().getLog().log(status);
70+
}
7171

72-
public static void logException(String errMsg, Throwable ex) {
73-
getDefault().getLog().log(new Status(IStatus.ERROR, getPluginId(), errMsg, ex));
72+
public static void logException(String errMsg, Throwable ex) {
73+
getDefault().getLog().log(new Status(IStatus.ERROR, getPluginId(), errMsg, ex));
7474

75-
}
75+
}
7676

7777
}

bundles/io.openliberty.tools.eclipse.lsp4e/src/io/openliberty/tools/eclipse/mpls/LibertyMPLSClientImpl.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ public CompletableFuture<List<CodeAction>> getJavaCodeAction(MicroProfileJavaCod
167167
}
168168

169169
return (List<CodeAction>) PropertiesManagerForJava.getInstance().codeAction(javaParams, JDTUtilsLSImpl.getInstance(),
170-
monitor);
170+
monitor);
171171
} catch (JavaModelException e) {
172172
LibertyToolsLSPlugin.logException(e.getLocalizedMessage(), e);
173173
return Collections.emptyList();
@@ -218,9 +218,9 @@ public CompletableFuture<MicroProfileJavaCompletionResult> getJavaCompletion(Mic
218218
IProgressMonitor monitor = getProgressMonitor(cancelChecker);
219219
try {
220220
CompletionList completionList = PropertiesManagerForJava.getInstance().completion(javaParams, JDTUtilsLSImpl.getInstance(),
221-
monitor);
221+
monitor);
222222
JavaCursorContextResult javaCursorContext = PropertiesManagerForJava.getInstance().javaCursorContext(javaParams,
223-
JDTUtilsLSImpl.getInstance(), monitor);
223+
JDTUtilsLSImpl.getInstance(), monitor);
224224
return new MicroProfileJavaCompletionResult(completionList, javaCursorContext);
225225
} catch (JavaModelException e) {
226226
LibertyToolsLSPlugin.logException(e.getLocalizedMessage(), e);

bundles/io.openliberty.tools.eclipse.lsp4e/src/io/openliberty/tools/eclipse/mpls/LibertyMPLSConnection.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ public LibertyMPLSConnection() {
5252
setCommands(commands);
5353
setWorkingDirectory(System.getProperty("user.dir"));
5454
} catch (IOException e) {
55-
LibertyToolsLSPlugin.getDefault().getLog()
56-
.log(new Status(IStatus.ERROR, LibertyToolsLSPlugin.getDefault().getBundle().getSymbolicName(), e.getMessage(), e));
55+
LibertyToolsLSPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, LibertyToolsLSPlugin.getDefault().getBundle().getSymbolicName(), e.getMessage(), e));
5756
}
5857
}
5958

0 commit comments

Comments
 (0)