sourcepawn-vscode icon indicating copy to clipboard operation
sourcepawn-vscode copied to clipboard

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

Open worMatty opened this issue 10 months ago • 2 comments

Basic informations

  • OS: [Windows] 11
  • VSCode version: Latest
  • Extension version: Latest

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

worMatty avatar Apr 05 '24 18:04 worMatty

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

Sarrus1 avatar Apr 06 '24 04:04 Sarrus1

Thank you kindly.

worMatty avatar Apr 07 '24 11:04 worMatty