-
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: resolve merge confilict in CMakeMainTab2
- Loading branch information
Showing
33 changed files
with
484 additions
and
84 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 |
---|---|---|
|
@@ -18,13 +18,14 @@ | |
import org.eclipse.cdt.managedbuilder.envvar.IBuildEnvironmentVariable; | ||
|
||
import com.espressif.idf.core.logging.Logger; | ||
import com.espressif.idf.core.util.IDFUtil; | ||
import com.espressif.idf.core.util.StringUtil; | ||
|
||
/** | ||
* @author Kondal Kolipaka <[email protected]> | ||
* | ||
*/ | ||
@SuppressWarnings("restriction") //$NON-NLS-1$ | ||
@SuppressWarnings("restriction") | ||
public class IDFEnvironmentVariables | ||
{ | ||
/** | ||
|
@@ -127,17 +128,21 @@ public Map<String, String> getSystemEnvMap() | |
IEnvironmentVariableManager buildEnvironmentManager = CCorePlugin.getDefault().getBuildEnvironmentManager(); | ||
IEnvironmentVariable[] variables = buildEnvironmentManager.getVariables((ICConfigurationDescription) null, | ||
true); | ||
Map<String, String> envMap = new HashMap<>(); | ||
Map<String, String> envMap = IDFUtil.getSystemEnv(); | ||
if (variables != null) | ||
{ | ||
for (IEnvironmentVariable iEnvironmentVariable : variables) | ||
{ | ||
String key = iEnvironmentVariable.getName(); | ||
if (key.equals(IDFCorePreferenceConstants.IDF_TOOLS_PATH)) | ||
{ | ||
continue; | ||
} | ||
String value = iEnvironmentVariable.getValue(); | ||
envMap.put(key, value); | ||
} | ||
} | ||
|
||
return envMap; | ||
} | ||
|
||
|
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
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
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
9 changes: 9 additions & 0 deletions
9
bundles/com.espressif.idf.core/src/com/espressif/idf/core/util/.clang-format-project
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# We'll use defaults from the LLVM style, but with some modifications so that it's close to the CDT K&R style. | ||
BasedOnStyle: LLVM | ||
UseTab: Always | ||
IndentWidth: 4 | ||
TabWidth: 4 | ||
PackConstructorInitializers: NextLineOnly | ||
BreakConstructorInitializers: AfterColon | ||
IndentAccessModifiers: false | ||
AccessModifierOffset: -4 |
42 changes: 42 additions & 0 deletions
42
bundles/com.espressif.idf.core/src/com/espressif/idf/core/util/ClangFormatFileHandler.java
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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/******************************************************************************* | ||
* Copyright 2024 Espressif Systems (Shanghai) PTE LTD. All rights reserved. | ||
* Use is subject to license terms. | ||
*******************************************************************************/ | ||
package com.espressif.idf.core.util; | ||
|
||
import java.io.IOException; | ||
|
||
import org.eclipse.core.resources.IFile; | ||
import org.eclipse.core.resources.IProject; | ||
import org.eclipse.core.runtime.CoreException; | ||
import org.eclipse.core.runtime.NullProgressMonitor; | ||
|
||
import com.espressif.idf.core.ILSPConstants; | ||
|
||
public class ClangFormatFileHandler | ||
{ | ||
private final IFile clangFormatFile; | ||
|
||
public ClangFormatFileHandler(IProject project) throws CoreException | ||
{ | ||
this.clangFormatFile = project.getFile(ILSPConstants.CLANG_FORMAT_FILE); | ||
} | ||
|
||
/** | ||
* Updates the .clang-format file. If the file does not exist, it is created and initialized with default settings. | ||
* | ||
* @throws IOException if an I/O error occurs during file creation or writing | ||
* @throws CoreException if an error occurs while refreshing the project | ||
*/ | ||
public void update() throws IOException, CoreException | ||
{ | ||
if (clangFormatFile.exists()) | ||
{ | ||
return; | ||
} | ||
try (final var source = getClass().getResourceAsStream(".clang-format-project");) //$NON-NLS-1$ | ||
{ | ||
clangFormatFile.create(source, true, new NullProgressMonitor()); | ||
} | ||
} | ||
} |
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
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 |
---|---|---|
|
@@ -66,5 +66,4 @@ public void updateLspQueryDrivers() | |
metadata.queryDriver().defaultValue()); | ||
} | ||
} | ||
|
||
} |
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
Oops, something went wrong.