Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Espressif-IDE Code Formatting not working (IEP-1349) #1072

Open
sanderdb01 opened this issue Oct 29, 2024 · 4 comments
Open

Espressif-IDE Code Formatting not working (IEP-1349) #1072

sanderdb01 opened this issue Oct 29, 2024 · 4 comments

Comments

@sanderdb01
Copy link

When I open a c file in the editor, none of the shortcuts or code editing works. When I click "Source" on the menu bar, everything in grayed out. I tried resetting my perspective to C/C++, but that still did not solve it. I am on a Mac if that helps. Thanks.

@github-actions github-actions bot changed the title Espressif-IDE Code Formatting not working Espressif-IDE Code Formatting not working (IEP-1349) Oct 29, 2024
@sigmaaa
Copy link
Collaborator

sigmaaa commented Oct 30, 2024

Hi @sanderdb01,

some options don't work with the new LSP editor that we are using. You can still use some Source commands with the right click inside the editor. For the formatting you can try the default key combination cmd+shift+F. You can also set to auto-trigger the formatting with the save action. To do this go to the Preferences -> C/C++ -> Editor(LSP) -> Format source code
image

Note that the formatter settings could be changed by editing the .clang-format file inside the project. https://github.com/eclipse-cdt/cdt-lsp?tab=readme-ov-file#save-actions-using-clang-format

@sanderdb01
Copy link
Author

sanderdb01 commented Oct 31, 2024

got you, thank you for the response. Is there a way to auto comment? Usually on other IDEs I can do cmd/ctrl+ '/' to comment out a line, but that does not work here. According to the IDEs shortcuts, it should be cmd+shift+/, but when I press that, the help search comes up (even if I am clicked into a c file so that should have focus). Thanks.

@sigmaaa
Copy link
Collaborator

sigmaaa commented Oct 31, 2024

Hi @sanderdb01,

the default combination for commenting out the line in the LSP editor is ctrl + 7, but cmd+shift+/ should also work. I was able to reproduce this issue and will take a closer look into it. It's also possible to rebind this combination. To do this:

  • Go to the Preferences -> General -> keys -> look for Toggle Line Comment in the TM4E configuration:
    image

Thank you

@sanderdb01
Copy link
Author

great, thanks. I modified that and it worked. Why does it not work when it is under C/C++ Editor? Just curious.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants