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

Add configuration of coding style to Project settings #291

Open
humdingerb opened this issue Jan 15, 2024 · 1 comment
Open

Add configuration of coding style to Project settings #291

humdingerb opened this issue Jan 15, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@humdingerb
Copy link
Contributor

The "Format" menu item works, if there is a .clang-format file in a project's top folder.

However, if there is no .clang-format file, some formatting is applied, though I'm not clear what defaults are used. The indention is changed to two spaces instead of a tab, for example.

I think it would be best to have the user configure this in the "Project settings". There could be a pop-up menu "Use coding style:" and the options "none", "Haiku" and "from Project".

If there's no .clang-format file in the project's top folder, disable "from Project" and make "none" the default. In that case, disable "Edit|Format". Otherwise default to "from Project".

The menu could be renamed to "Apply coding style" which is more decriptive.

@Freaxed
Copy link
Collaborator

Freaxed commented Jan 17, 2024

The default is the "LLVM coding style".
Keep in mind that 'Format' is a LSP command (https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_formatting) and depends on the LSP in use for a specific file. For example pylsp (lsp server for python) has a different default style and a different config file... So the configuration must be per lsp server. Another point is that the "Haiku format" is not exactly following all the haiku rules (only with the haiku-format tool you can have it but is an external tool).

@nexus6-haiku nexus6-haiku added the enhancement New feature or request label May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants