japhib / pico8-ls

PICO-8 Language Server
MIT License
64 stars 8 forks source link

Syntax highlighting not working in included .p8 files (without cart header) #19

Closed TheRoboZ closed 1 year ago

TheRoboZ commented 2 years ago

Using #include with .p8 files I don't get syntax highlighting unless I put "LUA" at the beginning of each file (as in the cartridge header). Seems that the header is what triggers syntax highlighting. For the time being I am adding it commented "--LUA" in every included file but I think that the .p8 extension should be enough to trigger syntax recognition.

Note: This p8 language server is the only extension I am using, I am not using the Lua language server so I can't just rename them as .lua (which sometimes gives different coloring results, so a pico-8 only system should be preferable)

japhib commented 1 year ago

I can't just rename them as .lua (which sometimes gives different coloring results, so a pico-8 only system should be preferable)

@TheRoboZ pico8-ls specifically supports files named with the .lua extension and should still provide full support for them. It's intended that your .p8 files are actual cart files, and .lua files are the #included ones. Can you give an example of how the coloring results are different in a .lua file?

TheRoboZ commented 1 year ago

I tried it again and it works now! I had an update to both vs code and your extension since last time, maybe this helped. Going to close this. Thanks

japhib commented 1 year ago

Glad to hear it!