pkulchenko / ZeroBraneStudio

Lightweight Lua-based IDE for Lua with code completion, syntax highlighting, live coding, remote debugger, and code analyzer; supports Lua 5.1, 5.2, 5.3, 5.4, LuaJIT and other Lua interpreters on Windows, macOS, and Linux
http://studio.zerobrane.com/
Other
2.59k stars 518 forks source link

Yuescript #1134

Closed ShalokShalom closed 2 years ago

ShalokShalom commented 2 years ago

Yuescript is an extended and actively developed version of Moonscript

Is there any chance, to add support for it?

pkulchenko commented 2 years ago

There are three things that are generally included in "support" for a particular language/interpreter:

  1. Integration with the IDE to run,
  2. Syntax-highlighting, and
  3. Debugging.

There is moonscript plugin that implements 1 and 3. The debugging support is implemented using linemap in MobDebug, so if Yuescript is using something similar, then it should be possible to integrate it the same way.

For syntax-highlighting someone can use the moonscript lexer and extend it to cover Yuescript syntax. The lexer can then be registered with editor.specmap table to link a specific file extension to the Yuescript lexer.

It's also possible to package everything within one plugin (including the lexer) using ide:AddLexer command.

I can help with any questions/issues that may arise, but you'd need to find someone to do and test this.

ShalokShalom commented 2 years ago

Well, 1 is already implemented, I guess, it simply compiles to Lua.

2 is not so different from Moon, it supports just a handful of new features (implicit objects, pipes etc)

3 Is not so important (to me)

billboardsDAO commented 2 years ago

To syntax-highlighting Yuescript files add this line in Settings: System (Edit menu/Preferences):

ide.config.editor.specmap.yue = "moonscript"

and restart IDE

pkulchenko commented 2 years ago

@billboardsDAO, thank you for the suggestion! Also, you can drop ide.config, so editor.specmap.yue = "moonscript" should work as well.

ShalokShalom commented 2 years ago

Can we make this default?

pkulchenko commented 2 years ago

Pushed the change for it. @ShalokShalom, is that enough for you for now?

ShalokShalom commented 2 years ago

Thanks a lot

impul-so commented 2 years ago

Hi @pkulchenko Could you add the conf extension (nginx/openresty) using css syntax as default? It works well and helps :)

editor.specmap.conf = "css"
ShalokShalom commented 9 months ago

What does this change?