diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 60666a5b7..12641fe44 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,17 +38,14 @@ jobs: with: maven-version: 3.9.6 - - name: Set up JDK 17 - uses: actions/setup-java@v3 + - name: Set up JDK 21 + uses: actions/setup-java@v4 with: - java-version: '17' + java-version: '21' distribution: 'temurin' - + - name: Build with Maven - run: export NO_AT_BRIDGE=1 && mvn clean verify -Djarsigner.skip=true spotbugs:spotbugs -DskipTests=false -DtestWorkspace=/opt/actions-runner/_work/workspace - - uses: jwgmeligmeyling/spotbugs-github-action@master - with: - path: '**/spotbugsXml.xml' + run: export NO_AT_BRIDGE=1 && mvn clean verify -Djarsigner.skip=true -DskipTests=false -DtestWorkspace=/opt/actions-runner/_work/workspace - name: Publish Test Reports if: ${{ always() }} @@ -65,10 +62,10 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Set up JDK 17 - uses: actions/setup-java@v2 + - name: Set up JDK 21 + uses: actions/setup-java@v4 with: - java-version: '17' + java-version: '21' distribution: 'temurin' - name: Build with Maven diff --git a/bundles/com.espressif.idf.branding/.classpath b/bundles/com.espressif.idf.branding/.classpath index 0880ee4eb..f7573c1b3 100644 --- a/bundles/com.espressif.idf.branding/.classpath +++ b/bundles/com.espressif.idf.branding/.classpath @@ -1,10 +1,15 @@ - + - + + + + + + diff --git a/bundles/com.espressif.idf.core/.classpath b/bundles/com.espressif.idf.core/.classpath index 63b29b03b..92003c510 100644 --- a/bundles/com.espressif.idf.core/.classpath +++ b/bundles/com.espressif.idf.core/.classpath @@ -1,29 +1,39 @@ - - - - - - - + - + + + + + + + + + + + + + + + + + + + - - + - - + diff --git a/bundles/com.espressif.idf.core/META-INF/MANIFEST.MF b/bundles/com.espressif.idf.core/META-INF/MANIFEST.MF index aff2e770c..a8ca2a54c 100644 --- a/bundles/com.espressif.idf.core/META-INF/MANIFEST.MF +++ b/bundles/com.espressif.idf.core/META-INF/MANIFEST.MF @@ -8,7 +8,7 @@ Bundle-Vendor: %Bundle-Vendor Require-Bundle: org.eclipse.core.runtime, org.eclipse.core.filesystem;visibility:=reexport, org.eclipse.core.resources;visibility:=reexport, - org.eclipse.cdt.core;bundle-version="8.0.0", + org.eclipse.cdt.core;bundle-version="9.0.0", org.eclipse.cdt.cmake.core;visibility:=reexport, org.eclipse.core.expressions;visibility:=reexport, org.eclipse.cdt.managedbuilder.core;visibility:=reexport, @@ -30,9 +30,9 @@ Require-Bundle: org.eclipse.core.runtime, com.sun.jna, com.sun.jna.platform, org.eclipse.cdt.lsp.clangd, - org.eclipse.cdt.lsp, - org.eclipse.lsp4e, - org.eclipse.lsp4j + org.eclipse.cdt.lsp;bundle-version="3.0.0", + org.eclipse.lsp4e;bundle-version="0.18.18", + org.eclipse.lsp4j;bundle-version="0.24.0" Bundle-RequiredExecutionEnvironment: JavaSE-17 Automatic-Module-Name: com.espressif.idf.core Bundle-ActivationPolicy: lazy diff --git a/bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/IDFBuildConfiguration.java b/bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/IDFBuildConfiguration.java index b1e02af2d..e3e8fd541 100644 --- a/bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/IDFBuildConfiguration.java +++ b/bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/IDFBuildConfiguration.java @@ -120,15 +120,10 @@ public IDFBuildConfiguration(IBuildConfiguration config, String name) throws Cor super(config, name); } - public IDFBuildConfiguration(IBuildConfiguration config, String name, IToolChain toolChain) - { - this(config, name, toolChain, null, "run"); //$NON-NLS-1$ - } - public IDFBuildConfiguration(IBuildConfiguration config, String name, IToolChain toolChain, - ICMakeToolChainFile toolChainFile, String launchMode) + ICMakeToolChainFile toolChainFile, String launchMode, ILaunchTarget target) { - super(config, name, toolChain, launchMode); + super(config, name, toolChain, launchMode, target); this.toolChainFile = toolChainFile; } @@ -581,9 +576,13 @@ public IToolChain getToolChain() throws CoreException String id = getProperty(TOOLCHAIN_ID); IToolChainManager toolChainManager = CCorePlugin.getService(IToolChainManager.class); ILaunchBarManager launchBarManager = CCorePlugin.getService(ILaunchBarManager.class); - Collection matchedToolChains = toolChainManager - .getToolChainsMatching(Map.of(IToolChain.ATTR_OS, launchBarManager.getActiveLaunchTarget() - .getAttribute(LaunchBarTargetConstants.TARGET, StringUtil.EMPTY), TOOLCHAIN_TYPE, typeId)); + ILaunchTarget activeTarget = launchBarManager.getActiveLaunchTarget(); + if (activeTarget == null) + { + return super.getToolChain(); + } + Collection matchedToolChains = toolChainManager.getToolChainsMatching(Map.of(IToolChain.ATTR_OS, + activeTarget.getAttribute(LaunchBarTargetConstants.TARGET, StringUtil.EMPTY), TOOLCHAIN_TYPE, typeId)); return matchedToolChains.stream().findAny().orElse(toolChainManager.getToolChain(typeId, id)); } diff --git a/bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/IDFBuildConfigurationProvider.java b/bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/IDFBuildConfigurationProvider.java index c6b39762c..bca106317 100644 --- a/bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/IDFBuildConfigurationProvider.java +++ b/bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/IDFBuildConfigurationProvider.java @@ -17,7 +17,6 @@ import org.eclipse.cdt.core.build.ICBuildConfigurationManager; import org.eclipse.cdt.core.build.ICBuildConfigurationProvider; import org.eclipse.cdt.core.build.IToolChain; -import org.eclipse.cdt.core.build.IToolChainManager; import org.eclipse.core.resources.IBuildConfiguration; import org.eclipse.core.resources.IProject; import org.eclipse.core.runtime.CoreException; @@ -27,7 +26,6 @@ import com.espressif.idf.core.IDFCorePlugin; import com.espressif.idf.core.logging.Logger; -import com.espressif.idf.core.toolchain.ESPToolchain; /** * @author Kondal Kolipaka @@ -51,80 +49,38 @@ public String getId() public synchronized ICBuildConfiguration getCBuildConfiguration(IBuildConfiguration config, String name) throws CoreException { + ILaunchBarManager barManager = IDFCorePlugin.getService(ILaunchBarManager.class); + ILaunchTarget target = barManager != null ? barManager.getActiveLaunchTarget() : null; if (config.getName().equals(IBuildConfiguration.DEFAULT_CONFIG_NAME)) { - IToolChain toolChain = null; - - // try the toolchain for the current target - IToolChainManager toolChainManager = IDFCorePlugin.getService(IToolChainManager.class); - ILaunchBarManager barManager = IDFCorePlugin.getService(ILaunchBarManager.class); - try - { - ILaunchTarget target = barManager.getActiveLaunchTarget(); - if (target == null) - { - return null; - } - for (IToolChain tc : toolChainManager.getToolChainsMatching(target.getAttributes())) - { - if (tc instanceof ESPToolchain) - { - toolChain = tc; - break; - } - } - } - catch (CoreException e) - { - Logger.log(e); - } - - // current didn't work, try and find one that does - if (toolChain == null) - { - for (IToolChain tc : toolChainManager.getToolChainsMatching(new HashMap<>())) - { - if (tc instanceof ESPToolchain) - { - toolChain = tc; - break; - } - } - - } - - if (toolChain != null) - { - return new IDFBuildConfiguration(config, name, toolChain); - } - else - { - // No valid combinations - return null; - } + Logger.log("Default config name is not supported"); //$NON-NLS-1$ + return null; } IDFBuildConfiguration cmakeConfig = new IDFBuildConfiguration(config, name); ICMakeToolChainFile tcFile = cmakeConfig.getToolChainFile(); IToolChain toolChain = cmakeConfig.getToolChain(); if (toolChain == null) { + Logger.log("Toolchain is null"); //$NON-NLS-1$ // config not complete return null; } if (tcFile != null && !toolChain.equals(tcFile.getToolChain())) { // toolchain changed - return new IDFBuildConfiguration(config, name, tcFile.getToolChain(), tcFile, cmakeConfig.getLaunchMode()); + return new IDFBuildConfiguration(config, name, tcFile.getToolChain(), tcFile, cmakeConfig.getLaunchMode(), + target); } else { return cmakeConfig; } + } @Override - public ICBuildConfiguration createBuildConfiguration(IProject project, IToolChain toolChain, String launchMode, - IProgressMonitor monitor) throws CoreException + public ICBuildConfiguration createCBuildConfiguration(IProject project, IToolChain toolChain, String launchMode, + ILaunchTarget launchTarget, IProgressMonitor monitor) throws CoreException { // get matching toolchain file if any Map properties = new HashMap<>(); @@ -150,7 +106,7 @@ public ICBuildConfiguration createBuildConfiguration(IProject project, IToolChai } // Let's generate build artifacts directly under the build folder so that CLI and eclipse IDF will be in sync - String name = ICBuildConfiguration.DEFAULT_NAME; + String name = ICBuildConfiguration.TOOLCHAIN_ID; IBuildConfiguration buildConfig; if (configManager.hasConfiguration(this, project, name)) { @@ -162,7 +118,8 @@ public ICBuildConfiguration createBuildConfiguration(IProject project, IToolChai } - CBuildConfiguration cmakeConfig = new IDFBuildConfiguration(buildConfig, name, toolChain, file, launchMode); + CBuildConfiguration cmakeConfig = new IDFBuildConfiguration(buildConfig, name, toolChain, file, launchMode, + launchTarget); configManager.addBuildConfiguration(buildConfig, cmakeConfig); return cmakeConfig; } diff --git a/bundles/com.espressif.idf.core/src/com/espressif/idf/core/util/LspService.java b/bundles/com.espressif.idf.core/src/com/espressif/idf/core/util/LspService.java index 85c403e73..25a97858c 100644 --- a/bundles/com.espressif.idf.core/src/com/espressif/idf/core/util/LspService.java +++ b/bundles/com.espressif.idf.core/src/com/espressif/idf/core/util/LspService.java @@ -16,6 +16,8 @@ import org.eclipse.lsp4e.LanguageServiceAccessor; import org.eclipse.ui.PlatformUI; +import com.espressif.idf.core.ILSPConstants; + @SuppressWarnings("restriction") public class LspService { @@ -45,49 +47,40 @@ public void restartLspServers() public void updateAdditionalOptions(String additionalOptions) { - if (configuration.metadata() instanceof ClangdMetadata metadata) - { - String qualifier = configuration.qualifier(); - InstanceScope.INSTANCE.getNode(qualifier).put(metadata.additionalOptions().identifer(), additionalOptions); - } + String qualifier = configuration.qualifier(); + InstanceScope.INSTANCE.getNode(qualifier).put(ClangdMetadata.Predefined.additionalOptions.identifer(), + additionalOptions); } public void updateLspQueryDrivers() { - if (configuration.metadata() instanceof ClangdMetadata metadata) - { - String qualifier = configuration.qualifier(); - InstanceScope.INSTANCE.getNode(qualifier).put(metadata.queryDriver().identifer(), - metadata.queryDriver().defaultValue()); - } + String qualifier = configuration.qualifier(); + // By passing --query-driver argument to clangd helps to resolve the + // cross-compiler toolchain headers. + String toolchainPath = IDFUtil.getToolchainExePathForActiveTarget(); + InstanceScope.INSTANCE.getNode(qualifier).put(ClangdMetadata.Predefined.queryDriver.identifer(), toolchainPath); } public void updateClangdPath() { - if (configuration.metadata() instanceof ClangdMetadata metadata) - { - String qualifier = configuration.qualifier(); - InstanceScope.INSTANCE.getNode(qualifier).put(metadata.clangdPath().identifer(), - metadata.clangdPath().defaultValue()); - } + String qualifier = configuration.qualifier(); + InstanceScope.INSTANCE.getNode(qualifier).put(ClangdMetadata.Predefined.clangdPath.identifer(), + IDFUtil.findCommandFromBuildEnvPath(ILSPConstants.CLANGD_EXECUTABLE)); } public void updateCompileCommandsDir(String buildDir) { - if (configuration.metadata() instanceof ClangdMetadata metadata) - { - String qualifier = configuration.qualifier(); - String identifier = metadata.additionalOptions().identifer(); - IEclipsePreferences preferences = InstanceScope.INSTANCE.getNode(qualifier); + String qualifier = configuration.qualifier(); + String identifier = ClangdMetadata.Predefined.additionalOptions.identifer(); + IEclipsePreferences preferences = InstanceScope.INSTANCE.getNode(qualifier); - String existingOptions = preferences.get(identifier, StringUtil.EMPTY); - String compileCommandsDirString = "--compile-commands-dir="; //$NON-NLS-1$ - String newCompuileCommandsDirString = compileCommandsDirString + buildDir; - String updatedOptions = existingOptions.contains(compileCommandsDirString) - ? existingOptions.replaceAll(compileCommandsDirString + ".+", //$NON-NLS-1$ - Matcher.quoteReplacement(newCompuileCommandsDirString)) - : newCompuileCommandsDirString; - preferences.put(identifier, updatedOptions); - } + String existingOptions = preferences.get(identifier, StringUtil.EMPTY); + String compileCommandsDirString = "--compile-commands-dir="; //$NON-NLS-1$ + String newCompuileCommandsDirString = compileCommandsDirString + buildDir; + String updatedOptions = existingOptions.contains(compileCommandsDirString) + ? existingOptions.replaceAll(compileCommandsDirString + ".+", //$NON-NLS-1$ + Matcher.quoteReplacement(newCompuileCommandsDirString)) + : newCompuileCommandsDirString; + preferences.put(identifier, updatedOptions); } } diff --git a/bundles/com.espressif.idf.debug.gdbjtag.openocd/.classpath b/bundles/com.espressif.idf.debug.gdbjtag.openocd/.classpath index fe1a20532..514730d50 100644 --- a/bundles/com.espressif.idf.debug.gdbjtag.openocd/.classpath +++ b/bundles/com.espressif.idf.debug.gdbjtag.openocd/.classpath @@ -1,11 +1,22 @@ - + - + - + + + + + + + + + + + + diff --git a/bundles/com.espressif.idf.help/.classpath b/bundles/com.espressif.idf.help/.classpath index 01dec76a1..5050774b8 100644 --- a/bundles/com.espressif.idf.help/.classpath +++ b/bundles/com.espressif.idf.help/.classpath @@ -1,13 +1,12 @@ - + - - + @@ -18,5 +17,5 @@ - + diff --git a/bundles/com.espressif.idf.launch.serial.core/.classpath b/bundles/com.espressif.idf.launch.serial.core/.classpath index 3628e3368..5050774b8 100644 --- a/bundles/com.espressif.idf.launch.serial.core/.classpath +++ b/bundles/com.espressif.idf.launch.serial.core/.classpath @@ -1,11 +1,21 @@ - + - + - + + + + + + + + + + + diff --git a/bundles/com.espressif.idf.launch.serial.ui/.classpath b/bundles/com.espressif.idf.launch.serial.ui/.classpath index ff2b3f968..3296ec8c9 100644 --- a/bundles/com.espressif.idf.launch.serial.ui/.classpath +++ b/bundles/com.espressif.idf.launch.serial.ui/.classpath @@ -1,13 +1,22 @@ - + - - + + + + + + - + + + + + + diff --git a/bundles/com.espressif.idf.launch.serial.ui/src/com/espressif/idf/launch/serial/ui/internal/CMakeMainTab2.java b/bundles/com.espressif.idf.launch.serial.ui/src/com/espressif/idf/launch/serial/ui/internal/CMakeMainTab2.java index 5db1a0c77..e1a1eff3f 100644 --- a/bundles/com.espressif.idf.launch.serial.ui/src/com/espressif/idf/launch/serial/ui/internal/CMakeMainTab2.java +++ b/bundles/com.espressif.idf.launch.serial.ui/src/com/espressif/idf/launch/serial/ui/internal/CMakeMainTab2.java @@ -25,7 +25,7 @@ import java.util.stream.Collectors; import java.util.stream.Stream; -import org.eclipse.cdt.cmake.core.internal.CMakeBuildConfiguration; +import org.eclipse.cdt.cmake.core.ICMakeBuildConfiguration; import org.eclipse.cdt.core.CCorePlugin; import org.eclipse.cdt.core.model.CModelException; import org.eclipse.cdt.core.model.CoreModel; @@ -485,7 +485,7 @@ public boolean isValid(ILaunchConfiguration launchConfig) hasProject = launchConfig.getMappedResources() != null && launchConfig.getMappedResources()[0].getProject().exists(); // Manually check for "-B" in cmakeArgs here because CMakeBuildTab2's isValid() method is not being called - String cmakeArgs = launchConfig.getAttribute(CMakeBuildConfiguration.CMAKE_ARGUMENTS, StringUtil.EMPTY); + String cmakeArgs = launchConfig.getAttribute(ICMakeBuildConfiguration.CMAKE_ARGUMENTS, StringUtil.EMPTY); if (cmakeArgs.contains("-B")) //$NON-NLS-1$ { setErrorMessage(Messages.CMakeMainTab2_CmakeArgsDeprecatedBArgMessage); diff --git a/bundles/com.espressif.idf.lsp/.classpath b/bundles/com.espressif.idf.lsp/.classpath index 81fe078c2..5050774b8 100644 --- a/bundles/com.espressif.idf.lsp/.classpath +++ b/bundles/com.espressif.idf.lsp/.classpath @@ -1,7 +1,21 @@ - + + + + + - + + + + + + + + + + + diff --git a/bundles/com.espressif.idf.lsp/META-INF/MANIFEST.MF b/bundles/com.espressif.idf.lsp/META-INF/MANIFEST.MF index cf69a4634..667139422 100644 --- a/bundles/com.espressif.idf.lsp/META-INF/MANIFEST.MF +++ b/bundles/com.espressif.idf.lsp/META-INF/MANIFEST.MF @@ -16,5 +16,5 @@ Bundle-RequiredExecutionEnvironment: JavaSE-17 Automatic-Module-Name: com.espressif.idf.lsp Bundle-ActivationPolicy: lazy Bundle-Name: ESP-IDF LSP Plugin -Service-Component: OSGI-INF/com.espressif.idf.lsp.preferences.IDFClangdEnable.xml,OSGI-INF/com.espressif.idf.lsp.preferences.IDFClangdOptionsDefaults.xml, - OSGI-INF/com.espressif.idf.lsp.preferences.IDFClangdConfigurationAccess.xml +Service-Component: OSGI-INF/com.espressif.idf.lsp.preferences.IDFClangdEnable.xml,OSGI-INF/com.espressif.idf.lsp.preferences.IDFClangdOptionsDefaults.xml, OSGI-INF/com.espressif.idf.lsp.preferences.IDFEditorMetadataDefaults.xml + diff --git a/bundles/com.espressif.idf.lsp/OSGI-INF/com.espressif.idf.lsp.preferences.IDFClangdConfigurationAccess.xml b/bundles/com.espressif.idf.lsp/OSGI-INF/com.espressif.idf.lsp.preferences.IDFClangdConfigurationAccess.xml deleted file mode 100644 index d72f1f1b2..000000000 --- a/bundles/com.espressif.idf.lsp/OSGI-INF/com.espressif.idf.lsp.preferences.IDFClangdConfigurationAccess.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/bundles/com.espressif.idf.lsp/OSGI-INF/com.espressif.idf.lsp.preferences.IDFClangdOptionsDefaults.xml b/bundles/com.espressif.idf.lsp/OSGI-INF/com.espressif.idf.lsp.preferences.IDFClangdOptionsDefaults.xml index c72675c75..fd38685a5 100644 --- a/bundles/com.espressif.idf.lsp/OSGI-INF/com.espressif.idf.lsp.preferences.IDFClangdOptionsDefaults.xml +++ b/bundles/com.espressif.idf.lsp/OSGI-INF/com.espressif.idf.lsp.preferences.IDFClangdOptionsDefaults.xml @@ -1,8 +1,8 @@ - - + + - + - + diff --git a/bundles/com.espressif.idf.lsp/OSGI-INF/com.espressif.idf.lsp.preferences.IDFEditorMetadataDefaults.xml b/bundles/com.espressif.idf.lsp/OSGI-INF/com.espressif.idf.lsp.preferences.IDFEditorMetadataDefaults.xml new file mode 100644 index 000000000..ed1d2b502 --- /dev/null +++ b/bundles/com.espressif.idf.lsp/OSGI-INF/com.espressif.idf.lsp.preferences.IDFEditorMetadataDefaults.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/bundles/com.espressif.idf.lsp/src/com/espressif/idf/lsp/LspPluginStartup.java b/bundles/com.espressif.idf.lsp/src/com/espressif/idf/lsp/LspPluginStartup.java index 1311cd23f..f43965061 100644 --- a/bundles/com.espressif.idf.lsp/src/com/espressif/idf/lsp/LspPluginStartup.java +++ b/bundles/com.espressif.idf.lsp/src/com/espressif/idf/lsp/LspPluginStartup.java @@ -18,7 +18,7 @@ public class LspPluginStartup implements IStartup public void earlyStartup() { // Disabling the CDT indexer by default when the LSP plugin so that we could only use C/C++ LSP Server - //This will also avoid parser exceptions and unnecessary processing overhead which is not needed. + // This will also avoid parser exceptions and unnecessary processing overhead which is not needed. CCorePlugin.getIndexManager().setDefaultIndexerId(IPDOMManager.ID_NO_INDEXER); } diff --git a/bundles/com.espressif.idf.lsp/src/com/espressif/idf/lsp/preferences/IDFClangdConfigurationAccess.java b/bundles/com.espressif.idf.lsp/src/com/espressif/idf/lsp/preferences/IDFClangdConfigurationAccess.java deleted file mode 100644 index 164e35b22..000000000 --- a/bundles/com.espressif.idf.lsp/src/com/espressif/idf/lsp/preferences/IDFClangdConfigurationAccess.java +++ /dev/null @@ -1,114 +0,0 @@ -package com.espressif.idf.lsp.preferences; - -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; - -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.clangd.ClangdQualifier; -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; -import org.eclipse.core.runtime.preferences.IPreferenceMetadataStore; -import org.eclipse.core.runtime.preferences.IScopeContext; -import org.eclipse.core.runtime.preferences.InstanceScope; -import org.eclipse.core.runtime.preferences.OsgiPreferenceMetadataStore; -import org.eclipse.osgi.util.NLS; -import org.osgi.service.component.annotations.Component; -import org.osgi.service.component.annotations.Reference; - -@Component(service = ClangdConfiguration.class, property = "service.ranking:Integer=100") -public class IDFClangdConfigurationAccess extends ConfigurationAccess implements ClangdConfiguration -{ - - @Reference - private ClangdMetadata metadata; - - @Reference - private IWorkspace workspace; - - public IDFClangdConfigurationAccess() - { - super(new ClangdQualifier().get()); - } - - @Override - public ClangdMetadata metadata() - { - return metadata; - } - - @Override - public ClangdOptions defaults() - { - return new IDFClangdPreferredOptions(qualifier, new IScopeContext[] { DefaultScope.INSTANCE }, metadata); - } - - @Override - public ClangdOptions options(Object context) - { - Optional project = projectScope(workspace, context); - IScopeContext[] scopes; - if (project.isPresent()) - { - scopes = new IScopeContext[] { project.get(), InstanceScope.INSTANCE, DefaultScope.INSTANCE }; - } - else - { - scopes = new IScopeContext[] { InstanceScope.INSTANCE, DefaultScope.INSTANCE }; - } - return new IDFClangdPreferredOptions(qualifier, scopes, metadata); - - } - - @Override - public IPreferenceMetadataStore storage(Object context) - { - return new OsgiPreferenceMetadataStore(// - preferences(// - projectScope(workspace, context)// - .map(IScopeContext.class::cast)// - .orElse(InstanceScope.INSTANCE))); - } - - @Override - public String qualifier() - { - return qualifier; - } - - @Override - public List commands(Object context) - { - ClangdOptions options = options(context); - List list = new ArrayList<>(); - list.add(options.clangdPath()); - if (options.useTidy()) - { - list.add("--clang-tidy"); //$NON-NLS-1$ - } - if (options.useBackgroundIndex()) - { - list.add("--background-index"); //$NON-NLS-1$ - } - if (!options.completionStyle().isBlank()) - { - list.add(NLS.bind("--completion-style={0}", options.completionStyle())); //$NON-NLS-1$ - } - if (options.prettyPrint()) - { - list.add("--pretty"); //$NON-NLS-1$ - } - if (!options.queryDriver().isBlank()) - { - list.add(NLS.bind("--query-driver={0}", options.queryDriver())); //$NON-NLS-1$ - } - - list.addAll(options.additionalOptions()); - return list; - } - -} diff --git a/bundles/com.espressif.idf.lsp/src/com/espressif/idf/lsp/preferences/IDFClangdMetadataDefaults.java b/bundles/com.espressif.idf.lsp/src/com/espressif/idf/lsp/preferences/IDFClangdMetadataDefaults.java new file mode 100644 index 000000000..8953b43cb --- /dev/null +++ b/bundles/com.espressif.idf.lsp/src/com/espressif/idf/lsp/preferences/IDFClangdMetadataDefaults.java @@ -0,0 +1,53 @@ +package com.espressif.idf.lsp.preferences; + +import java.io.File; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; +import java.util.Set; + +import org.eclipse.cdt.lsp.clangd.ClangdMetadata; +import org.eclipse.cdt.lsp.config.ConfigurationMetadataBase; +import org.eclipse.core.runtime.preferences.PreferenceMetadata; +import org.osgi.service.component.annotations.Component; + +import com.espressif.idf.core.ILSPConstants; +import com.espressif.idf.core.toolchain.ESPToolChainManager; +import com.espressif.idf.core.util.IDFUtil; + +@Component(property = { "service.ranking:Integer=0" }) +public class IDFClangdMetadataDefaults extends ConfigurationMetadataBase implements ClangdMetadata +{ + + @Override + protected List> definePreferences() + { + Set filteredKeys = Set.of(Predefined.clangdPath.identifer(), Predefined.queryDriver.identifer()); + var filteredDefaults = Predefined.defaults.stream().filter(pref -> filteredKeys.contains(pref.identifer())) + .toList(); + + var clangdMetadataWithDefault = wrapWithCustomDefaultValue( + IDFUtil.findCommandFromBuildEnvPath(ILSPConstants.CLANGD_EXECUTABLE), + ClangdMetadata.Predefined.clangdPath); + + ESPToolChainManager toolChainManager = new ESPToolChainManager(); + String defaultIdfQueryDriver = Optional.ofNullable(toolChainManager.findCompiler("esp32")) //$NON-NLS-1$ + .map(File::getAbsolutePath).orElse(""); //$NON-NLS-1$ + + var queryDriverMetadataWithDefault = wrapWithCustomDefaultValue(defaultIdfQueryDriver, + ClangdMetadata.Predefined.queryDriver); + + List> mergedPreferences = new ArrayList<>(filteredDefaults); + mergedPreferences.add(clangdMetadataWithDefault); + mergedPreferences.add(queryDriverMetadataWithDefault); + + return mergedPreferences; + } + + private PreferenceMetadata wrapWithCustomDefaultValue(T customDefaultValue, PreferenceMetadata metadata) + { + return new PreferenceMetadata<>(metadata.valueClass(), metadata.identifer(), customDefaultValue, + metadata.name(), metadata.description()); + } + +} \ No newline at end of file diff --git a/bundles/com.espressif.idf.lsp/src/com/espressif/idf/lsp/preferences/IDFClangdOptionsDefaults.java b/bundles/com.espressif.idf.lsp/src/com/espressif/idf/lsp/preferences/IDFClangdOptionsDefaults.java deleted file mode 100644 index 613759fb2..000000000 --- a/bundles/com.espressif.idf.lsp/src/com/espressif/idf/lsp/preferences/IDFClangdOptionsDefaults.java +++ /dev/null @@ -1,74 +0,0 @@ -/******************************************************************************* - * Copyright 2024 Espressif Systems (Shanghai) PTE LTD. All rights reserved. - * Use is subject to license terms. - *******************************************************************************/ -package com.espressif.idf.lsp.preferences; - -import java.util.Collections; -import java.util.List; -import java.util.Optional; - -import org.eclipse.cdt.lsp.clangd.ClangdOptionsDefaults; -import org.osgi.service.component.annotations.Component; - -import com.espressif.idf.core.ILSPConstants; -import com.espressif.idf.core.logging.Logger; -import com.espressif.idf.core.util.IDFUtil; - -/** - * @author Kondal Kolipaka - * - */ -@Component(service = ClangdOptionsDefaults.class, property = { "service.ranking:Integer=100" }) -public class IDFClangdOptionsDefaults implements ClangdOptionsDefaults -{ - - @Override - public String clangdPath() - { - String clandPath = IDFUtil.findCommandFromBuildEnvPath(ILSPConstants.CLANGD_EXECUTABLE); - Logger.log("clangd: " + clandPath); //$NON-NLS-1$ - return Optional.ofNullable(clandPath).orElse(ILSPConstants.CLANGD_EXECUTABLE); - } - - @Override - public String queryDriver() - { - // By passing --query-driver argument to clangd helps to resolve the - // cross-compiler toolchain headers. - String toolchainPath = IDFUtil.getToolchainExePathForActiveTarget(); - Logger.log("toolchain path: " + toolchainPath); //$NON-NLS-1$ - return Optional.ofNullable(toolchainPath).orElse(""); - } - - @Override - public boolean useTidy() - { - return true; - } - - @Override - public boolean useBackgroundIndex() - { - return true; - } - - @Override - public String completionStyle() - { - return "detailed"; //$NON-NLS-1$ - } - - @Override - public boolean prettyPrint() - { - return true; - } - - @Override - public List additionalOptions() - { - return Collections.emptyList(); - } - -} diff --git a/bundles/com.espressif.idf.lsp/src/com/espressif/idf/lsp/preferences/IDFClangdPreferredOptions.java b/bundles/com.espressif.idf.lsp/src/com/espressif/idf/lsp/preferences/IDFClangdPreferredOptions.java deleted file mode 100644 index 740d4159c..000000000 --- a/bundles/com.espressif.idf.lsp/src/com/espressif/idf/lsp/preferences/IDFClangdPreferredOptions.java +++ /dev/null @@ -1,94 +0,0 @@ -package com.espressif.idf.lsp.preferences; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Objects; -import java.util.Optional; - -import org.eclipse.cdt.lsp.clangd.ClangdMetadata; -import org.eclipse.cdt.lsp.clangd.ClangdOptions; -import org.eclipse.core.runtime.preferences.IScopeContext; -import org.eclipse.core.runtime.preferences.PreferenceMetadata; - -public class IDFClangdPreferredOptions implements ClangdOptions -{ - private final String qualifier; - private final IScopeContext[] scopes; - private final ClangdMetadata metadata; - - IDFClangdPreferredOptions(String qualifier, IScopeContext[] scopes, ClangdMetadata metadata) - { - this.qualifier = Objects.requireNonNull(qualifier); - this.scopes = Objects.requireNonNull(scopes); - this.metadata = Objects.requireNonNull(metadata); - } - - @Override - public String clangdPath() - { - return stringValue(metadata.clangdPath()); - } - - @Override - public boolean useTidy() - { - return booleanValue(metadata.useTidy()); - } - - @Override - public boolean useBackgroundIndex() - { - return booleanValue(metadata.useBackgroundIndex()); - } - - @Override - public String completionStyle() - { - return stringValue(metadata.completionStyle()); - } - - @Override - public boolean prettyPrint() - { - return booleanValue(metadata.prettyPrint()); - } - - @Override - public String queryDriver() - { - return stringValue(metadata.queryDriver()); - } - - @Override - public List additionalOptions() - { - var options = stringValue(metadata.additionalOptions()); - if (options.isBlank()) - { - return new ArrayList<>(); - } - return Arrays.asList(options.split(System.lineSeparator())); - } - - private String stringValue(PreferenceMetadata meta) - { - String actual = String.valueOf(meta.defaultValue()); - for (int i = scopes.length - 1; i >= 0; i--) - { - IScopeContext scope = scopes[i]; - String previous = actual; - actual = scope.getNode(qualifier).get(meta.identifer(), previous); - } - return actual; - } - - private boolean booleanValue(PreferenceMetadata meta) - { - return Optional.of(meta)// - .map(this::stringValue)// - .map(Boolean::valueOf)// - .orElseGet(meta::defaultValue); - } - -} diff --git a/bundles/com.espressif.idf.lsp/src/com/espressif/idf/lsp/preferences/IDFEditorMetadataDefaults.java b/bundles/com.espressif.idf.lsp/src/com/espressif/idf/lsp/preferences/IDFEditorMetadataDefaults.java new file mode 100644 index 000000000..e59c4ba5a --- /dev/null +++ b/bundles/com.espressif.idf.lsp/src/com/espressif/idf/lsp/preferences/IDFEditorMetadataDefaults.java @@ -0,0 +1,39 @@ +package com.espressif.idf.lsp.preferences; + +import java.util.ArrayList; +import java.util.List; +import java.util.Set; + +import org.eclipse.cdt.lsp.config.ConfigurationMetadataBase; +import org.eclipse.cdt.lsp.editor.EditorMetadata; +import org.eclipse.core.runtime.preferences.PreferenceMetadata; +import org.osgi.service.component.annotations.Component; + +@Component(property = { "service.ranking:Integer=0" }) +public class IDFEditorMetadataDefaults extends ConfigurationMetadataBase implements EditorMetadata +{ + + @Override + protected List> definePreferences() + { + Set filteredKeys = Set.of(Predefined.showTryLspBanner.identifer(), + Predefined.preferLspEditor.identifer()); + var filteredDefaults = Predefined.defaults.stream().filter(pref -> filteredKeys.contains(pref.identifer())) + .toList(); + + var showTryLspBannerCustomDefault = wrapWithCustomDefaultValue(false, Predefined.showTryLspBanner); + var preferLspEditorCustomDefault = wrapWithCustomDefaultValue(true, Predefined.preferLspEditor); + + List> mergedPreferences = new ArrayList<>(filteredDefaults); + mergedPreferences.add(showTryLspBannerCustomDefault); + mergedPreferences.add(preferLspEditorCustomDefault); + + return mergedPreferences; + } + + private PreferenceMetadata wrapWithCustomDefaultValue(T customDefaultValue, PreferenceMetadata metadata) + { + return new PreferenceMetadata<>(metadata.valueClass(), metadata.identifer(), customDefaultValue, + metadata.name(), metadata.description()); + } +} diff --git a/bundles/com.espressif.idf.sdk.config.core/.classpath b/bundles/com.espressif.idf.sdk.config.core/.classpath index 04cd50494..5050774b8 100644 --- a/bundles/com.espressif.idf.sdk.config.core/.classpath +++ b/bundles/com.espressif.idf.sdk.config.core/.classpath @@ -1,12 +1,21 @@ - + + + + + - + + + + + + + - - + diff --git a/bundles/com.espressif.idf.sdk.config.ui/.classpath b/bundles/com.espressif.idf.sdk.config.ui/.classpath index 04cd50494..5050774b8 100644 --- a/bundles/com.espressif.idf.sdk.config.ui/.classpath +++ b/bundles/com.espressif.idf.sdk.config.ui/.classpath @@ -1,12 +1,21 @@ - + + + + + - + + + + + + + - - + diff --git a/bundles/com.espressif.idf.serial.monitor/.classpath b/bundles/com.espressif.idf.serial.monitor/.classpath index 4a56a8ab0..9e27f8826 100644 --- a/bundles/com.espressif.idf.serial.monitor/.classpath +++ b/bundles/com.espressif.idf.serial.monitor/.classpath @@ -1,7 +1,17 @@ - - + + + + + + + + + + + + @@ -17,23 +27,12 @@ - - - - - - - - - - - - - + + - + diff --git a/bundles/com.espressif.idf.terminal.connector.serial/.classpath b/bundles/com.espressif.idf.terminal.connector.serial/.classpath index 3efd7c851..81a15493d 100644 --- a/bundles/com.espressif.idf.terminal.connector.serial/.classpath +++ b/bundles/com.espressif.idf.terminal.connector.serial/.classpath @@ -1,14 +1,23 @@ - + - - - + + + + + + - + + + + + + + diff --git a/bundles/com.espressif.idf.terminal.connector/.classpath b/bundles/com.espressif.idf.terminal.connector/.classpath index 1d325df46..5050774b8 100644 --- a/bundles/com.espressif.idf.terminal.connector/.classpath +++ b/bundles/com.espressif.idf.terminal.connector/.classpath @@ -1,12 +1,21 @@ - + - - - + + + + + + + + + + + + diff --git a/bundles/com.espressif.idf.ui/.classpath b/bundles/com.espressif.idf.ui/.classpath index 4f0c64593..5edf176de 100644 --- a/bundles/com.espressif.idf.ui/.classpath +++ b/bundles/com.espressif.idf.ui/.classpath @@ -1,23 +1,25 @@ - - - - + - + - + + - + + - + + + + + - + - - + diff --git a/bundles/com.espressif.idf.ui/META-INF/MANIFEST.MF b/bundles/com.espressif.idf.ui/META-INF/MANIFEST.MF index 247427391..bebeaaf32 100644 --- a/bundles/com.espressif.idf.ui/META-INF/MANIFEST.MF +++ b/bundles/com.espressif.idf.ui/META-INF/MANIFEST.MF @@ -15,7 +15,7 @@ Require-Bundle: org.eclipse.core.runtime, org.eclipse.ui;visibility:=reexport, org.eclipse.jface, org.eclipse.cdt.core.native, - org.eclipse.cdt.core, + org.eclipse.cdt.core;bundle-version="9.0.0", org.eclipse.ui.forms, org.eclipse.cdt.ui, org.eclipse.cdt.managedbuilder.core, @@ -44,8 +44,8 @@ Require-Bundle: org.eclipse.core.runtime, org.eclipse.tools.templates.ui, org.freemarker.freemarker, org.eclipse.tools.templates.freemarker, - org.eclipse.cdt.lsp;bundle-version="1.0.0", - org.eclipse.cdt.lsp.clangd;bundle-version="1.0.0" + org.eclipse.cdt.lsp;bundle-version="3.0.0", + org.eclipse.cdt.lsp.clangd;bundle-version="3.0.0" Automatic-Module-Name: com.espressif.idf.ui Bundle-ActivationPolicy: lazy Bundle-RequiredExecutionEnvironment: JavaSE-17 diff --git a/bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/LaunchBarListener.java b/bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/LaunchBarListener.java index e74e653c7..10f18feb5 100644 --- a/bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/LaunchBarListener.java +++ b/bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/LaunchBarListener.java @@ -19,6 +19,8 @@ import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.debug.core.DebugPlugin; +import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.jobs.Job; import org.eclipse.debug.core.ILaunchConfiguration; import org.eclipse.debug.core.ILaunchManager; import org.eclipse.debug.core.ILaunchMode; diff --git a/bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/dialogs/CMakeBuildTab2.java b/bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/dialogs/CMakeBuildTab2.java index 0cc5fe6c9..7487a0d11 100644 --- a/bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/dialogs/CMakeBuildTab2.java +++ b/bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/dialogs/CMakeBuildTab2.java @@ -12,7 +12,8 @@ import java.util.Map; -import org.eclipse.cdt.cmake.core.internal.CMakeBuildConfiguration; +import org.eclipse.cdt.cmake.core.CMakeBuildConfiguration; +import org.eclipse.cdt.cmake.core.ICMakeBuildConfiguration; import org.eclipse.cdt.debug.core.launch.CoreBuildLaunchConfigDelegate; import org.eclipse.cdt.launch.internal.ui.LaunchMessages; import org.eclipse.cdt.launch.ui.corebuild.CommonBuildTab; @@ -207,10 +208,12 @@ public void initializeFrom(ILaunchConfiguration configuration) configuration.getAttribute(CMakeBuildConfiguration.CMAKE_ARGUMENTS, StringUtil.EMPTY)); cmakeArgsText.setText(cmakeArgs); - String buildCommand = configuration.getAttribute(CMakeBuildConfiguration.BUILD_COMMAND, StringUtil.EMPTY); + String buildCommand = configuration.getAttribute(CMakeBuildConfiguration.CMAKE_BUILD_COMMAND, + StringUtil.EMPTY); buildCommandText.setText(buildCommand); - String cleanCommand = configuration.getAttribute(CMakeBuildConfiguration.CLEAN_COMMAND, StringUtil.EMPTY); + String cleanCommand = configuration.getAttribute(CMakeBuildConfiguration.CMAKE_CLEAN_TARGET, + StringUtil.EMPTY); cleanCommandText.setText(cleanCommand); } @@ -250,7 +253,7 @@ public void performApply(ILaunchConfigurationWorkingCopy configuration) configuration.setAttribute(IDFLaunchConstants.BUILD_FOLDER_PATH, buildFolderText.getText()); - configuration.setAttribute(CMakeBuildConfiguration.CMAKE_GENERATOR, + configuration.setAttribute(ICMakeBuildConfiguration.CMAKE_GENERATOR, ninjaGenButton.getSelection() ? NINJA : UNIX_MAKEFILES); String cmakeArgs = cmakeArgsText.getText().trim(); @@ -263,27 +266,27 @@ public void performApply(ILaunchConfigurationWorkingCopy configuration) else { configuration.removeAttribute(LOCAL_CMAKE_ARGUMENTS); - configuration.removeAttribute(CMakeBuildConfiguration.CMAKE_ARGUMENTS); + configuration.removeAttribute(ICMakeBuildConfiguration.CMAKE_ARGUMENTS); } String buildCommand = buildCommandText.getText().trim(); if (!buildCommand.isEmpty()) { - configuration.setAttribute(CMakeBuildConfiguration.BUILD_COMMAND, buildCommand); + configuration.setAttribute(CMakeBuildConfiguration.CMAKE_BUILD_COMMAND, buildCommand); } else { - configuration.removeAttribute(CMakeBuildConfiguration.BUILD_COMMAND); + configuration.removeAttribute(CMakeBuildConfiguration.CMAKE_BUILD_COMMAND); } String cleanCommand = cleanCommandText.getText().trim(); if (!cleanCommand.isEmpty()) { - configuration.setAttribute(CMakeBuildConfiguration.CLEAN_COMMAND, cleanCommand); + configuration.setAttribute(CMakeBuildConfiguration.CMAKE_CLEAN_TARGET, cleanCommand); } else { - configuration.removeAttribute(CMakeBuildConfiguration.CLEAN_COMMAND); + configuration.removeAttribute(CMakeBuildConfiguration.CMAKE_CLEAN_TARGET); } } @@ -296,8 +299,8 @@ protected void saveProperties(Map properties) properties.put(IDFLaunchConstants.BUILD_FOLDER_PATH, buildFolderText.getText().trim()); properties.put(LOCAL_CMAKE_ARGUMENTS, cmakeArgsText.getText().trim()); - properties.put(CMakeBuildConfiguration.BUILD_COMMAND, buildCommandText.getText().trim()); - properties.put(CMakeBuildConfiguration.CLEAN_COMMAND, cleanCommandText.getText().trim()); + properties.put(CMakeBuildConfiguration.CMAKE_BUILD_COMMAND, buildCommandText.getText().trim()); + properties.put(CMakeBuildConfiguration.CMAKE_CLEAN_TARGET, cleanCommandText.getText().trim()); } @Override @@ -336,7 +339,7 @@ protected void restoreProperties(Map properties) cmakeArgsText.setText(StringUtil.EMPTY); } - String buildCmd = properties.get(CMakeBuildConfiguration.BUILD_COMMAND); + String buildCmd = properties.get(CMakeBuildConfiguration.CMAKE_BUILD_COMMAND); if (buildCmd != null) { buildCommandText.setText(buildCmd); @@ -346,7 +349,7 @@ protected void restoreProperties(Map properties) buildCommandText.setText(StringUtil.EMPTY); } - String cleanCmd = properties.get(CMakeBuildConfiguration.CLEAN_COMMAND); + String cleanCmd = properties.get(CMakeBuildConfiguration.CMAKE_CLEAN_TARGET); if (cleanCmd != null) { cleanCommandText.setText(cleanCmd); diff --git a/bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/handlers/FileOpenListener.java b/bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/handlers/FileOpenListener.java index 464d7fb89..2d5b997fc 100644 --- a/bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/handlers/FileOpenListener.java +++ b/bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/handlers/FileOpenListener.java @@ -10,6 +10,8 @@ import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.content.IContentType; import org.eclipse.core.runtime.content.IContentTypeManager; +import org.eclipse.launchbar.core.ILaunchBarManager; +import org.eclipse.launchbar.core.target.ILaunchTarget; import org.eclipse.ui.IEditorPart; import org.eclipse.ui.IPartListener2; import org.eclipse.ui.IWorkbenchPart; diff --git a/bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/templates/FormBrowser.java b/bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/templates/FormBrowser.java index 3e7b7cc12..9051b7c4c 100644 --- a/bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/templates/FormBrowser.java +++ b/bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/templates/FormBrowser.java @@ -51,9 +51,8 @@ public void createControl(Composite parent) flayout.marginHeight = 1; container.setLayout(flayout); formText = new Browser(container, SWT.NONE); - LocationListener locationListener = new LocationListener() + formText.addLocationListener(new LocationListener() { - @Override public void changing(LocationEvent event) { @@ -68,17 +67,14 @@ public void changing(LocationEvent event) { // no need to report } - formText.setText(text); } @Override public void changed(LocationEvent event) { - + // Empty or custom behavior for changed() if needed } - - }; - formText.addLocationListener(locationListener); + }); if (borderStyle == SWT.NULL) { diff --git a/bundles/com.espressif.idf.wokwi/.classpath b/bundles/com.espressif.idf.wokwi/.classpath index 3628e3368..5050774b8 100644 --- a/bundles/com.espressif.idf.wokwi/.classpath +++ b/bundles/com.espressif.idf.wokwi/.classpath @@ -1,11 +1,21 @@ - + - + - + + + + + + + + + + + diff --git a/bundles/pom.xml b/bundles/pom.xml index 9560c1730..3f12d034d 100644 --- a/bundles/pom.xml +++ b/bundles/pom.xml @@ -46,7 +46,7 @@ target-platform-configuration ${tycho-version} - org.eclipse.justj.openjdk.hotspot.jre.full-17 + org.eclipse.justj.openjdk.hotspot.jre.full-21 win32 diff --git a/docs/en/marketplaceupdate.rst b/docs/en/marketplaceupdate.rst index 7d13873aa..9530eb651 100644 --- a/docs/en/marketplaceupdate.rst +++ b/docs/en/marketplaceupdate.rst @@ -91,3 +91,22 @@ If you have already installed the IDF Eclipse Plugin using the update site URL, 3. Click `Next` to proceed with the installation. .. image:: ../../media/Update_plugins.png + +If the next version of the plugin requires updated dependencies (e.g., the minimum CDT version has changed from 11.6 to 12), you’ll need to ensure these dependencies are updated during installation from the update site. + +.. image:: ../../media/Update_dependencies.png + +If the required dependencies are not updated, the installer will display the following error: +`The installation cannot be completed as requested.` + +To resolve this: + +1. Click Show original error and build my own solution. +2. Then select both: + +- Update items already installed +- Remove items already installed + +.. image:: ../../media/Resolve_update_error.png + +This will allow the installer to update or replace any conflicting components and continue the installation successfully. diff --git a/docs/en/prerequisites.rst b/docs/en/prerequisites.rst index a5827fb5a..7fbfd7e54 100644 --- a/docs/en/prerequisites.rst +++ b/docs/en/prerequisites.rst @@ -15,7 +15,7 @@ Software Prerequisites ----------------------- The minimum requirements for running the Espressif-IDE are listed below. -- `Java 17 `_ and above. +- `Java 21 `_ and above. - `Python 3.12 `_ and above. - `Git `_. - `ESP-IDF Prerequisites `_ based on your Operating System. diff --git a/media/Resolve_update_error.png b/media/Resolve_update_error.png new file mode 100644 index 000000000..e1f16742b Binary files /dev/null and b/media/Resolve_update_error.png differ diff --git a/media/Update_dependencies.png b/media/Update_dependencies.png new file mode 100644 index 000000000..18d201eac Binary files /dev/null and b/media/Update_dependencies.png differ diff --git a/releng/com.espressif.idf.configuration/pom.xml b/releng/com.espressif.idf.configuration/pom.xml index 6b7fb7112..898d04b7e 100644 --- a/releng/com.espressif.idf.configuration/pom.xml +++ b/releng/com.espressif.idf.configuration/pom.xml @@ -7,7 +7,7 @@ 3.9 - 4.0.6 + 4.0.9 ${tycho-version} UTF-8 3.3.0 @@ -38,7 +38,7 @@ p2 consider - org.eclipse.justj.openjdk.hotspot.jre.full-17 + org.eclipse.justj.openjdk.hotspot.jre.full-21 linux @@ -55,6 +55,11 @@ cocoa x86_64 + + macosx + cocoa + aarch64 + diff --git a/releng/com.espressif.idf.product/idf.product b/releng/com.espressif.idf.product/idf.product index 5e15ae0a6..9144782ee 100644 --- a/releng/com.espressif.idf.product/idf.product +++ b/releng/com.espressif.idf.product/idf.product @@ -14,11 +14,11 @@ - -Xms2048m -Xmx4096m -Dosgi.requiredJavaVersion=17 -Dosgi.instance.area.default=@user.home/workspace + -Xms2048m -Xmx4096m -Dosgi.requiredJavaVersion=21 -Dosgi.instance.area.default=@user.home/workspace - -Xms2048m -Xmx4096m -Xdock:icon=../Resources/espressif.icns -XstartOnFirstThread -Dosgi.requiredJavaVersion=17 -Dorg.eclipse.swt.internal.carbon.smallFonts -Dosgi.instance.area.default=@user.home/workspace + -Xms2048m -Xmx4096m -Xdock:icon=../Resources/espressif.icns -XstartOnFirstThread -Dosgi.requiredJavaVersion=21 -Dorg.eclipse.swt.internal.carbon.smallFonts -Dosgi.instance.area.default=@user.home/workspace - -Xms2048m -Xmx4096m -Dosgi.requiredJavaVersion=17 -Dosgi.instance.area.default=@user.home/workspace + -Xms2048m -Xmx4096m -Dosgi.requiredJavaVersion=21 -Dosgi.instance.area.default=@user.home/workspace @@ -42,10 +42,10 @@ - org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17 - org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17 + org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-21 + org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-21 org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11 - org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17 + org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-21 diff --git a/releng/com.espressif.idf.product/pom.xml b/releng/com.espressif.idf.product/pom.xml index 16524f77b..95155d6f9 100644 --- a/releng/com.espressif.idf.product/pom.xml +++ b/releng/com.espressif.idf.product/pom.xml @@ -114,7 +114,7 @@ target-platform-configuration ${tycho-version} - org.eclipse.justj.openjdk.hotspot.jre.full-17 + org.eclipse.justj.openjdk.hotspot.jre.full-21 win32 diff --git a/releng/com.espressif.idf.target/com.espressif.idf.target.target b/releng/com.espressif.idf.target/com.espressif.idf.target.target index ff1e7150c..59b3766c0 100644 --- a/releng/com.espressif.idf.target/com.espressif.idf.target.target +++ b/releng/com.espressif.idf.target/com.espressif.idf.target.target @@ -3,7 +3,7 @@ - + @@ -19,7 +19,7 @@ - + @@ -45,7 +45,7 @@ - + @@ -78,25 +78,27 @@ - + + + - + - - + + - - - + + + diff --git a/releng/com.espressif.idf.update/category.xml b/releng/com.espressif.idf.update/category.xml index 51ec3d0d0..1ef6a4595 100644 --- a/releng/com.espressif.idf.update/category.xml +++ b/releng/com.espressif.idf.update/category.xml @@ -21,15 +21,18 @@ - - - + + + + + + @@ -84,8 +87,8 @@ - - + +