Skip to content

Commit

Permalink
fix: Address issue with the cdt-lsp-2.0.0 (#1021)
Browse files Browse the repository at this point in the history
* fix: Address issues witheclipse 4.32 and cdt-lsp 2.0
  • Loading branch information
kolipakakondal authored Aug 12, 2024
1 parent bf25a0a commit 8784a80
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@
*******************************************************************************/
package com.espressif.idf.core.util;

import java.io.IOException;
import java.util.stream.Stream;

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.editor.Configuration;
import org.eclipse.cdt.lsp.config.Configuration;
import org.eclipse.cdt.lsp.util.LspUtils;
import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.lsp4e.LanguageServerWrapper;
import org.eclipse.ui.PlatformUI;
Expand Down Expand Up @@ -41,7 +40,7 @@ public void restartLspServers()
{
w.restart();
}
catch (IOException e)
catch (Exception e)
{
Logger.log(e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
*******************************************************************************/
package com.espressif.idf.lsp.preferences;

import java.util.Collections;
import java.util.List;
import java.util.Optional;

import org.eclipse.cdt.lsp.clangd.BuiltinClangdOptionsDefaults;
import org.eclipse.cdt.lsp.clangd.ClangdOptionsDefaults;
import org.osgi.service.component.annotations.Component;

Expand All @@ -18,9 +19,8 @@
* @author Kondal Kolipaka <[email protected]>
*
*/
@SuppressWarnings("restriction")
@Component(service = ClangdOptionsDefaults.class, property = { "service.ranking:Integer=100" })
public class IDFClangdOptionsDefaults extends BuiltinClangdOptionsDefaults
public class IDFClangdOptionsDefaults implements ClangdOptionsDefaults
{

@Override
Expand All @@ -34,10 +34,41 @@ public String clangdPath()
@Override
public String queryDriver()
{
// By passing --query-driver argument to clangd helps to resolve the cross-compiler toolchain headers.
// 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(super.queryDriver());
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<String> additionalOptions()
{
return Collections.emptyList();
}

}
28 changes: 13 additions & 15 deletions releng/com.espressif.idf.target/com.espressif.idf.target.target
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<target name="com.espressif.idf.target" sequenceNumber="25">
<locations>
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<repository location="https://download.eclipse.org/eclipse/updates/4.30"/>
<repository location="https://download.eclipse.org/eclipse/updates/4.32"/>
<unit id="org.eclipse.equinox.sdk.feature.group" version="0.0.0"/>
<unit id="org.eclipse.rcp.feature.group" version="0.0.0"/>
<unit id="org.eclipse.rcp.source.feature.group" version="0.0.0"/>
Expand All @@ -19,7 +19,7 @@

</location>
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<repository location="https://download.eclipse.org/releases/2023-12"/>
<repository location="https://download.eclipse.org/releases/2024-06"/>
<unit id="org.eclipse.cdt.autotools.feature.group" version="0.0.0"/>
<unit id="org.eclipse.cdt.feature.group" version="0.0.0"/>
<unit id="org.eclipse.cdt.sdk.feature.group" version="0.0.0"/>
Expand Down Expand Up @@ -87,11 +87,6 @@
<repository location="http://download.eclipse.org/nebula/releases/latest"/>
<unit id="org.eclipse.nebula.widgets.xviewer.feature.feature.group" version="0.0.0"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<repository location="https://download.eclipse.org/tools/cdt/releases/cdt-lsp-1.1/"/>
<unit id="org.eclipse.cdt.lsp.feature.feature.group" version="1.1.0.202402211419"/>
<unit id="org.yaml.snakeyaml" version="2.0.0"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<repository location="https://download.eclipse.org/embed-cdt/updates/v6/"/>
<unit id="org.eclipse.embedcdt.debug.gdbjtag.feature.group" version="6.4.0.202307251916"/>
Expand All @@ -100,14 +95,12 @@
<unit id="org.eclipse.embedcdt.packs.feature.group" version="6.4.0.202307251916"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<repository location="https://download.eclipse.org/lsp4e/releases/0.25.0/"/>
<unit id="com.google.gson" version="2.10.1"/>
<unit id="org.eclipse.lsp4e" version="0.18.6.202403050753"/>
<unit id="org.eclipse.lsp4e.debug" version="0.15.7.202402141138"/>
<unit id="org.eclipse.lsp4j" version="0.22.0.v20240213-2011"/>
<unit id="org.eclipse.lsp4j.debug" version="0.22.0.v20240213-2011"/>
<unit id="org.eclipse.lsp4j.jsonrpc" version="0.22.0.v20240213-2011"/>
<unit id="org.eclipse.lsp4j.jsonrpc.debug" version="0.22.0.v20240213-2011"/>
<repository location="https://download.eclipse.org/lsp4e/releases/0.26.3/"/>
<unit id="com.google.gson" version="2.11.0"/>
<unit id="org.eclipse.lsp4j" version="0.23.1.v20240521-1815"/>
<unit id="org.eclipse.lsp4j.debug" version="0.23.1.v20240521-1815"/>
<unit id="org.eclipse.lsp4j.jsonrpc" version="0.23.1.v20240521-1815"/>
<unit id="org.eclipse.lsp4j.jsonrpc.debug" version="0.23.1.v20240521-1815"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<repository location="https://download.eclipse.org/tm4e/releases/0.9.0/"/>
Expand Down Expand Up @@ -139,5 +132,10 @@
</dependency>
</dependencies>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<repository location="https://download.eclipse.org/tools/cdt/releases/cdt-lsp-2.0/"/>
<unit id="org.eclipse.cdt.lsp.feature.feature.group" version="2.0.0.202406041551"/>
<unit id="org.yaml.snakeyaml" version="2.2.0"/>
</location>
</locations>
</target>

0 comments on commit 8784a80

Please sign in to comment.