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 options for Clangd formatting file per template #1235

Open
weirdbeardgame opened this issue May 11, 2024 · 2 comments
Open

Add options for Clangd formatting file per template #1235

weirdbeardgame opened this issue May 11, 2024 · 2 comments

Comments

@weirdbeardgame
Copy link

Is your feature request related to a problem? Please describe.
When uploading scratches line spacing and new line formatting doesn't match a particular coding style I always like to use and id prefer to be able to set my own formatting.

Describe the solution you'd like
Add an option when editing a preset to upload a .clangd file that can then apply to every scratch using that preset.

Additional context
Think how VScode and other editors have formattable spacing and new line guidelines.

@bates64
Copy link
Member

bates64 commented May 12, 2024

IMO:

  1. Context filesystem #361
  2. Read .clang-format

@ethteck
Copy link
Member

ethteck commented May 12, 2024

My vote here would be to just use localstorage to allow users to put their own clang-format file in, continuing the local settings-esque nature of this feature. At some point, we could have an optional field on Preset that lets you format with the Preset (project)'s settings if they are present. But I think it's probably best to keep things client-side for now

Currently, the only formatting we run at all is done in the browser, it must be invoked manually, and it requires the language server to be enabled. So before we do much more with that feature, we should probably decide how far we want to go with it. Should we be doing backend formatting? I would prefer we don't, since I think it's kind of out of scope, but it's a conceivable direction

Personally, I think of the code formatting feature as something that's a nice-to-have as a result of having a language server, not a core site feature. The site is meant for figuring out matches, rather than producing polished code for a repo. But since we run clang-format browser-side, having a localstorage clang-format file seems appropriate

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

3 participants