Skip to content

Commit abbfc64

Browse files
committed
Fix warnings
* Static access * Unused suppress warning
1 parent f1d7fe6 commit abbfc64

3 files changed

Lines changed: 30 additions & 26 deletions

File tree

org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/debug/chrome/ChromeExecutableTab.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2020 Red Hat Inc. and others.
2+
* Copyright (c) 2020, 2026 Red Hat Inc. and others.
33
*
44
* This program and the accompanying materials are made
55
* available under the terms of the Eclipse Public License 2.0
@@ -112,7 +112,7 @@ public static boolean isChrome(IBrowserDescriptor desc) {
112112
@Override
113113
public void initializeFrom(ILaunchConfiguration configuration) {
114114
try {
115-
String browserLocation = configuration.getAttribute(ChromeRunDAPDebugDelegate.RUNTIME_EXECUTABLE, "");
115+
String browserLocation = configuration.getAttribute(VSCodeJSDebugDelegate.RUNTIME_EXECUTABLE, "");
116116
if (browserLocation.isEmpty()) {
117117
browserToUse.setSelection(new StructuredSelection(browserLocation));
118118
} else {
@@ -140,9 +140,9 @@ public void initializeFrom(ILaunchConfiguration configuration) {
140140
public void performApply(ILaunchConfigurationWorkingCopy configuration) {
141141
Object selectedBrowser = ((IStructuredSelection)browserToUse.getSelection()).getFirstElement();
142142
if (selectedBrowser instanceof IBrowserDescriptor desc) {
143-
configuration.setAttribute(ChromeRunDAPDebugDelegate.RUNTIME_EXECUTABLE, desc.getLocation());
143+
configuration.setAttribute(VSCodeJSDebugDelegate.RUNTIME_EXECUTABLE, desc.getLocation());
144144
} else if (selectedBrowser instanceof String) {
145-
configuration.setAttribute(ChromeRunDAPDebugDelegate.RUNTIME_EXECUTABLE, selectedBrowser);
145+
configuration.setAttribute(VSCodeJSDebugDelegate.RUNTIME_EXECUTABLE, selectedBrowser);
146146
}
147147
}
148148

org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/debug/node/RunProgramTab.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2018 Red Hat Inc. and others.
2+
* Copyright (c) 2018, 2026 Red Hat Inc. and others.
33
*
44
* This program and the accompanying materials are made
55
* available under the terms of the Eclipse Public License 2.0
@@ -12,7 +12,9 @@
1212
*******************************************************************************/
1313
package org.eclipse.wildwebdeveloper.debug.node;
1414

15-
import static org.eclipse.wildwebdeveloper.debug.SelectionUtils.*;
15+
import static org.eclipse.wildwebdeveloper.debug.SelectionUtils.getSelectedFile;
16+
import static org.eclipse.wildwebdeveloper.debug.SelectionUtils.getSelectedProject;
17+
import static org.eclipse.wildwebdeveloper.debug.SelectionUtils.pathOrEmpty;
1618

1719
import java.io.File;
1820

@@ -283,7 +285,7 @@ public void initializeFrom(ILaunchConfiguration configuration) {
283285
try {
284286
String defaultSelectedFile = pathOrEmpty(getSelectedFile(shortcut::canLaunch));
285287
this.programPathText.setText(configuration.getAttribute(LaunchConstants.PROGRAM, defaultSelectedFile)); //$NON-NLS-1$
286-
this.argumentsText.setText(configuration.getAttribute(NodeRunDAPDebugDelegate.ARGUMENTS, "")); //$NON-NLS-1$
288+
this.argumentsText.setText(configuration.getAttribute(VSCodeJSDebugDelegate.ARGUMENTS, "")); //$NON-NLS-1$
287289
this.workingDirectoryText
288290
.setText(configuration.getAttribute(DebugPlugin.ATTR_WORKING_DIRECTORY, pathOrEmpty(getSelectedProject()))); //$NON-NLS-1$
289291
} catch (CoreException e) {
@@ -295,7 +297,7 @@ public void initializeFrom(ILaunchConfiguration configuration) {
295297
public void performApply(ILaunchConfigurationWorkingCopy configuration) {
296298
String programPath = this.programPathText.getText();
297299
configuration.setAttribute(LaunchConstants.PROGRAM, programPath);
298-
configuration.setAttribute(NodeRunDAPDebugDelegate.ARGUMENTS, this.argumentsText.getText());
300+
configuration.setAttribute(VSCodeJSDebugDelegate.ARGUMENTS, this.argumentsText.getText());
299301
configuration.setAttribute(DebugPlugin.ATTR_WORKING_DIRECTORY, this.workingDirectoryText.getText());
300302
configuration.setMappedResources(ResourcesPlugin.getWorkspace().getRoot().findFilesForLocationURI(FileUtils.toUri(programPath)));
301303
}

org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/ui/preferences/ProcessStreamConnectionProviderWithPreference.java

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2022, 2023 Red Hat Inc. and others.
2+
* Copyright (c) 2022, 2026 Red Hat Inc. and others.
33
*
44
* This program and the accompanying materials are made
55
* available under the terms of the Eclipse Public License 2.0
@@ -170,25 +170,24 @@ private void removePropertyChangeListenerIfNeed() {
170170
@Override
171171
public void propertyChange(PropertyChangeEvent event) {
172172
if (isAffected(event)) {
173-
LanguageServerDefinition languageServerDefinition = getLanguageServerDefinition();
174-
@SuppressWarnings("rawtypes")
173+
LanguageServerDefinition languageServerDefinition = getLanguageServerDefinition();
175174
DidChangeConfigurationParams params = new DidChangeConfigurationParams(createSettings());
176175

177176
/*
178-
* Fan-out strategy and rationale
179-
* --------------------------------
180-
* We must deliver didChangeConfiguration to every running instance of the
181-
* language server for this provider's id, regardless of how LSP4E can find it.
182-
* LSP4E discovery varies by scope, so we notify in 3 passes and de-duplicate:
183-
* 1) Workspace-wide (null project): catches singleton or workspace-folder-aware servers.
184-
* 2) Per-project: picks up per-project servers that don't expose workspace folders (eg JSTS).
185-
* 3) Per-document (open editors): covers files outside the workspace or not yet tied to a project.
177+
* Fan-out strategy and rationale -------------------------------- We must
178+
* deliver didChangeConfiguration to every running instance of the language
179+
* server for this provider's id, regardless of how LSP4E can find it. LSP4E
180+
* discovery varies by scope, so we notify in 3 passes and de-duplicate: 1)
181+
* Workspace-wide (null project): catches singleton or workspace-folder-aware
182+
* servers. 2) Per-project: picks up per-project servers that don't expose
183+
* workspace folders (eg JSTS). 3) Per-document (open editors): covers files
184+
* outside the workspace or not yet tied to a project.
186185
*
187186
* Note: withPreferredServer(...) only reorders candidates; it does not filter.
188187
* We therefore compare wrapper.serverDefinition for equality and track already
189-
* notified LanguageServer proxies to avoid duplicate notifications across scopes.
190-
* excludeInactive() is intentional to avoid starting servers as a side-effect
191-
* of a preference change.
188+
* notified LanguageServer proxies to avoid duplicate notifications across
189+
* scopes. excludeInactive() is intentional to avoid starting servers as a
190+
* side-effect of a preference change.
192191
*/
193192

194193
final Set<LanguageServer> notifiedServers = ConcurrentHashMap.newKeySet();
@@ -202,14 +201,16 @@ public void propertyChange(PropertyChangeEvent event) {
202201
return CompletableFuture.completedFuture(null);
203202
});
204203

205-
// 2) Per-project: include servers that don't support workspace folders (they won't be returned by forProject(null))
204+
// 2) Per-project: include servers that don't support workspace folders (they
205+
// won't be returned by forProject(null))
206206
for (final IProject project : ResourcesPlugin.getWorkspace().getRoot().getProjects()) {
207207
if (!project.isOpen())
208208
continue;
209209

210210
LanguageServers.forProject(project).withPreferredServer(languageServerDefinition).excludeInactive()
211211
.collectAll((wrapper, server) -> {
212-
if (languageServerDefinition.equals(wrapper.serverDefinition) && notifiedServers.add(server)) {
212+
if (languageServerDefinition.equals(wrapper.serverDefinition)
213+
&& notifiedServers.add(server)) {
213214
server.getWorkspaceService().didChangeConfiguration(params);
214215
}
215216
return CompletableFuture.completedFuture(null);
@@ -220,7 +221,7 @@ public void propertyChange(PropertyChangeEvent event) {
220221
for (final IWorkbenchWindow win : PlatformUI.getWorkbench().getWorkbenchWindows()) {
221222
for (final IWorkbenchPage page : win.getPages()) {
222223
for (final IEditorReference ref : page.getEditorReferences()) {
223-
final IEditorPart editor = ref.getEditor(false); // do not restore unopened editors
224+
final IEditorPart editor = ref.getEditor(false); // do not restore unopened editors
224225
if (editor == null)
225226
continue;
226227

@@ -230,7 +231,8 @@ public void propertyChange(PropertyChangeEvent event) {
230231

231232
LanguageServers.forDocument(doc).withPreferredServer(languageServerDefinition)
232233
.collectAll((wrapper, server) -> {
233-
if (languageServerDefinition.equals(wrapper.serverDefinition) && notifiedServers.add(server)) {
234+
if (languageServerDefinition.equals(wrapper.serverDefinition)
235+
&& notifiedServers.add(server)) {
234236
server.getWorkspaceService().didChangeConfiguration(params);
235237
}
236238
return CompletableFuture.completedFuture(null);

0 commit comments

Comments
 (0)