Comments (24)
Well, I must say I have experienced pleasure of coding ever since I switched to your custom CDT indexer. It was hard to set up but with your help, it seems to be functioning properly. I like function argument name expansion, suggestions as you type, better C++ support (I don't need to delete the project and import it again) but most of all I no longer need to delete an extra prefix space that was added previously in situations like
#ifdef __cplusplus
extern "C" {
#endif
// note the space before the function
void my_func();
#ifdef __cplusplus
}
#endif
such a negligible thing but I feel relief not fixing each line manually now...
Just fix those minor issues and go with it.
I hope you guys make it stable and it'll become the standard.
from idf-eclipse-plugin.
Previously, I had such problems mostly in C++ files (ESP_LOGX were always highlighted, includes, static const char *TAG
has always been rendered as unused, etc.) but now I see these warnings even in C files.
from idf-eclipse-plugin.
Tried installing ESP-IDF again after the plugin was updated - didn't help.
from idf-eclipse-plugin.
Hi @dizcza Could you share a sample application which I download and try?
from idf-eclipse-plugin.
Oh, when I deleted the project and imported it again, everything was resolved. Perhaps, I ignored the warning after Eclipse update about the old workspace directory and clicked continue.
Now what is being highlighted are atomics (have always been, I remember you said it's not on your side) and esp_log
s (only for C++ files). C++ files are resolved much better now compared to v2.2, where I had plenty of highlights.
You can test the esp_log yourself:
#include "esp_log.h"
static const char *TAG = "main";
extern "C" { void app_main(); }
void app_main(void)
{
ESP_LOGI(TAG, "main init");
while (1) {
;
}
}
Both TAG
and ESP_LOGI
are highlighted as unused and a syntax error respectively - it's triggered only in C++ sources, C files don't exhibit such a behavior.
While I was happy writing it, I still hit the same issue with a completely new project. Steps to reproduce:
- Create a new ESP-IDF project from samples and choose
sample_project
, rename it totest_espidf_plugin
. - Move
main.c
tomain.cpp
and update the cmake accordingly. - Write the code to
main.cpp
. - Build. (At this point, everything was resolved correctly - no highlighting errors save for
esp_log
s) - Import another ESP-IDF project, select it from the drop-down build configuration, click build.
- Now the imported project is resolved OK.
- Switch back to the
test_espidf_plugin
project and you'll see highlighted errors again. Clean and rebuild didn't help.
I needed to re-import test_espidf_plugin
again to resolve the problem though it was created a minute ago.
P.S. Funny, among a huge list of syntax errors in the screenshot above, the TAG
is not highlighted :)
from idf-eclipse-plugin.
Hi @dizcza,
Switch back to the test_espidf_plugin project and you'll see highlighted errors again. Clean and rebuild didn't help.
Have you tried closing/reopening or closing/reopening/building the project as a workaround? Usually switching projects in the launch bar causes the indexer to rerun, after the indexer's job is finished, it should be fine, but I'm facing the same issue sometimes, not sure why it happens and what confuses the indexer, but closing and reopening the project helps me in such scenarios.
from idf-eclipse-plugin.
Have you tried closing/reopening or closing/reopening/building the project as a workaround?
I tried both and none of them helped. Only deleting the project and importing it again did the job.
from idf-eclipse-plugin.
Hi @dizcza,
I forgot to mention, that we are working on LSP integration right now, since Eclipse CDT Indexer is not actively maintained, and doesn't support C/C++ 20 (which is used in ESP-IDF 5.0) I think Clangd indexer should work better. It's easy to set by following this guide: https://github.com/espressif/idf-eclipse-plugin/blob/master/docs/clangd_cdt_support.md
from idf-eclipse-plugin.
Well, I don't have the Editor (LSP)
option in C/C++
preferences once I installed the Eclipse CDT-LSP...
Reboot does not help.
from idf-eclipse-plugin.
Well, I don't have the
Editor (LSP)
option inC/C++
preferences once I installed the Eclipse CDT-LSP...Reboot does not help.
hm, that's strange. Are you using the same IDE listed in your log? Your Eclipse, Eclipse CDT, and IDF Eclipse Plugin versions look ok for using the Eclipse LSP plugin. I have similar versions on Mac and Windows (I will try on Linux as well). Have you faced any issues during installation? Could you provide an error log after installing Eclipse LSP, please?
from idf-eclipse-plugin.
Ah, it wasn't installed properly. After I installed it again (somehow, in the previous attempt, the "accept source" window didn't even pop up), I set the paths as suggested. However, I often change the esp-idf version - I pull source code from the master branch, sometimes need to reinstall esp-idf, which creates a new python env and hence I need to repeat the same steps in the eclipse plugin. Previously, I needed to provide only one path - the python path. But now I need to provide three paths:
- Path to python
- Path to clang
- Path to xtensa-gcc
That's quite a headache for me.
Also, after I followed the instructions and set the paths correctly, deleted the project, imported it again, built, but again I'm hitting the same problem I outlined in the first comment: too many highlights, indexer cannot resolve almost anything. Tried re-index, didn't help.
Attaching the logs, if it helps.
from idf-eclipse-plugin.
However, I often change the esp-idf version
We are working on new tools manager that will allow you to switch between esp-idf versions quicker #908
Previously, I needed to provide only one path - the python path. But now I need to provide three paths
If you have multiple projects and each of them requires different esp-idf version, for now you can create different workspaces for different esp-idf versions, or you can configure LSP settings on project level, so you don't have to change path to clang and path to xtensa-gcc each time you are changing your esp-idf (right click on project ->Properties -> Editor LST -> "Enable project-specific settings". We will make this process smoother with futher integration of CDT LSP plugin
I'm hitting the same problem I outlined in the first comment: too many highlights, indexer cannot resolve almost anything
Do you have the same problem even with the clangd enabled?
from idf-eclipse-plugin.
If you have multiple projects and each of them requires different esp-idf version, for now you can create different workspaces for different esp-idf versions, or you can configure LSP settings on project level, so you don't have to change path to clang and path to xtensa-gcc each time you are changing your esp-idf (right click on project ->Properties -> Editor LST -> "Enable project-specific settings". We will make this process smoother with futher integration of CDT LSP plugin
I set only one esp-idf version for all of my projects, it's just I update it often. And if I afterwards don't re-install esp-idf inside the eclipse plugin, then code navigation leads to a wrong line.
Do you have the same problem even with the clangd enabled?
Yes. For instance, "Could not find symbol 'esp_err_t' in index"
from idf-eclipse-plugin.
Sorry, it seems the LST wasn't properly enabled. I remember hitting Apply and close once I provided LST paths but next time when I opened the LST preferences, the "Prefer C/C++ LST" checkbox wasn't ticked and when I enabled it, the paths were there - how is this even possible?...
Anyhow, I reimported the project, and now all C files are displayed as text. And C++ files still have indexer issues
from idf-eclipse-plugin.
The default CDT indexer is off.
from idf-eclipse-plugin.
Hi @dizcza,
The first screenshot appears to show highlights from the regular indexer (LSP colors are different). Perhaps this issue will be resolved by addressing the case related to the second screenshot. From the error log you provided, it seems that the absence of the tm4e dependency is causing the second screenshot (no syntax highlights). Could you please try to obtain this dependency from the following update site: https://download.eclipse.org/tm4e/releases/latest/? To do so, navigate to Help -> Install New Software -> Work with (provide update site here), and then select Batik CSS engine.
Also, in the error logs, there are numerous methods that couldn't be loaded for some reason. For example:
'com.espressif.idf.ui.handlers.DeleteResourceHandler' could not be loaded. At present, I'm uncertain about the cause of this. I will update you on this later.
If updating the tm4e dependency doesn't resolve this issue, would you be open to connecting so we can address these issues together? Please feel free to contact us via email at [email protected]. In your email, mention the time that suits you best, and we will send you an invitation to the meeting on Teams.
from idf-eclipse-plugin.
I switched back to the default indexer for now, it works fine.
I'll consider using your custom indexer if I experience annoying problems again.
from idf-eclipse-plugin.
I'm switching again to your custom editor - the default one breaks often.
After I switch to LSP, how to change the theme? Clicking ThemeMate doesn't do anything. I cannot uncheck the default checkbox for a particular theme and save it - it does not get saved.
from idf-eclipse-plugin.
CTRL+/ does not comment/uncomment the line - expected?
from idf-eclipse-plugin.
Hi @dizcza,
CTRL+/ does not comment/uncomment the line - expected?
No, thank you for reporting this. Looks like some conflict with TM4 Language Configuration and C/C++ editor commands. To fix, please open Preferences -> General -> keys -> in filter type "tm4" -> select "Toggle Line Command" -> Click Copy and then set binding to Ctrl + / :
After I switch to LSP, how to change the theme? Clicking ThemeMate doesn't do anything. I cannot uncheck the default checkbox for a particular theme and save it - it does not get saved.
Do you mean some custom theme? I haven't checked custom themes yet, but the default ones that are available in this list work fine for me:
There is no need to uncheck the "Default" checkbox, I'm just selecting a new theme, then on the checkbox "Default" to make this theme the new default, and after applying my editor colors are updated immediately
from idf-eclipse-plugin.
There is no need to uncheck the "Default" checkbox, I'm just selecting a new theme, then on the checkbox "Default" to make this theme the new default, and after applying my editor colors are updated immediately
So that's the thing, "Apply" does not change the theme I'm selecting in TextMate themes
from idf-eclipse-plugin.
So I have both Solarized Light and Dark themes marked as Default. They cancel each other, and perhaps Solarized Light wins but I'd like to have Dark. Dark is already default, just as Solarized Light. Unchecking the default checkbox in Solarized Light doesn't anything, applying doesn't do anything.
from idf-eclipse-plugin.
So I have both Solarized Light and Dark themes marked as Default. They cancel each other, and perhaps Solarized Light wins but I'd like to have Dark. Dark is already default, just as Solarized Light. Unchecking the default checkbox in Solarized Light doesn't anything, applying doesn't do anything.
To switch the theme from light to dark you need to select the "Dark" theme in General -> Appearance -> Theme combo. So for a dark appearance only dark TextMate configs work and vice versa
from idf-eclipse-plugin.
To switch the theme from light to dark you need to select the "Dark" theme in General -> Appearance -> Theme combo. So for a dark appearance only dark TextMate configs work and vice versa
Ah, so that's how it works.
All right. So far so good.
A couple of minor issues:
1
In a header file
#include "freertos/FreeRTOS.h"
gets highlighted with the message "__GLIBC_USE not defined (included in /usr/include/limits.h 145:5)"
This happens when the corresponding source file for this header is C++, not C. C files (sources and headers) don't show this error. Wrapping this include line with extern "C"
does not help.
When I click and navigate to "FreeRTOS.h", in the first line (starting with a doc string) I get
- Unknown argument -fno-tree-switch-conversion
- Unknown argument -fstrict-volatile-bitfields
My .clangd
:
CompileFlags:
Remove: [-fno-tree-switch-conversion, -fstrict-volatile-bitfields]
2 int types
static int32_t m_task_global_id = 0;
ESP_LOGI(TAG, "loaded task global id: %ld", m_task_global_id);
"%ld" seems the correct way to go for a build: if I change it to "%d", the build fails with the message
error: format '%d' expects argument of type 'int', but argument 6 has type 'int32_t' {aka 'long int'} [-Werror=format=]
1717 | ESP_LOGI(TAG, "loaded task global id: %d", m_task_global_id);
But your indexer keeps it highlighted with "%ld":
Format specifies type long but the argument has type int32_t aka int
Same for %lu
-> %u
, etc. A bit annoying. The default indexer doesn't behave like that.
from idf-eclipse-plugin.
Related Issues (20)
- install error (IEP-1169) HOT 5
- Eclipse Plugin: Add ability to select ESP-Tools location (IEP-1173) HOT 2
- Add the Reset & Restart functionality (IEP-1177) HOT 7
- Abort build process in presence of errors (IEP-1180) HOT 1
- Espressif-IDE-2.12.1-linux.gtk.x86_64 seems Scanner is broken (IEP-1182) HOT 1
- macOS 14.4 Sonoma (IEP-1185) HOT 1
- IDE installation error (IEP-1188) HOT 3
- Not able to see data in teraterm (IEP-1191)
- Unresolved inclusion. unless it was included in "app_main.c". (IEP-1206)
- Drop python in favor of out-of-the-box available java (IEP-1235) HOT 1
- Move 'ESP-IDF: ****' context menu items into 'ESP-IDF' SUBMENU instead of putting them on top level (IEP-1236) HOT 4
- Remove internet shortcut icon out of the status bar (IEP-1237) HOT 1
- com.espressif.idf.core.idfNature resource key must have matching localized string value (IEP-1238)
- Invalid (tools and dist) installation path: '${USER_HOME}/.espressif/...' instead of user-provided directory (IEP-1239) HOT 2
- Invalid 'Espressif IDF Project' project configuration (IEP-1240) HOT 1
- Eclipse muzz never stuck building espressif plugin project (IEP-1241) HOT 1
- Invalid error message "ninja failed with exit code 1, output of the command is in the ..." (IEP-1242)
- Invalid ะก/ะก++ project structure concept: using separate source files accompanied with headers(*.h) included in main *.c file muzz be possible (IEP-1243) HOT 2
- Invalid error message "Configuring incomplete, errors occurred!\nSee also..." (IEP-1244)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from idf-eclipse-plugin.