diff --git a/bundles/org.eclipse.cdt.lsp.clangd/OSGI-INF/org.eclipse.cdt.lsp.internal.clangd.ClangdFallbackManager.xml b/bundles/org.eclipse.cdt.lsp.clangd/OSGI-INF/org.eclipse.cdt.lsp.internal.clangd.ClangdFallbackManager.xml
index 9f125db1..2762d073 100644
--- a/bundles/org.eclipse.cdt.lsp.clangd/OSGI-INF/org.eclipse.cdt.lsp.internal.clangd.ClangdFallbackManager.xml
+++ b/bundles/org.eclipse.cdt.lsp.clangd/OSGI-INF/org.eclipse.cdt.lsp.internal.clangd.ClangdFallbackManager.xml
@@ -4,7 +4,7 @@
-
+
\ No newline at end of file
diff --git a/bundles/org.eclipse.cdt.lsp.clangd/src/org/eclipse/cdt/lsp/clangd/ClangdConfiguration.java b/bundles/org.eclipse.cdt.lsp.clangd/src/org/eclipse/cdt/lsp/clangd/ClangdConfiguration.java
index 7413ee85..e2fe1b41 100644
--- a/bundles/org.eclipse.cdt.lsp.clangd/src/org/eclipse/cdt/lsp/clangd/ClangdConfiguration.java
+++ b/bundles/org.eclipse.cdt.lsp.clangd/src/org/eclipse/cdt/lsp/clangd/ClangdConfiguration.java
@@ -16,7 +16,7 @@
import java.net.URI;
import java.util.List;
-import org.eclipse.cdt.lsp.editor.Configuration;
+import org.eclipse.cdt.lsp.config.Configuration;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.preferences.IScopeContext;
import org.eclipse.lsp4e.server.ProcessStreamConnectionProvider;
diff --git a/bundles/org.eclipse.cdt.lsp.clangd/src/org/eclipse/cdt/lsp/clangd/ClangdConfigurationFileManager.java b/bundles/org.eclipse.cdt.lsp.clangd/src/org/eclipse/cdt/lsp/clangd/ClangdConfigurationFileManager.java
index eab32250..46829823 100644
--- a/bundles/org.eclipse.cdt.lsp.clangd/src/org/eclipse/cdt/lsp/clangd/ClangdConfigurationFileManager.java
+++ b/bundles/org.eclipse.cdt.lsp.clangd/src/org/eclipse/cdt/lsp/clangd/ClangdConfigurationFileManager.java
@@ -26,7 +26,7 @@
import org.eclipse.cdt.core.settings.model.CProjectDescriptionEvent;
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
import org.eclipse.cdt.core.settings.model.ICProjectDescription;
-import org.eclipse.cdt.lsp.LspPlugin;
+import org.eclipse.cdt.lsp.plugin.LspPlugin;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
diff --git a/bundles/org.eclipse.cdt.lsp.clangd/src/org/eclipse/cdt/lsp/internal/clangd/ClangdConfigurationAccess.java b/bundles/org.eclipse.cdt.lsp.clangd/src/org/eclipse/cdt/lsp/internal/clangd/ClangdConfigurationAccess.java
index 3fd44255..80d7cad2 100644
--- a/bundles/org.eclipse.cdt.lsp.clangd/src/org/eclipse/cdt/lsp/internal/clangd/ClangdConfigurationAccess.java
+++ b/bundles/org.eclipse.cdt.lsp.clangd/src/org/eclipse/cdt/lsp/internal/clangd/ClangdConfigurationAccess.java
@@ -21,7 +21,7 @@
import org.eclipse.cdt.lsp.clangd.ClangdMetadata;
import org.eclipse.cdt.lsp.clangd.ClangdOptions;
import org.eclipse.cdt.lsp.clangd.ClangdQualifier;
-import org.eclipse.cdt.lsp.editor.ConfigurationAccess;
+import org.eclipse.cdt.lsp.config.ConfigurationAccess;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.ProjectScope;
import org.eclipse.core.runtime.preferences.DefaultScope;
diff --git a/bundles/org.eclipse.cdt.lsp.clangd/src/org/eclipse/cdt/lsp/internal/clangd/ClangdFallbackManager.java b/bundles/org.eclipse.cdt.lsp.clangd/src/org/eclipse/cdt/lsp/internal/clangd/ClangdFallbackManager.java
index 66d59f03..d899ceec 100644
--- a/bundles/org.eclipse.cdt.lsp.clangd/src/org/eclipse/cdt/lsp/internal/clangd/ClangdFallbackManager.java
+++ b/bundles/org.eclipse.cdt.lsp.clangd/src/org/eclipse/cdt/lsp/internal/clangd/ClangdFallbackManager.java
@@ -20,8 +20,8 @@
import org.eclipse.cdt.core.build.ICBuildConfigurationManager;
import org.eclipse.cdt.core.parser.IScannerInfo;
import org.eclipse.cdt.lsp.ExistingResource;
-import org.eclipse.cdt.lsp.InitialUri;
import org.eclipse.cdt.lsp.clangd.ClangdFallbackFlags;
+import org.eclipse.cdt.lsp.editor.InitialUri;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.runtime.CoreException;
diff --git a/bundles/org.eclipse.cdt.lsp.clangd/src/org/eclipse/cdt/lsp/internal/clangd/ClangdLanguageServerProvider.java b/bundles/org.eclipse.cdt.lsp.clangd/src/org/eclipse/cdt/lsp/internal/clangd/ClangdLanguageServerProvider.java
index 413e718d..197e75c4 100644
--- a/bundles/org.eclipse.cdt.lsp.clangd/src/org/eclipse/cdt/lsp/internal/clangd/ClangdLanguageServerProvider.java
+++ b/bundles/org.eclipse.cdt.lsp.clangd/src/org/eclipse/cdt/lsp/internal/clangd/ClangdLanguageServerProvider.java
@@ -23,7 +23,7 @@
import org.eclipse.cdt.lsp.clangd.ClangdConfiguration;
import org.eclipse.cdt.lsp.clangd.ClangdFallbackFlags;
-import org.eclipse.cdt.lsp.editor.Configuration;
+import org.eclipse.cdt.lsp.config.Configuration;
import org.eclipse.cdt.lsp.editor.LanguageServerEnable;
import org.eclipse.cdt.lsp.server.ICLanguageServerProvider;
import org.eclipse.core.resources.IProject;
diff --git a/bundles/org.eclipse.cdt.lsp.clangd/src/org/eclipse/cdt/lsp/internal/clangd/editor/ClangdConfigurationArea.java b/bundles/org.eclipse.cdt.lsp.clangd/src/org/eclipse/cdt/lsp/internal/clangd/editor/ClangdConfigurationArea.java
index 0fa27266..516dd8bf 100644
--- a/bundles/org.eclipse.cdt.lsp.clangd/src/org/eclipse/cdt/lsp/internal/clangd/editor/ClangdConfigurationArea.java
+++ b/bundles/org.eclipse.cdt.lsp.clangd/src/org/eclipse/cdt/lsp/internal/clangd/editor/ClangdConfigurationArea.java
@@ -21,7 +21,7 @@
import org.eclipse.cdt.lsp.clangd.ClangdMetadata;
import org.eclipse.cdt.lsp.clangd.ClangdOptions;
-import org.eclipse.cdt.lsp.editor.ConfigurationArea;
+import org.eclipse.cdt.lsp.ui.ConfigurationArea;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.core.runtime.preferences.OsgiPreferenceMetadataStore;
import org.eclipse.core.runtime.preferences.PreferenceMetadata;
diff --git a/bundles/org.eclipse.cdt.lsp.clangd/src/org/eclipse/cdt/lsp/internal/clangd/editor/ClangdConfigurationPage.java b/bundles/org.eclipse.cdt.lsp.clangd/src/org/eclipse/cdt/lsp/internal/clangd/editor/ClangdConfigurationPage.java
index 796dd76e..5e31abe8 100644
--- a/bundles/org.eclipse.cdt.lsp.clangd/src/org/eclipse/cdt/lsp/internal/clangd/editor/ClangdConfigurationPage.java
+++ b/bundles/org.eclipse.cdt.lsp.clangd/src/org/eclipse/cdt/lsp/internal/clangd/editor/ClangdConfigurationPage.java
@@ -16,13 +16,13 @@
import java.io.IOException;
-import org.eclipse.cdt.lsp.LspUtils;
import org.eclipse.cdt.lsp.clangd.ClangdConfiguration;
import org.eclipse.cdt.lsp.clangd.ClangdMetadata;
import org.eclipse.cdt.lsp.clangd.ClangdOptions;
-import org.eclipse.cdt.lsp.editor.Configuration;
-import org.eclipse.cdt.lsp.editor.ConfigurationArea;
-import org.eclipse.cdt.lsp.editor.EditorConfigurationPage;
+import org.eclipse.cdt.lsp.config.Configuration;
+import org.eclipse.cdt.lsp.ui.ConfigurationArea;
+import org.eclipse.cdt.lsp.ui.EditorConfigurationPage;
+import org.eclipse.cdt.lsp.util.LspUtils;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.dialogs.IDialogConstants;
diff --git a/bundles/org.eclipse.cdt.lsp.clangd/src/org/eclipse/cdt/lsp/internal/clangd/editor/CompileCommandsMonitor.java b/bundles/org.eclipse.cdt.lsp.clangd/src/org/eclipse/cdt/lsp/internal/clangd/editor/CompileCommandsMonitor.java
index c3444be2..18de44b4 100644
--- a/bundles/org.eclipse.cdt.lsp.clangd/src/org/eclipse/cdt/lsp/internal/clangd/editor/CompileCommandsMonitor.java
+++ b/bundles/org.eclipse.cdt.lsp.clangd/src/org/eclipse/cdt/lsp/internal/clangd/editor/CompileCommandsMonitor.java
@@ -23,7 +23,7 @@
import java.util.concurrent.TimeUnit;
import java.util.stream.Stream;
-import org.eclipse.cdt.lsp.LspUtils;
+import org.eclipse.cdt.lsp.util.LspUtils;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
diff --git a/bundles/org.eclipse.cdt.lsp.clangd/src/org/eclipse/cdt/lsp/internal/clangd/editor/expressions/LspEditorActiveTester.java b/bundles/org.eclipse.cdt.lsp.clangd/src/org/eclipse/cdt/lsp/internal/clangd/editor/expressions/LspEditorActiveTester.java
index 37b1524b..44986039 100644
--- a/bundles/org.eclipse.cdt.lsp.clangd/src/org/eclipse/cdt/lsp/internal/clangd/editor/expressions/LspEditorActiveTester.java
+++ b/bundles/org.eclipse.cdt.lsp.clangd/src/org/eclipse/cdt/lsp/internal/clangd/editor/expressions/LspEditorActiveTester.java
@@ -14,7 +14,7 @@
import java.util.Optional;
-import org.eclipse.cdt.lsp.LspPlugin;
+import org.eclipse.cdt.lsp.plugin.LspPlugin;
import org.eclipse.core.expressions.PropertyTester;
import org.eclipse.core.runtime.Adapters;
import org.eclipse.ui.IEditorPart;
diff --git a/bundles/org.eclipse.cdt.lsp.clangd/src/org/eclipse/cdt/lsp/internal/clangd/editor/handlers/ToggleSourceAndHeaderCommandHandler.java b/bundles/org.eclipse.cdt.lsp.clangd/src/org/eclipse/cdt/lsp/internal/clangd/editor/handlers/ToggleSourceAndHeaderCommandHandler.java
index c58c3b08..d1782ec3 100644
--- a/bundles/org.eclipse.cdt.lsp.clangd/src/org/eclipse/cdt/lsp/internal/clangd/editor/handlers/ToggleSourceAndHeaderCommandHandler.java
+++ b/bundles/org.eclipse.cdt.lsp.clangd/src/org/eclipse/cdt/lsp/internal/clangd/editor/handlers/ToggleSourceAndHeaderCommandHandler.java
@@ -15,8 +15,8 @@
import java.net.URI;
import java.util.Optional;
-import org.eclipse.cdt.lsp.LspPlugin;
import org.eclipse.cdt.lsp.internal.clangd.editor.ClangdPlugin;
+import org.eclipse.cdt.lsp.plugin.LspPlugin;
import org.eclipse.cdt.lsp.services.ClangdLanguageServer;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
diff --git a/bundles/org.eclipse.cdt.lsp.test/fragment.xml b/bundles/org.eclipse.cdt.lsp.test/fragment.xml
index ec2b7919..3d903e6c 100644
--- a/bundles/org.eclipse.cdt.lsp.test/fragment.xml
+++ b/bundles/org.eclipse.cdt.lsp.test/fragment.xml
@@ -4,7 +4,7 @@
diff --git a/bundles/org.eclipse.cdt.lsp.test/src/org/eclipse/cdt/lsp/test/TestUtils.java b/bundles/org.eclipse.cdt.lsp.test/src/org/eclipse/cdt/lsp/test/TestUtils.java
index b1167b65..ae57d59f 100644
--- a/bundles/org.eclipse.cdt.lsp.test/src/org/eclipse/cdt/lsp/test/TestUtils.java
+++ b/bundles/org.eclipse.cdt.lsp.test/src/org/eclipse/cdt/lsp/test/TestUtils.java
@@ -17,12 +17,15 @@
import java.io.UnsupportedEncodingException;
import java.net.URI;
+import org.eclipse.cdt.lsp.config.Configuration;
+import org.eclipse.cdt.lsp.editor.EditorMetadata;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IProjectDescription;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.ServiceCaller;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
@@ -33,6 +36,11 @@
public class TestUtils {
+ public static void setLspPreferred(IProject project, boolean value) {
+ ServiceCaller.callOnce(TestUtils.class, Configuration.class, //
+ cc -> cc.storage(project).save(value, ((EditorMetadata) cc.metadata()).preferLspEditor()));
+ }
+
public static IProject createCProject(String projectName) throws CoreException {
IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
if (project.exists()) {
diff --git a/bundles/org.eclipse.cdt.lsp.test/src/org/eclipse/cdt/lsp/test/server/CLanguageServerProviderTest.java b/bundles/org.eclipse.cdt.lsp.test/src/org/eclipse/cdt/lsp/test/internal/server/CLanguageServerProviderTest.java
similarity index 93%
rename from bundles/org.eclipse.cdt.lsp.test/src/org/eclipse/cdt/lsp/test/server/CLanguageServerProviderTest.java
rename to bundles/org.eclipse.cdt.lsp.test/src/org/eclipse/cdt/lsp/test/internal/server/CLanguageServerProviderTest.java
index 044e697d..1fd67424 100644
--- a/bundles/org.eclipse.cdt.lsp.test/src/org/eclipse/cdt/lsp/test/server/CLanguageServerProviderTest.java
+++ b/bundles/org.eclipse.cdt.lsp.test/src/org/eclipse/cdt/lsp/test/internal/server/CLanguageServerProviderTest.java
@@ -10,11 +10,11 @@
* Gesa Hentschke (Bachmann electronic GmbH) - initial implementation
*******************************************************************************/
-package org.eclipse.cdt.lsp.test.server;
+package org.eclipse.cdt.lsp.test.internal.server;
import static org.junit.jupiter.api.Assertions.assertTrue;
-import org.eclipse.cdt.lsp.LspPlugin;
+import org.eclipse.cdt.lsp.plugin.LspPlugin;
import org.eclipse.cdt.lsp.server.ICLanguageServerProvider;
import org.eclipse.core.runtime.CoreException;
import org.junit.jupiter.api.Test;
diff --git a/bundles/org.eclipse.cdt.lsp.test/src/org/eclipse/cdt/lsp/test/server/enable/HasLanguageServerPropertyTesterTest.java b/bundles/org.eclipse.cdt.lsp.test/src/org/eclipse/cdt/lsp/test/internal/server/HasLanguageServerPropertyTesterTest.java
similarity index 95%
rename from bundles/org.eclipse.cdt.lsp.test/src/org/eclipse/cdt/lsp/test/server/enable/HasLanguageServerPropertyTesterTest.java
rename to bundles/org.eclipse.cdt.lsp.test/src/org/eclipse/cdt/lsp/test/internal/server/HasLanguageServerPropertyTesterTest.java
index b781a9b1..fc99cd2a 100644
--- a/bundles/org.eclipse.cdt.lsp.test/src/org/eclipse/cdt/lsp/test/server/enable/HasLanguageServerPropertyTesterTest.java
+++ b/bundles/org.eclipse.cdt.lsp.test/src/org/eclipse/cdt/lsp/test/internal/server/HasLanguageServerPropertyTesterTest.java
@@ -10,7 +10,7 @@
* Gesa Hentschke (Bachmann electronic GmbH) - initial implementation
*******************************************************************************/
-package org.eclipse.cdt.lsp.test.server.enable;
+package org.eclipse.cdt.lsp.test.internal.server;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -18,8 +18,8 @@
import java.io.File;
import java.io.IOException;
-import org.eclipse.cdt.lsp.LspPlugin;
-import org.eclipse.cdt.lsp.server.enable.HasLanguageServerPropertyTester;
+import org.eclipse.cdt.lsp.internal.server.HasLanguageServerPropertyTester;
+import org.eclipse.cdt.lsp.plugin.LspPlugin;
import org.eclipse.cdt.lsp.test.TestUtils;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
diff --git a/tests/org.eclipse.cdt.lsp.clangd.tests/src/org/eclipse/cdt/lsp/clangd/editor/tests/expressions/LspEditorPreferencesTesterTest.java b/bundles/org.eclipse.cdt.lsp.test/src/org/eclipse/cdt/lsp/test/internal/server/LspEditorPreferencesTesterTest.java
similarity index 89%
rename from tests/org.eclipse.cdt.lsp.clangd.tests/src/org/eclipse/cdt/lsp/clangd/editor/tests/expressions/LspEditorPreferencesTesterTest.java
rename to bundles/org.eclipse.cdt.lsp.test/src/org/eclipse/cdt/lsp/test/internal/server/LspEditorPreferencesTesterTest.java
index 262f52b7..4713d5aa 100644
--- a/tests/org.eclipse.cdt.lsp.clangd.tests/src/org/eclipse/cdt/lsp/clangd/editor/tests/expressions/LspEditorPreferencesTesterTest.java
+++ b/bundles/org.eclipse.cdt.lsp.test/src/org/eclipse/cdt/lsp/test/internal/server/LspEditorPreferencesTesterTest.java
@@ -12,7 +12,7 @@
* Alexander Fedorov (ArSysOp) - extract headless part
*******************************************************************************/
-package org.eclipse.cdt.lsp.clangd.editor.tests.expressions;
+package org.eclipse.cdt.lsp.test.internal.server;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -21,11 +21,10 @@
import java.io.IOException;
import java.io.UnsupportedEncodingException;
-import org.eclipse.cdt.lsp.LspPlugin;
-import org.eclipse.cdt.lsp.clangd.editor.tests.EditorTestUtils;
-import org.eclipse.cdt.lsp.clangd.tests.TestUtils;
+import org.eclipse.cdt.lsp.internal.server.HasLanguageServerPropertyTester;
+import org.eclipse.cdt.lsp.plugin.LspPlugin;
import org.eclipse.cdt.lsp.server.ICLanguageServerProvider;
-import org.eclipse.cdt.lsp.server.enable.HasLanguageServerPropertyTester;
+import org.eclipse.cdt.lsp.test.TestUtils;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.junit.jupiter.api.AfterEach;
@@ -105,10 +104,10 @@ public void testEditorUsedToOpenCppFile_WITHOUT_LsEditorPreferred()
//AND a file exits in the given project:
var file = TestUtils.createFile(project, MAIN_CPP, FILE_CONTENT);
//WHEN this file will be opened:
- var editorPart = EditorTestUtils.openInEditor(file);
+ var editorPart = TestUtils.openInEditor(file);
//THEN it will be opened in the C/C++ Editor:
assertEquals(LspPlugin.C_EDITOR_ID, editorPart.getEditorSite().getId());
- EditorTestUtils.closeEditor(editorPart, false);
+ TestUtils.closeEditor(editorPart, false);
}
/**
@@ -123,10 +122,10 @@ public void testEditorUsedToOpenCppFile_WITH_LsEditorPreferred()
//AND a file exits in the given project:
var file = TestUtils.createFile(project, MAIN_CPP, FILE_CONTENT);
//WHEN this file will be opened:
- var editorPart = EditorTestUtils.openInEditor(file);
+ var editorPart = TestUtils.openInEditor(file);
//THEN it will be opened in the C/C++ Editor (LSP):
assertEquals(LspPlugin.LSP_C_EDITOR_ID, editorPart.getEditorSite().getId());
- EditorTestUtils.closeEditor(editorPart, false);
+ TestUtils.closeEditor(editorPart, false);
}
/**
@@ -141,10 +140,10 @@ public void testEditorUsedToOpenCppHeaderFile_WITHOUT_LsEditorPreferred()
//AND a file exits in the given project:
var file = TestUtils.createFile(project, HEADER_HPP, FILE_CONTENT);
//WHEN this file will be opened:
- var editorPart = EditorTestUtils.openInEditor(file);
+ var editorPart = TestUtils.openInEditor(file);
//THEN it will be opened in the C/C++ Editor:
assertEquals(LspPlugin.C_EDITOR_ID, editorPart.getEditorSite().getId());
- EditorTestUtils.closeEditor(editorPart, false);
+ TestUtils.closeEditor(editorPart, false);
}
/**
@@ -159,10 +158,10 @@ public void testEditorUsedToOpenCppHeaderFile_WITH_LsEditorPreferred()
//AND a file exits in the given project:
var file = TestUtils.createFile(project, HEADER_HPP, FILE_CONTENT);
//WHEN this file will be opened:
- var editorPart = EditorTestUtils.openInEditor(file);
+ var editorPart = TestUtils.openInEditor(file);
//THEN it will be opened in the C/C++ Editor (LSP):
assertEquals(LspPlugin.LSP_C_EDITOR_ID, editorPart.getEditorSite().getId());
- EditorTestUtils.closeEditor(editorPart, false);
+ TestUtils.closeEditor(editorPart, false);
}
/**
@@ -177,10 +176,10 @@ public void testEditorUsedToOpenCFile_WITHOUT_LsEditorPreferred()
//AND a file exits in the given project:
var file = TestUtils.createFile(project, MAIN_C, FILE_CONTENT);
//WHEN this file will be opened:
- var editorPart = EditorTestUtils.openInEditor(file);
+ var editorPart = TestUtils.openInEditor(file);
//THEN it will be opened in the C/C++ Editor:
assertEquals(LspPlugin.C_EDITOR_ID, editorPart.getEditorSite().getId());
- EditorTestUtils.closeEditor(editorPart, false);
+ TestUtils.closeEditor(editorPart, false);
}
/**
@@ -194,10 +193,10 @@ public void testEditorUsedToOpenCFile_WITH_LsEditorPreferred() throws CoreExcept
//AND a file exits in the given project:
var file = TestUtils.createFile(project, MAIN_C, FILE_CONTENT);
//WHEN this file will be opened:
- var editorPart = EditorTestUtils.openInEditor(file);
+ var editorPart = TestUtils.openInEditor(file);
//THEN it will be opened in the C/C++ Editor (LSP):
assertEquals(LspPlugin.LSP_C_EDITOR_ID, editorPart.getEditorSite().getId());
- EditorTestUtils.closeEditor(editorPart, false);
+ TestUtils.closeEditor(editorPart, false);
}
/**
@@ -212,10 +211,10 @@ public void testEditorUsedToOpenCHeaderFile_WITHOUT_LsEditorPreferred()
//AND a file exits in the given project:
var file = TestUtils.createFile(project, HEADER_HPP, FILE_CONTENT);
//WHEN this file will be opened:
- var editorPart = EditorTestUtils.openInEditor(file);
+ var editorPart = TestUtils.openInEditor(file);
//THEN it will be opened in the C/C++ Editor:
assertEquals(LspPlugin.C_EDITOR_ID, editorPart.getEditorSite().getId());
- EditorTestUtils.closeEditor(editorPart, false);
+ TestUtils.closeEditor(editorPart, false);
}
/**
@@ -230,10 +229,10 @@ public void testEditorUsedToOpenCHeaderFile_WITH_LsEditorPreferred()
//AND a file exits in the given project:
var file = TestUtils.createFile(project, HEADER_H, FILE_CONTENT);
//WHEN this file will be opened:
- var editorPart = EditorTestUtils.openInEditor(file);
+ var editorPart = TestUtils.openInEditor(file);
//THEN it will be opened in the C/C++ Editor (LSP):
assertEquals(LspPlugin.LSP_C_EDITOR_ID, editorPart.getEditorSite().getId());
- EditorTestUtils.closeEditor(editorPart, false);
+ TestUtils.closeEditor(editorPart, false);
}
//**********************************************************************************************************************************
@@ -253,7 +252,7 @@ public void testLsNotEnabledByTabSwitchFromLspToNonLspProjectFile()
//AND a file exists in the given project:
var lspProjectFile = TestUtils.createFile(project, MAIN_C, FILE_CONTENT);
//AND this file will be opened:
- var lspEditorPart = EditorTestUtils.openInEditor(lspProjectFile);
+ var lspEditorPart = TestUtils.openInEditor(lspProjectFile);
//AND a second project with DISABLED "Prefer C/C++ Editor (LSP)" in the preferences:
var nonLspProject = TestUtils.createCProject("NonLspProject");
TestUtils.setLspPreferred(nonLspProject, false);
@@ -262,15 +261,15 @@ public void testLsNotEnabledByTabSwitchFromLspToNonLspProjectFile()
//THEN the LS won't be enabled for the non LSP project file:
assertTrue(!new HasLanguageServerPropertyTester().test(nonLspProjectFile.getLocationURI(), null, null, null));
//AND those file has been be opened:
- var nonLspEditorPart = EditorTestUtils.openInEditor(nonLspProjectFile);
+ var nonLspEditorPart = TestUtils.openInEditor(nonLspProjectFile);
//THEN the file from the project with enabled "Prefer C/C++ Editor (LSP)" has been opened in the C/C++ Editor (LSP):
assertEquals(LspPlugin.LSP_C_EDITOR_ID, lspEditorPart.getEditorSite().getId());
//THEN the file from the project with disabled "Prefer C/C++ Editor (LSP)" has been opened in the C/C++ Editor:
assertEquals(LspPlugin.C_EDITOR_ID, nonLspEditorPart.getEditorSite().getId());
//clean-up:
- EditorTestUtils.closeEditor(lspEditorPart, false);
- EditorTestUtils.closeEditor(nonLspEditorPart, false);
+ TestUtils.closeEditor(lspEditorPart, false);
+ TestUtils.closeEditor(nonLspEditorPart, false);
TestUtils.deleteProject(nonLspProject);
}
@@ -286,7 +285,7 @@ public void testLsEnableByHyperlinkFromLspFileToExternalFile() throws CoreExcept
//AND a file exists in the given project:
var lspProjectFile = TestUtils.createFile(project, MAIN_C, FILE_CONTENT);
//AND this file has been opened:
- var lspEditorPart = EditorTestUtils.openInEditor(lspProjectFile);
+ var lspEditorPart = TestUtils.openInEditor(lspProjectFile);
//WHEN an external header file shall be opened in the C/C++ Editor:
File externalFile = new File(TEMP_DIR, EXTERNAL_HEADER_HPP);
externalFile.createNewFile();
@@ -294,7 +293,7 @@ public void testLsEnableByHyperlinkFromLspFileToExternalFile() throws CoreExcept
assertTrue(new HasLanguageServerPropertyTester().test(externalFile.toURI(), null, null, null));
//clean-up:
- EditorTestUtils.closeEditor(lspEditorPart, false);
+ TestUtils.closeEditor(lspEditorPart, false);
externalFile.delete();
}
diff --git a/bundles/org.eclipse.cdt.lsp.test/src/org/eclipse/cdt/lsp/test/server/MockCLanguageServerProvider.java b/bundles/org.eclipse.cdt.lsp.test/src/org/eclipse/cdt/lsp/test/internal/server/MockCLanguageServerProvider.java
similarity index 67%
rename from bundles/org.eclipse.cdt.lsp.test/src/org/eclipse/cdt/lsp/test/server/MockCLanguageServerProvider.java
rename to bundles/org.eclipse.cdt.lsp.test/src/org/eclipse/cdt/lsp/test/internal/server/MockCLanguageServerProvider.java
index be757368..c33770fe 100644
--- a/bundles/org.eclipse.cdt.lsp.test/src/org/eclipse/cdt/lsp/test/server/MockCLanguageServerProvider.java
+++ b/bundles/org.eclipse.cdt.lsp.test/src/org/eclipse/cdt/lsp/test/internal/server/MockCLanguageServerProvider.java
@@ -11,16 +11,21 @@
* Alexander Fedorov (ArSysOp) - rework access to preferences
*******************************************************************************/
-package org.eclipse.cdt.lsp.test.server;
+package org.eclipse.cdt.lsp.test.internal.server;
import java.net.URI;
import java.util.Collections;
import java.util.List;
+import org.eclipse.cdt.lsp.config.Configuration;
+import org.eclipse.cdt.lsp.editor.LanguageServerEnable;
import org.eclipse.cdt.lsp.server.ICLanguageServerProvider;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.ServiceCaller;
public class MockCLanguageServerProvider implements ICLanguageServerProvider {
+ private final ServiceCaller editorConfiguration = new ServiceCaller<>(getClass(),
+ Configuration.class);
@Override
public List getCommands(URI rootUri) {
@@ -29,7 +34,9 @@ public List getCommands(URI rootUri) {
@Override
public boolean isEnabledFor(IProject project) {
- return false;
+ boolean[] enabled = new boolean[1];
+ editorConfiguration.call(c -> enabled[0] = ((LanguageServerEnable) c.options(project)).isEnabledFor(project));
+ return enabled[0];
}
}
diff --git a/bundles/org.eclipse.cdt.lsp.test/src/org/eclipse/cdt/lsp/test/LspUtilsTest.java b/bundles/org.eclipse.cdt.lsp.test/src/org/eclipse/cdt/lsp/test/util/LspUtilsTest.java
similarity index 94%
rename from bundles/org.eclipse.cdt.lsp.test/src/org/eclipse/cdt/lsp/test/LspUtilsTest.java
rename to bundles/org.eclipse.cdt.lsp.test/src/org/eclipse/cdt/lsp/test/util/LspUtilsTest.java
index 22ec7f33..e0d5df4f 100644
--- a/bundles/org.eclipse.cdt.lsp.test/src/org/eclipse/cdt/lsp/test/LspUtilsTest.java
+++ b/bundles/org.eclipse.cdt.lsp.test/src/org/eclipse/cdt/lsp/test/util/LspUtilsTest.java
@@ -11,12 +11,12 @@
* Gesa Hentschke (Bachmann electronic GmbH) - initial implementation
*******************************************************************************/
-package org.eclipse.cdt.lsp.test;
+package org.eclipse.cdt.lsp.test.util;
import static org.junit.jupiter.api.Assertions.assertTrue;
import org.eclipse.cdt.core.CCorePlugin;
-import org.eclipse.cdt.lsp.LspUtils;
+import org.eclipse.cdt.lsp.util.LspUtils;
import org.junit.jupiter.api.Test;
class LspUtilsTest {
diff --git a/bundles/org.eclipse.cdt.lsp/META-INF/MANIFEST.MF b/bundles/org.eclipse.cdt.lsp/META-INF/MANIFEST.MF
index ebfe36f0..c1d10932 100644
--- a/bundles/org.eclipse.cdt.lsp/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.cdt.lsp/META-INF/MANIFEST.MF
@@ -2,15 +2,18 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name
Bundle-SymbolicName: org.eclipse.cdt.lsp;singleton:=true
-Bundle-Version: 1.0.0.qualifier
+Bundle-Version: 2.0.0.qualifier
Export-Package: org.eclipse.cdt.lsp,
+ org.eclipse.cdt.lsp.config;x-friends:="org.eclipse.cdt.lsp.clangd",
org.eclipse.cdt.lsp.editor,
+ org.eclipse.cdt.lsp.plugin;x-friends:="org.eclipse.cdt.lsp.clangd",
org.eclipse.cdt.lsp.server,
- org.eclipse.cdt.lsp.server.enable,
org.eclipse.cdt.lsp.services,
org.eclipse.cdt.lsp.services.ast,
- org.eclipse.cdt.lsp.services.symbolinfo
-Bundle-Activator: org.eclipse.cdt.lsp.LspPlugin
+ org.eclipse.cdt.lsp.services.symbolinfo,
+ org.eclipse.cdt.lsp.ui;x-friends:="org.eclipse.cdt.lsp.clangd",
+ org.eclipse.cdt.lsp.util;x-friends:="org.eclipse.cdt.lsp.clangd"
+Bundle-Activator: org.eclipse.cdt.lsp.plugin.LspPlugin
Bundle-Vendor: %Bundle-Vendor
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
@@ -36,9 +39,9 @@ Require-Bundle: org.eclipse.ui,
Bundle-RequiredExecutionEnvironment: JavaSE-17
Automatic-Module-Name: org.eclipse.cdt.lsp
Bundle-ActivationPolicy: lazy
-Service-Component: OSGI-INF/org.eclipse.cdt.lsp.editor.BuiltinEditorOptionsDefault.xml,
- OSGI-INF/org.eclipse.cdt.lsp.editor.DefaultConfigurationVisibility.xml,
- OSGI-INF/org.eclipse.cdt.lsp.editor.EditorConfigurationAccess.xml,
- OSGI-INF/org.eclipse.cdt.lsp.editor.EditorMetadataDefaults.xml,
- OSGI-INF/org.eclipse.cdt.lsp.editor.format.FormatOnSave.xml,
- OSGI-INF/org.eclipse.cdt.lsp.internal.InitialFileManager.xml
+Service-Component: OSGI-INF/org.eclipse.cdt.lsp.internal.editor.EditorMetadataDefaults.xml,
+ OSGI-INF/org.eclipse.cdt.lsp.internal.editor.FormatOnSave.xml,
+ OSGI-INF/org.eclipse.cdt.lsp.internal.editor.InitialFileManager.xml,
+ OSGI-INF/org.eclipse.cdt.lsp.internal.ui.BuiltinEditorOptionsDefault.xml,
+ OSGI-INF/org.eclipse.cdt.lsp.internal.ui.DefaultConfigurationVisibility.xml,
+ OSGI-INF/org.eclipse.cdt.lsp.internal.ui.EditorConfigurationAccess.xml
diff --git a/bundles/org.eclipse.cdt.lsp/OSGI-INF/org.eclipse.cdt.lsp.editor.EditorMetadataDefaults.xml b/bundles/org.eclipse.cdt.lsp/OSGI-INF/org.eclipse.cdt.lsp.internal.editor.EditorMetadataDefaults.xml
similarity index 69%
rename from bundles/org.eclipse.cdt.lsp/OSGI-INF/org.eclipse.cdt.lsp.editor.EditorMetadataDefaults.xml
rename to bundles/org.eclipse.cdt.lsp/OSGI-INF/org.eclipse.cdt.lsp.internal.editor.EditorMetadataDefaults.xml
index 12edd8ef..eef92159 100644
--- a/bundles/org.eclipse.cdt.lsp/OSGI-INF/org.eclipse.cdt.lsp.editor.EditorMetadataDefaults.xml
+++ b/bundles/org.eclipse.cdt.lsp/OSGI-INF/org.eclipse.cdt.lsp.internal.editor.EditorMetadataDefaults.xml
@@ -1,8 +1,8 @@
-
+
-
+
\ No newline at end of file
diff --git a/bundles/org.eclipse.cdt.lsp/OSGI-INF/org.eclipse.cdt.lsp.editor.format.FormatOnSave.xml b/bundles/org.eclipse.cdt.lsp/OSGI-INF/org.eclipse.cdt.lsp.internal.editor.FormatOnSave.xml
similarity index 65%
rename from bundles/org.eclipse.cdt.lsp/OSGI-INF/org.eclipse.cdt.lsp.editor.format.FormatOnSave.xml
rename to bundles/org.eclipse.cdt.lsp/OSGI-INF/org.eclipse.cdt.lsp.internal.editor.FormatOnSave.xml
index a24ed398..c67d09ad 100644
--- a/bundles/org.eclipse.cdt.lsp/OSGI-INF/org.eclipse.cdt.lsp.editor.format.FormatOnSave.xml
+++ b/bundles/org.eclipse.cdt.lsp/OSGI-INF/org.eclipse.cdt.lsp.internal.editor.FormatOnSave.xml
@@ -1,9 +1,9 @@
-
+
-
-
+
+
\ No newline at end of file
diff --git a/bundles/org.eclipse.cdt.lsp/OSGI-INF/org.eclipse.cdt.lsp.internal.InitialFileManager.xml b/bundles/org.eclipse.cdt.lsp/OSGI-INF/org.eclipse.cdt.lsp.internal.editor.InitialFileManager.xml
similarity index 55%
rename from bundles/org.eclipse.cdt.lsp/OSGI-INF/org.eclipse.cdt.lsp.internal.InitialFileManager.xml
rename to bundles/org.eclipse.cdt.lsp/OSGI-INF/org.eclipse.cdt.lsp.internal.editor.InitialFileManager.xml
index 209f290a..72903e4e 100644
--- a/bundles/org.eclipse.cdt.lsp/OSGI-INF/org.eclipse.cdt.lsp.internal.InitialFileManager.xml
+++ b/bundles/org.eclipse.cdt.lsp/OSGI-INF/org.eclipse.cdt.lsp.internal.editor.InitialFileManager.xml
@@ -1,8 +1,8 @@
-
+
-
+
-
+
\ No newline at end of file
diff --git a/bundles/org.eclipse.cdt.lsp/OSGI-INF/org.eclipse.cdt.lsp.editor.BuiltinEditorOptionsDefault.xml b/bundles/org.eclipse.cdt.lsp/OSGI-INF/org.eclipse.cdt.lsp.internal.ui.BuiltinEditorOptionsDefault.xml
similarity index 58%
rename from bundles/org.eclipse.cdt.lsp/OSGI-INF/org.eclipse.cdt.lsp.editor.BuiltinEditorOptionsDefault.xml
rename to bundles/org.eclipse.cdt.lsp/OSGI-INF/org.eclipse.cdt.lsp.internal.ui.BuiltinEditorOptionsDefault.xml
index 0859936b..8d9c5a86 100644
--- a/bundles/org.eclipse.cdt.lsp/OSGI-INF/org.eclipse.cdt.lsp.editor.BuiltinEditorOptionsDefault.xml
+++ b/bundles/org.eclipse.cdt.lsp/OSGI-INF/org.eclipse.cdt.lsp.internal.ui.BuiltinEditorOptionsDefault.xml
@@ -1,7 +1,7 @@
-
+
-
+
\ No newline at end of file
diff --git a/bundles/org.eclipse.cdt.lsp/OSGI-INF/org.eclipse.cdt.lsp.editor.DefaultConfigurationVisibility.xml b/bundles/org.eclipse.cdt.lsp/OSGI-INF/org.eclipse.cdt.lsp.internal.ui.DefaultConfigurationVisibility.xml
similarity index 63%
rename from bundles/org.eclipse.cdt.lsp/OSGI-INF/org.eclipse.cdt.lsp.editor.DefaultConfigurationVisibility.xml
rename to bundles/org.eclipse.cdt.lsp/OSGI-INF/org.eclipse.cdt.lsp.internal.ui.DefaultConfigurationVisibility.xml
index 50f1d3bf..ea2a589c 100644
--- a/bundles/org.eclipse.cdt.lsp/OSGI-INF/org.eclipse.cdt.lsp.editor.DefaultConfigurationVisibility.xml
+++ b/bundles/org.eclipse.cdt.lsp/OSGI-INF/org.eclipse.cdt.lsp.internal.ui.DefaultConfigurationVisibility.xml
@@ -1,8 +1,8 @@
-
+
-
+
\ No newline at end of file
diff --git a/bundles/org.eclipse.cdt.lsp/OSGI-INF/org.eclipse.cdt.lsp.editor.EditorConfigurationAccess.xml b/bundles/org.eclipse.cdt.lsp/OSGI-INF/org.eclipse.cdt.lsp.internal.ui.EditorConfigurationAccess.xml
similarity index 70%
rename from bundles/org.eclipse.cdt.lsp/OSGI-INF/org.eclipse.cdt.lsp.editor.EditorConfigurationAccess.xml
rename to bundles/org.eclipse.cdt.lsp/OSGI-INF/org.eclipse.cdt.lsp.internal.ui.EditorConfigurationAccess.xml
index 9058fcae..18bb6e9c 100644
--- a/bundles/org.eclipse.cdt.lsp/OSGI-INF/org.eclipse.cdt.lsp.editor.EditorConfigurationAccess.xml
+++ b/bundles/org.eclipse.cdt.lsp/OSGI-INF/org.eclipse.cdt.lsp.internal.ui.EditorConfigurationAccess.xml
@@ -1,10 +1,10 @@
-
+
-
+
-
+
\ No newline at end of file
diff --git a/bundles/org.eclipse.cdt.lsp/plugin.xml b/bundles/org.eclipse.cdt.lsp/plugin.xml
index 90f0c04f..11f30383 100644
--- a/bundles/org.eclipse.cdt.lsp/plugin.xml
+++ b/bundles/org.eclipse.cdt.lsp/plugin.xml
@@ -14,7 +14,7 @@
+ class="org.eclipse.cdt.lsp.internal.editor.EditorPreferenceInitializer">
@@ -129,7 +129,7 @@
@@ -137,7 +137,7 @@
point="org.eclipse.ui.navigator.navigatorContent">
@@ -209,7 +209,7 @@
@@ -264,21 +264,21 @@
+ class="org.eclipse.cdt.lsp.internal.editor.LspEditorFileImageDescriptor">
@@ -288,7 +288,7 @@
point="org.eclipse.ui.propertyPages">
diff --git a/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/editor/ResolveProjectScope.java b/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/ResolveProjectScope.java
similarity index 93%
rename from bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/editor/ResolveProjectScope.java
rename to bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/ResolveProjectScope.java
index 9b413f3f..f9d81073 100644
--- a/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/editor/ResolveProjectScope.java
+++ b/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/ResolveProjectScope.java
@@ -11,12 +11,11 @@
* Contributors:
* Alexander Fedorov (ArSysOp) - Initial API and implementation
*******************************************************************************/
-package org.eclipse.cdt.lsp.editor;
+package org.eclipse.cdt.lsp;
import java.util.Optional;
import java.util.function.Function;
-import org.eclipse.cdt.lsp.ResolveProject;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.ProjectScope;
diff --git a/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/editor/Configuration.java b/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/config/Configuration.java
similarity index 96%
rename from bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/editor/Configuration.java
rename to bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/config/Configuration.java
index 714c9691..ec6ca7fb 100644
--- a/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/editor/Configuration.java
+++ b/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/config/Configuration.java
@@ -1,4 +1,4 @@
-package org.eclipse.cdt.lsp.editor;
+package org.eclipse.cdt.lsp.config;
import java.net.URI;
diff --git a/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/editor/ConfigurationAccess.java b/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/config/ConfigurationAccess.java
similarity index 94%
rename from bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/editor/ConfigurationAccess.java
rename to bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/config/ConfigurationAccess.java
index e1f4e8a7..0d022044 100644
--- a/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/editor/ConfigurationAccess.java
+++ b/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/config/ConfigurationAccess.java
@@ -10,10 +10,11 @@
* See git history
*******************************************************************************/
-package org.eclipse.cdt.lsp.editor;
+package org.eclipse.cdt.lsp.config;
import java.util.Optional;
+import org.eclipse.cdt.lsp.ResolveProjectScope;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.ProjectScope;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
diff --git a/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/InitialUri.java b/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/editor/InitialUri.java
similarity index 95%
rename from bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/InitialUri.java
rename to bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/editor/InitialUri.java
index 4ce337e7..4998a716 100644
--- a/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/InitialUri.java
+++ b/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/editor/InitialUri.java
@@ -9,7 +9,7 @@
* Contributors:
* Alexander Fedorov (ArSysOp) - initial API
*******************************************************************************/
-package org.eclipse.cdt.lsp;
+package org.eclipse.cdt.lsp.editor;
import java.net.URI;
import java.util.Optional;
diff --git a/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/editor/CEditorAssociationOverride.java b/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/internal/editor/CEditorAssociationOverride.java
similarity index 97%
rename from bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/editor/CEditorAssociationOverride.java
rename to bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/internal/editor/CEditorAssociationOverride.java
index a91c07e8..2c89a351 100644
--- a/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/editor/CEditorAssociationOverride.java
+++ b/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/internal/editor/CEditorAssociationOverride.java
@@ -10,12 +10,12 @@
* Gesa Hentschke (Bachmann electronic GmbH) - initial implementation
*******************************************************************************/
-package org.eclipse.cdt.lsp.editor;
+package org.eclipse.cdt.lsp.internal.editor;
import org.eclipse.cdt.codan.core.model.IProblemReporter;
-import org.eclipse.cdt.lsp.LspPlugin;
-import org.eclipse.cdt.lsp.LspUtils;
+import org.eclipse.cdt.lsp.plugin.LspPlugin;
import org.eclipse.cdt.lsp.server.ICLanguageServerProvider;
+import org.eclipse.cdt.lsp.util.LspUtils;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
diff --git a/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/editor/DebugHoverProvider.java b/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/internal/editor/DebugHoverProvider.java
similarity index 98%
rename from bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/editor/DebugHoverProvider.java
rename to bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/internal/editor/DebugHoverProvider.java
index ac52d13e..a0080b02 100644
--- a/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/editor/DebugHoverProvider.java
+++ b/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/internal/editor/DebugHoverProvider.java
@@ -10,7 +10,7 @@
* See git history
*******************************************************************************/
-package org.eclipse.cdt.lsp.editor;
+package org.eclipse.cdt.lsp.internal.editor;
import java.util.Objects;
import java.util.Optional;
diff --git a/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/editor/EditorMetadataDefaults.java b/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/internal/editor/EditorMetadataDefaults.java
similarity index 93%
rename from bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/editor/EditorMetadataDefaults.java
rename to bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/internal/editor/EditorMetadataDefaults.java
index f70a713f..3433ae14 100644
--- a/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/editor/EditorMetadataDefaults.java
+++ b/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/internal/editor/EditorMetadataDefaults.java
@@ -1,4 +1,7 @@
-package org.eclipse.cdt.lsp.editor;
+package org.eclipse.cdt.lsp.internal.editor;
+
+import org.eclipse.cdt.lsp.editor.EditorMetadata;
+import org.eclipse.cdt.lsp.editor.EditorOptionsDefaults;
/*******************************************************************************
* Copyright (c) 2023 Contributors to the Eclipse Foundation.
diff --git a/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/editor/EditorPreferenceInitializer.java b/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/internal/editor/EditorPreferenceInitializer.java
similarity index 91%
rename from bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/editor/EditorPreferenceInitializer.java
rename to bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/internal/editor/EditorPreferenceInitializer.java
index 8d759843..05dd29da 100644
--- a/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/editor/EditorPreferenceInitializer.java
+++ b/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/internal/editor/EditorPreferenceInitializer.java
@@ -10,8 +10,10 @@
* See git history
*******************************************************************************/
-package org.eclipse.cdt.lsp.editor;
+package org.eclipse.cdt.lsp.internal.editor;
+import org.eclipse.cdt.lsp.config.Configuration;
+import org.eclipse.cdt.lsp.editor.EditorMetadata;
import org.eclipse.core.runtime.ServiceCaller;
import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
import org.eclipse.core.runtime.preferences.DefaultScope;
diff --git a/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/editor/EditorPreferredOptions.java b/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/internal/editor/EditorPreferredOptions.java
similarity index 89%
rename from bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/editor/EditorPreferredOptions.java
rename to bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/internal/editor/EditorPreferredOptions.java
index a8527239..53ee2d45 100644
--- a/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/editor/EditorPreferredOptions.java
+++ b/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/internal/editor/EditorPreferredOptions.java
@@ -10,11 +10,14 @@
* See git history
*******************************************************************************/
-package org.eclipse.cdt.lsp.editor;
+package org.eclipse.cdt.lsp.internal.editor;
import java.util.Objects;
import org.eclipse.cdt.lsp.PreferredOptions;
+import org.eclipse.cdt.lsp.editor.EditorMetadata;
+import org.eclipse.cdt.lsp.editor.EditorOptions;
+import org.eclipse.cdt.lsp.editor.LanguageServerEnable;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.preferences.IScopeContext;
diff --git a/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/editor/format/FormatOnSave.java b/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/internal/editor/FormatOnSave.java
similarity index 94%
rename from bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/editor/format/FormatOnSave.java
rename to bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/internal/editor/FormatOnSave.java
index 919a5fe6..b47beb3b 100644
--- a/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/editor/format/FormatOnSave.java
+++ b/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/internal/editor/FormatOnSave.java
@@ -10,9 +10,9 @@
* See git history
*******************************************************************************/
-package org.eclipse.cdt.lsp.editor.format;
+package org.eclipse.cdt.lsp.internal.editor;
-import org.eclipse.cdt.lsp.editor.Configuration;
+import org.eclipse.cdt.lsp.config.Configuration;
import org.eclipse.cdt.lsp.editor.EditorOptions;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jface.text.IDocument;
diff --git a/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/internal/InitialFileManager.java b/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/internal/editor/InitialFileManager.java
similarity index 93%
rename from bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/internal/InitialFileManager.java
rename to bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/internal/editor/InitialFileManager.java
index 3c0023cd..70463e78 100644
--- a/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/internal/InitialFileManager.java
+++ b/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/internal/editor/InitialFileManager.java
@@ -11,15 +11,15 @@
* Alexander Fedorov (ArSysOp) - rework to OSGi component
*******************************************************************************/
-package org.eclipse.cdt.lsp.internal;
+package org.eclipse.cdt.lsp.internal.editor;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.Optional;
-import org.eclipse.cdt.lsp.InitialUri;
-import org.eclipse.cdt.lsp.LspPlugin;
import org.eclipse.cdt.lsp.ExistingResource;
+import org.eclipse.cdt.lsp.editor.InitialUri;
+import org.eclipse.cdt.lsp.plugin.LspPlugin;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.Platform;
diff --git a/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/editor/LspEditorFileImageDescriptor.java b/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/internal/editor/LspEditorFileImageDescriptor.java
similarity index 92%
rename from bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/editor/LspEditorFileImageDescriptor.java
rename to bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/internal/editor/LspEditorFileImageDescriptor.java
index a9e5092b..e87d9b24 100644
--- a/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/editor/LspEditorFileImageDescriptor.java
+++ b/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/internal/editor/LspEditorFileImageDescriptor.java
@@ -9,12 +9,12 @@
* Contributors:
* See git history
*******************************************************************************/
-package org.eclipse.cdt.lsp.editor;
+package org.eclipse.cdt.lsp.internal.editor;
import java.net.URL;
import java.util.HashMap;
-import org.eclipse.cdt.lsp.LspPlugin;
+import org.eclipse.cdt.lsp.plugin.LspPlugin;
import org.eclipse.cdt.lsp.server.ICLanguageServerProvider;
import org.eclipse.cdt.ui.lsp.ICFileImageDescriptor;
import org.eclipse.core.resources.IProject;
@@ -54,7 +54,7 @@ public ImageDescriptor getHeaderImageDescriptor() {
@Override
public boolean isEnabled(IProject project) {
- return cLanguageServerProvider.isEnabledFor(project);
+ return cLanguageServerProvider != null ? cLanguageServerProvider.isEnabledFor(project) : false;
}
private final void declareRegistryImage(String key, String path) {
diff --git a/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/internal/editor/SpellingEnabled.java b/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/internal/editor/SpellingEnabled.java
index 0ff39d78..dd876aa3 100644
--- a/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/internal/editor/SpellingEnabled.java
+++ b/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/internal/editor/SpellingEnabled.java
@@ -15,7 +15,7 @@
import java.util.Optional;
-import org.eclipse.cdt.lsp.LspUtils;
+import org.eclipse.cdt.lsp.util.LspUtils;
import org.eclipse.core.expressions.PropertyTester;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.ui.IEditorInput;
diff --git a/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/internal/server/CLanguageServerRegistry.java b/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/internal/server/CLanguageServerRegistry.java
index 1fc39519..c0184393 100644
--- a/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/internal/server/CLanguageServerRegistry.java
+++ b/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/internal/server/CLanguageServerRegistry.java
@@ -15,7 +15,7 @@
import java.util.HashMap;
-import org.eclipse.cdt.lsp.LspPlugin;
+import org.eclipse.cdt.lsp.plugin.LspPlugin;
import org.eclipse.cdt.lsp.server.ICLanguageServerProvider;
import org.eclipse.core.runtime.Adapters;
import org.eclipse.core.runtime.CoreException;
diff --git a/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/internal/server/CLanguageServerStreamConnectionProvider.java b/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/internal/server/CLanguageServerStreamConnectionProvider.java
index ccb02151..69f5a3cf 100644
--- a/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/internal/server/CLanguageServerStreamConnectionProvider.java
+++ b/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/internal/server/CLanguageServerStreamConnectionProvider.java
@@ -15,7 +15,7 @@
import java.net.URI;
-import org.eclipse.cdt.lsp.LspPlugin;
+import org.eclipse.cdt.lsp.plugin.LspPlugin;
import org.eclipse.cdt.lsp.server.ICLanguageServerProvider;
import org.eclipse.lsp4e.server.ProcessStreamConnectionProvider;
diff --git a/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/server/enable/HasLanguageServerPropertyTester.java b/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/internal/server/HasLanguageServerPropertyTester.java
similarity index 95%
rename from bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/server/enable/HasLanguageServerPropertyTester.java
rename to bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/internal/server/HasLanguageServerPropertyTester.java
index f3f605ee..039118ee 100644
--- a/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/server/enable/HasLanguageServerPropertyTester.java
+++ b/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/internal/server/HasLanguageServerPropertyTester.java
@@ -12,7 +12,7 @@
* Alexander Fedorov (ArSysOp) - rework access to preferences
*******************************************************************************/
-package org.eclipse.cdt.lsp.server.enable;
+package org.eclipse.cdt.lsp.internal.server;
import java.io.File;
import java.net.URI;
@@ -21,10 +21,10 @@
import org.eclipse.cdt.core.model.ICProject;
import org.eclipse.cdt.core.model.ITranslationUnit;
import org.eclipse.cdt.lsp.ExistingResource;
-import org.eclipse.cdt.lsp.InitialUri;
-import org.eclipse.cdt.lsp.LspPlugin;
-import org.eclipse.cdt.lsp.LspUtils;
+import org.eclipse.cdt.lsp.editor.InitialUri;
+import org.eclipse.cdt.lsp.plugin.LspPlugin;
import org.eclipse.cdt.lsp.server.ICLanguageServerProvider;
+import org.eclipse.cdt.lsp.util.LspUtils;
import org.eclipse.core.expressions.PropertyTester;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspace;
diff --git a/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/editor/BuiltinEditorOptionsDefault.java b/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/internal/ui/BuiltinEditorOptionsDefault.java
similarity index 82%
rename from bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/editor/BuiltinEditorOptionsDefault.java
rename to bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/internal/ui/BuiltinEditorOptionsDefault.java
index b8ac8038..abfb5464 100644
--- a/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/editor/BuiltinEditorOptionsDefault.java
+++ b/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/internal/ui/BuiltinEditorOptionsDefault.java
@@ -10,12 +10,13 @@
* See git history
*******************************************************************************/
-package org.eclipse.cdt.lsp.editor;
+package org.eclipse.cdt.lsp.internal.ui;
+import org.eclipse.cdt.lsp.editor.EditorOptionsDefaults;
import org.osgi.service.component.annotations.Component;
@Component
-public class BuiltinEditorOptionsDefault implements EditorOptionsDefaults {
+public final class BuiltinEditorOptionsDefault implements EditorOptionsDefaults {
@Override
public boolean preferLspEditor() {
diff --git a/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/editor/DefaultConfigurationVisibility.java b/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/internal/ui/DefaultConfigurationVisibility.java
similarity index 73%
rename from bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/editor/DefaultConfigurationVisibility.java
rename to bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/internal/ui/DefaultConfigurationVisibility.java
index 76e3ddac..650543cf 100644
--- a/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/editor/DefaultConfigurationVisibility.java
+++ b/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/internal/ui/DefaultConfigurationVisibility.java
@@ -1,5 +1,6 @@
-package org.eclipse.cdt.lsp.editor;
+package org.eclipse.cdt.lsp.internal.ui;
+import org.eclipse.cdt.lsp.editor.ConfigurationVisibility;
import org.osgi.service.component.annotations.Component;
@Component(property = { "service.ranking:Integer=0" })
diff --git a/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/editor/EditorConfigurationAccess.java b/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/internal/ui/EditorConfigurationAccess.java
similarity index 87%
rename from bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/editor/EditorConfigurationAccess.java
rename to bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/internal/ui/EditorConfigurationAccess.java
index 4852bb19..f40ea704 100644
--- a/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/editor/EditorConfigurationAccess.java
+++ b/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/internal/ui/EditorConfigurationAccess.java
@@ -10,11 +10,17 @@
* See git history
*******************************************************************************/
-package org.eclipse.cdt.lsp.editor;
+package org.eclipse.cdt.lsp.internal.ui;
import java.util.Optional;
import org.eclipse.cdt.lsp.LspQualifier;
+import org.eclipse.cdt.lsp.config.Configuration;
+import org.eclipse.cdt.lsp.config.ConfigurationAccess;
+import org.eclipse.cdt.lsp.editor.EditorMetadata;
+import org.eclipse.cdt.lsp.editor.EditorOptions;
+import org.eclipse.cdt.lsp.editor.LanguageServerEnable;
+import org.eclipse.cdt.lsp.internal.editor.EditorPreferredOptions;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.ProjectScope;
import org.eclipse.core.runtime.preferences.DefaultScope;
diff --git a/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/editor/EditorConfigurationArea.java b/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/internal/ui/EditorConfigurationArea.java
similarity index 89%
rename from bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/editor/EditorConfigurationArea.java
rename to bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/internal/ui/EditorConfigurationArea.java
index b0e518d7..c0e322bf 100644
--- a/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/editor/EditorConfigurationArea.java
+++ b/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/internal/ui/EditorConfigurationArea.java
@@ -11,8 +11,12 @@
* Contributors:
* Alexander Fedorov (ArSysOp) - Initial API and implementation
*******************************************************************************/
-package org.eclipse.cdt.lsp.editor;
+package org.eclipse.cdt.lsp.internal.ui;
+import org.eclipse.cdt.lsp.editor.ConfigurationVisibility;
+import org.eclipse.cdt.lsp.editor.EditorMetadata;
+import org.eclipse.cdt.lsp.editor.EditorOptions;
+import org.eclipse.cdt.lsp.ui.ConfigurationArea;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.core.runtime.preferences.OsgiPreferenceMetadataStore;
import org.eclipse.jface.layout.GridLayoutFactory;
diff --git a/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/editor/SaveActionsConfigurationArea.java b/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/internal/ui/SaveActionsConfigurationArea.java
similarity index 92%
rename from bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/editor/SaveActionsConfigurationArea.java
rename to bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/internal/ui/SaveActionsConfigurationArea.java
index 775d860d..b8f08833 100644
--- a/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/editor/SaveActionsConfigurationArea.java
+++ b/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/internal/ui/SaveActionsConfigurationArea.java
@@ -1,5 +1,8 @@
-package org.eclipse.cdt.lsp.editor;
+package org.eclipse.cdt.lsp.internal.ui;
+import org.eclipse.cdt.lsp.editor.EditorMetadata;
+import org.eclipse.cdt.lsp.editor.EditorOptions;
+import org.eclipse.cdt.lsp.ui.ConfigurationArea;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.core.runtime.preferences.OsgiPreferenceMetadataStore;
import org.eclipse.jface.layout.GridLayoutFactory;
diff --git a/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/editor/SaveActionsConfigurationPage.java b/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/internal/ui/SaveActionsConfigurationPage.java
similarity index 79%
rename from bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/editor/SaveActionsConfigurationPage.java
rename to bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/internal/ui/SaveActionsConfigurationPage.java
index 5a7ed645..4884106f 100644
--- a/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/editor/SaveActionsConfigurationPage.java
+++ b/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/internal/ui/SaveActionsConfigurationPage.java
@@ -1,5 +1,8 @@
-package org.eclipse.cdt.lsp.editor;
+package org.eclipse.cdt.lsp.internal.ui;
+import org.eclipse.cdt.lsp.editor.EditorMetadata;
+import org.eclipse.cdt.lsp.ui.ConfigurationArea;
+import org.eclipse.cdt.lsp.ui.EditorConfigurationPage;
import org.eclipse.swt.widgets.Composite;
public class SaveActionsConfigurationPage extends EditorConfigurationPage {
diff --git a/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/ui/navigator/CSymbolsContentProvider.java b/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/internal/ui/navigator/CSymbolsContentProvider.java
similarity index 99%
rename from bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/ui/navigator/CSymbolsContentProvider.java
rename to bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/internal/ui/navigator/CSymbolsContentProvider.java
index 45ef7315..9c5cc5d8 100644
--- a/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/ui/navigator/CSymbolsContentProvider.java
+++ b/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/internal/ui/navigator/CSymbolsContentProvider.java
@@ -11,7 +11,7 @@
* Alexander Fedorov (ArSysOp) - use Platform for logging
*******************************************************************************/
-package org.eclipse.cdt.lsp.ui.navigator;
+package org.eclipse.cdt.lsp.internal.ui.navigator;
import java.util.Set;
diff --git a/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/ui/navigator/CSymbolsOpenActionProvider.java b/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/internal/ui/navigator/CSymbolsOpenActionProvider.java
similarity index 99%
rename from bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/ui/navigator/CSymbolsOpenActionProvider.java
rename to bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/internal/ui/navigator/CSymbolsOpenActionProvider.java
index 57e6b0d8..3c0140a5 100644
--- a/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/ui/navigator/CSymbolsOpenActionProvider.java
+++ b/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/internal/ui/navigator/CSymbolsOpenActionProvider.java
@@ -11,7 +11,7 @@
* Alexander Fedorov (ArSysOp) - use Platform for logging
*******************************************************************************/
-package org.eclipse.cdt.lsp.ui.navigator;
+package org.eclipse.cdt.lsp.internal.ui.navigator;
import org.eclipse.cdt.internal.ui.cview.CViewMessages;
import org.eclipse.core.resources.IFile;
diff --git a/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/ui/navigator/FileBufferListenerAdapter.java b/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/internal/ui/navigator/FileBufferListenerAdapter.java
similarity index 96%
rename from bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/ui/navigator/FileBufferListenerAdapter.java
rename to bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/internal/ui/navigator/FileBufferListenerAdapter.java
index 9f7798ee..e6d2b95f 100644
--- a/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/ui/navigator/FileBufferListenerAdapter.java
+++ b/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/internal/ui/navigator/FileBufferListenerAdapter.java
@@ -10,7 +10,7 @@
* Gesa Hentschke (Bachmann electronic GmbH) - initial implementation
*******************************************************************************/
-package org.eclipse.cdt.lsp.ui.navigator;
+package org.eclipse.cdt.lsp.internal.ui.navigator;
import org.eclipse.core.filebuffers.IFileBuffer;
import org.eclipse.core.filebuffers.IFileBufferListener;
diff --git a/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/ui/navigator/SymbolsManager.java b/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/internal/ui/navigator/SymbolsManager.java
similarity index 99%
rename from bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/ui/navigator/SymbolsManager.java
rename to bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/internal/ui/navigator/SymbolsManager.java
index 289fadd2..9f2d9756 100644
--- a/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/ui/navigator/SymbolsManager.java
+++ b/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/internal/ui/navigator/SymbolsManager.java
@@ -10,7 +10,7 @@
* Gesa Hentschke (Bachmann electronic GmbH) - initial implementation
*******************************************************************************/
-package org.eclipse.cdt.lsp.ui.navigator;
+package org.eclipse.cdt.lsp.internal.ui.navigator;
import java.net.URI;
import java.util.HashMap;
@@ -23,7 +23,7 @@
import java.util.concurrent.TimeoutException;
import org.eclipse.cdt.core.model.ITranslationUnit;
-import org.eclipse.cdt.lsp.LspUtils;
+import org.eclipse.cdt.lsp.util.LspUtils;
import org.eclipse.core.filebuffers.FileBuffers;
import org.eclipse.core.filebuffers.IFileBuffer;
import org.eclipse.core.filebuffers.IFileBufferListener;
diff --git a/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/LspPlugin.java b/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/plugin/LspPlugin.java
similarity index 98%
rename from bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/LspPlugin.java
rename to bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/plugin/LspPlugin.java
index 6b516637..5da895f7 100644
--- a/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/LspPlugin.java
+++ b/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/plugin/LspPlugin.java
@@ -11,7 +11,7 @@
* Alexander Fedorov (ArSysOp) - use Platform for logging
*******************************************************************************/
-package org.eclipse.cdt.lsp;
+package org.eclipse.cdt.lsp.plugin;
import java.util.logging.Level;
import java.util.logging.Logger;
diff --git a/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/editor/ConfigurationArea.java b/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/ui/ConfigurationArea.java
similarity index 98%
rename from bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/editor/ConfigurationArea.java
rename to bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/ui/ConfigurationArea.java
index e7303375..25905ffd 100644
--- a/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/editor/ConfigurationArea.java
+++ b/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/ui/ConfigurationArea.java
@@ -1,4 +1,4 @@
-package org.eclipse.cdt.lsp.editor;
+package org.eclipse.cdt.lsp.ui;
import java.util.ArrayList;
import java.util.HashMap;
diff --git a/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/editor/EditorConfigurationPage.java b/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/ui/EditorConfigurationPage.java
similarity index 97%
rename from bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/editor/EditorConfigurationPage.java
rename to bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/ui/EditorConfigurationPage.java
index 210a098f..4edfb878 100644
--- a/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/editor/EditorConfigurationPage.java
+++ b/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/ui/EditorConfigurationPage.java
@@ -12,11 +12,15 @@
* Alexander Fedorov (ArSysOp) - Initial API and implementation
*******************************************************************************/
-package org.eclipse.cdt.lsp.editor;
+package org.eclipse.cdt.lsp.ui;
import java.util.Optional;
+import org.eclipse.cdt.lsp.ResolveProjectScope;
+import org.eclipse.cdt.lsp.config.Configuration;
+import org.eclipse.cdt.lsp.editor.EditorMetadata;
import org.eclipse.cdt.lsp.internal.messages.LspUiMessages;
+import org.eclipse.cdt.lsp.internal.ui.EditorConfigurationArea;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.ProjectScope;
import org.eclipse.core.runtime.Platform;
diff --git a/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/LspUtils.java b/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/util/LspUtils.java
similarity index 98%
rename from bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/LspUtils.java
rename to bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/util/LspUtils.java
index e4a8ce60..fe646b69 100644
--- a/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/LspUtils.java
+++ b/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/util/LspUtils.java
@@ -9,7 +9,7 @@
* Contributors:
* See git history
*******************************************************************************/
-package org.eclipse.cdt.lsp;
+package org.eclipse.cdt.lsp.util;
import java.net.URI;
import java.util.ArrayList;
@@ -18,6 +18,7 @@
import java.util.Optional;
import java.util.stream.Stream;
+import org.eclipse.cdt.lsp.plugin.LspPlugin;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IWorkspace;
diff --git a/tests/org.eclipse.cdt.lsp.clangd.tests/src/org/eclipse/cdt/lsp/clangd/editor/tests/EditorTestUtils.java b/tests/org.eclipse.cdt.lsp.clangd.tests/src/org/eclipse/cdt/lsp/clangd/editor/tests/EditorTestUtils.java
deleted file mode 100644
index f0f15f9b..00000000
--- a/tests/org.eclipse.cdt.lsp.clangd.tests/src/org/eclipse/cdt/lsp/clangd/editor/tests/EditorTestUtils.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2023 Bachmann electronic GmbH and others.
- *
- * This program and the accompanying materials are made
- * available under the terms of the Eclipse Public License 2.0
- * which is available at https://www.eclipse.org/legal/epl-2.0/
- *
- * SPDX-License-Identifier: EPL-2.0
- *
- * Contributors:
- * Gesa Hentschke (Bachmann electronic GmbH) - initial implementation
- * Alexander Fedorov (ArSysOp) - extract headless part
- *******************************************************************************/
-
-package org.eclipse.cdt.lsp.clangd.editor.tests;
-
-import java.net.URI;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.IDE;
-
-public final class EditorTestUtils {
-
- public static IEditorPart openInEditor(URI uri, String editorID) throws PartInitException {
- IEditorPart part = IDE.openEditor(EditorTestUtils.getWorkbenchPage(), uri, editorID, true);
- part.setFocus();
- return part;
- }
-
- public static IEditorPart openInEditor(IFile file) throws PartInitException {
- IEditorPart part = IDE.openEditor(EditorTestUtils.getWorkbenchPage(), file);
- part.setFocus();
- return part;
- }
-
- public static boolean closeEditor(IEditorPart editor, boolean save) {
- IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- IWorkbenchPage page = workbenchWindow.getActivePage();
- return page.closeEditor(editor, save);
- }
-
- private static IWorkbenchPage getWorkbenchPage() {
- return PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- }
-
-}
diff --git a/tests/org.eclipse.cdt.lsp.clangd.tests/src/org/eclipse/cdt/lsp/clangd/tests/TestUtils.java b/tests/org.eclipse.cdt.lsp.clangd.tests/src/org/eclipse/cdt/lsp/clangd/tests/TestUtils.java
index e62e683d..ad167fa0 100644
--- a/tests/org.eclipse.cdt.lsp.clangd.tests/src/org/eclipse/cdt/lsp/clangd/tests/TestUtils.java
+++ b/tests/org.eclipse.cdt.lsp.clangd.tests/src/org/eclipse/cdt/lsp/clangd/tests/TestUtils.java
@@ -15,13 +15,8 @@
package org.eclipse.cdt.lsp.clangd.tests;
-import java.io.ByteArrayInputStream;
-import java.io.UnsupportedEncodingException;
-
-import org.eclipse.cdt.lsp.editor.Configuration;
+import org.eclipse.cdt.lsp.config.Configuration;
import org.eclipse.cdt.lsp.editor.EditorMetadata;
-import org.eclipse.cdt.lsp.editor.EditorOptions;
-import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IProjectDescription;
import org.eclipse.core.resources.ResourcesPlugin;
@@ -37,13 +32,6 @@ public static void setLspPreferred(IProject project, boolean value) {
cc -> cc.storage(project).save(value, ((EditorMetadata) cc.metadata()).preferLspEditor()));
}
- public static boolean isLspPreferred(IProject project) {
- boolean[] enabled = new boolean[1];
- ServiceCaller.callOnce(TestUtils.class, Configuration.class, //
- c -> enabled[0] = ((EditorOptions) c.options(project)).preferLspEditor());
- return enabled[0];
- }
-
public static IProject createCProject(String projectName) throws CoreException {
IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
if (project.exists()) {
@@ -67,13 +55,6 @@ public static void deleteProject(IProject project) throws CoreException {
}
}
- public static IFile createFile(IProject p, String name, String content)
- throws CoreException, UnsupportedEncodingException {
- IFile testFile = p.getFile(name);
- testFile.create(new ByteArrayInputStream(content.getBytes(testFile.getCharset())), true, null);
- return testFile;
- }
-
public static String getName(TestInfo testInfo) {
String displayName = testInfo.getDisplayName();
String replaceFirst = displayName.replaceFirst("\\(.*\\)", "");
diff --git a/tests/org.eclipse.cdt.lsp.clangd.tests/src/org/eclipse/cdt/lsp/clangd/editor/tests/expressions/LspEditorActiveTesterTest.java b/tests/org.eclipse.cdt.lsp.clangd.tests/src/org/eclipse/cdt/lsp/internal/clangd/tests/editor/expressions/LspEditorActiveTesterTest.java
similarity index 97%
rename from tests/org.eclipse.cdt.lsp.clangd.tests/src/org/eclipse/cdt/lsp/clangd/editor/tests/expressions/LspEditorActiveTesterTest.java
rename to tests/org.eclipse.cdt.lsp.clangd.tests/src/org/eclipse/cdt/lsp/internal/clangd/tests/editor/expressions/LspEditorActiveTesterTest.java
index 9a32a402..a27e4222 100644
--- a/tests/org.eclipse.cdt.lsp.clangd.tests/src/org/eclipse/cdt/lsp/clangd/editor/tests/expressions/LspEditorActiveTesterTest.java
+++ b/tests/org.eclipse.cdt.lsp.clangd.tests/src/org/eclipse/cdt/lsp/internal/clangd/tests/editor/expressions/LspEditorActiveTesterTest.java
@@ -11,15 +11,15 @@
* Dominic Scharfe (COSEDA Technologies GmbH) - initial implementation
* Alexander Fedorov (ArSysOp) - extract headless part
*******************************************************************************/
-package org.eclipse.cdt.lsp.clangd.editor.tests.expressions;
+package org.eclipse.cdt.lsp.internal.clangd.tests.editor.expressions;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
-import org.eclipse.cdt.lsp.LspPlugin;
import org.eclipse.cdt.lsp.internal.clangd.editor.expressions.LspEditorActiveTester;
+import org.eclipse.cdt.lsp.plugin.LspPlugin;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IEditorSite;
import org.eclipse.ui.texteditor.ITextEditor;