-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Address issue with the cdt-lsp-2.0.0 (#1021)
* fix: Address issues witheclipse 4.32 and cdt-lsp 2.0
- Loading branch information
1 parent
bf25a0a
commit 8784a80
Showing
3 changed files
with
52 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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; | ||
|
||
|
@@ -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 | ||
|
@@ -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(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters