Sarrus1 / sourcepawn-studio

VSCode extension for SourcePawn scripting
https://sarrus1.github.io/sourcepawn-studio/
MIT License
151 stars 23 forks source link

Auto formatting adds spaces between words and symbols on #tryinclude lines #373

Open worMatty opened 8 months ago

worMatty commented 8 months ago

Basic informations

Further Information

#tryinclude lines have extra spaces inserted between words and symbols, causing them to break

To Reproduce

  1. Auto format

Expected behaviour

#undef REQUIRE_PLUGIN
#tryinclude <Source-Chat-Relay> // Discord relay

#undef REQUIRE_EXTENSIONS
#tryinclude <SteamWorks>     // Used to set the game description
#tryinclude <tf2_stocks>     // TF2 Tools extension natives
#tryinclude <tf2items>       // Replacement weapons

Error messages

#undef REQUIRE_PLUGIN
#tryinclude < Source - Chat - Relay>    // Discord relay

#undef REQUIRE_EXTENSIONS
#tryinclude < SteamWorks>    // Used to set the game description
#tryinclude < tf2_stocks>    // TF2 Tools extension natives
#tryinclude < tf2items>      // Replacement weapons
Sarrus1 commented 8 months ago

I will fix this eventually, but note that the extension just calls clang-format under the hood for formatting. All the configs for clang format are available online.

As a workaround, you can do: https://clang.llvm.org/docs/ClangFormatStyleOptions.html#disabling-formatting-on-a-piece-of-code

worMatty commented 8 months ago

Thank you kindly.