kangarko / ChatControl-Red

Issue tracker and documentation for the next generation ChatControl Red, the most advanced chat management plugin.
49 stars 23 forks source link

1.18.2 Is there a reason the rust filetype is used for messages with .rs instead of .yml #2339

Closed TomLewis closed 1 year ago

TomLewis commented 1 year ago

Are you using MySQL?

Yes

Are you using BungeeCord/Velocity?

Yes - Velocity

Question

Every time I open up a .rs file in VSCode I have to change the fieltype to YAML to get proper syntax highlighting.

I cant remember the reason .rs was picked, but these are .yml files, it would be nice to have them all consistent.

Same with varables that use JS, could there not be a /js folder inside varables foler with .js files, then in the Varaible Value: write the filename.

Then all JS files will also be syntax highlighted.

I personally dont use any of the custom JS stuff, as its too complex, but it would be nice to have it organised with correct filetypes for:

1) consistency 2) Syntax highlighting 3) Code completion in things like Copilot, this requires to have that code as the filetype and does not work with mixing code inside other filetypes.

Another idea, Expand this plugin to work with ChatControl Red https://marketplace.visualstudio.com/items?itemName=Nobuwu.mc-color

I use that to show message display in-editor before I push in-game, sadly it does not accept/show hex colors or anything specific to chatcontrol red. Might be an idae to fork it and make your own ChatControl Red VSCode extension.

kangarko commented 1 year ago

No I randomly made it up haha.

On the serious note, I thought it would make sense because it stands for "ruleset" thus the ending.

I am open to changing the filename but I feel this is a small change that will result in more confusion that good. I might just add RuleSet to the wiki for further clarification.

I do like the JS idea, do you have longer scripts that you see not fit inside the yml files?

TomLewis commented 1 year ago

I dont have any big JS files, its too complex for my little brain, but I cant stand that theres JS inside a .yml file, its so untidy!

Think about it like this, everyone has to edit the files in a code editor and quite a few users may not understand that these are yml files, or understand that they have to change the filetype to get them highlighted properly. Currently it thinks these are rust files, which means code editors display errors for code syntax, as these are not rust files..

When they open them, it would make sence to just have them syntax highighted like all other yml files they have used before, the filetype .rs has no benefits! Only confusion.

Reminds me of this: https://xkcd.com/927/

since the filetype wont make a lick of differance, you could check for both .rs and .yml files in the directory when loading for those that wish to keep .rs, they can! But default it to .yml makes no sence 😂

kangarko commented 1 year ago

How about ".rules". Sounds pretty obscure to be popular so extensions could easily be developed to target this filename specifically for ChatControl or relevant plugins using our language pattern

TomLewis commented 1 year ago

same problem haha, I just want to be able to open the file and not have to mess around changing the filetype.

Like your chat.rs, is kind of a unique pattern, but timed.rs isnt, thats just entirely YML, these are yml files, so it should default to .yml, and then if you ever develop an addon for VSCode to highlight your syntax for rules, that can still use the .yml format! See that plugin I sent, the one that makes minecraft colors work in the editor, that works on normal .yml files, I use it with ChatControl files! You just tell it what filetypes to highlight in.

Then you have a base .yml for all editors, and you have the option of creating a Vscode extension for your custom ruleset if you wanted that works with the .yml files, it could even check the folder to see if its in a chatcontrol directory!

ElBananaa commented 1 year ago

I agree with TomLewis, using yaml files for rules and variables (or even using js files directly for custom variables) would be nice. Most of us got used to the rust files, but it clearly isn't intuitive at all for new users, and, as TomLewis said, it breaks pretty much all the yaml plugins file editors have.

Using .rules can be cool, but that's it imo. Extensions could be developed for this, but that would honestly be a waste of time, and, I honestly doubt most users would want to download multiples new extensions simply for chatcontrol-red. Yaml is the standard for configs in the mc community, there are hundreds of extensions already available, up to date and with a lot of different features for pretty much every single file editor on the market, so I do think you should stick with that.

kangarko commented 1 year ago

The rules language is different from YAML, it wont compile on https://yaml-online-parser.appspot.com/ so I am other open to leaving it as-is, converting back to .txt what we had for years, or renaming to .rules. I unfortunately dont have time making the standard yaml-compatible at the moment.