Ability to use other languages' syntax highlighting for custom langs

Hello, I’m making a custom Python preprocessor called Y. It happens that C’s syntax highlighting works perfectly with it.
Unfortunately, if I make the file type *.Y instead of *.C, the syntax highlighting obviously doesn’t work.
I’ve seen other people ask for custom syntax highlighting, but they’ve been ignored from what I’ve seen. It would be very helpful if there were some sort of config file where you could make the project treat certain file types as others.

For example, a preprocessor such as Pug JavaScript, which uses the .pug file extension, would be easier to code in if it was treated as JavaScript with its auto-indent and syntax highlighting. You would also not need to make custom-made syntax highlighting rules for more preprocessors/languages.

Replit configuration allowed for this. In the hidden file .replit, you could configure a language server. See https://docs.replit.com/programming-ide/configuring-repl#languages.
However, replit’s infrastructure has moved away from putting configuration in .replit file, and I have not been able to get language server to work in the past, twice. It might not be working or I might just be bad.
You can check replit’s C template which has an example of language server configuration. It seems to be redundant config though.

2 Likes