-
Notifications
You must be signed in to change notification settings - Fork 517
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Request] Teal Support #1152
Comments
Looking at the Moonscript plugin may be a good first step. Assuming that lua modules (like Mobdebug and luasocket) can be loaded, then someone can start debugging from a Teal script to test this quickly (without any additional coding, just by following the instructions for remote debugging) and if Teal integration with Lua provides a replacement for load/loadstring and some support for source maps, then other debugging features can be supported as well (similar to how it's done for moonscript). |
Thanks for your answer. I did indeed get it to work by altering the Moonscript plugin to create a Teal interpreter. But all syntax highlighting is lost for .tl files, sadly. Is there any way to load a .tl file and still have syntax highlighting? Should I create a pull request for the teal.lua plugin? |
Yes, that should work, but it's also possible to add a more elaborate lexer for the actual teal code. You can start with lualibs/lexers/lua.lua and turn it into tl.lua lexer (and then register it from teal.lua plugin using local spec = {
exts = {"tl"},
lexer = "lexlpeg.teal", -- same lexer name as used in AddLexer
apitype = "lua",
linecomment = "--",
sep = ".:",
marksymbols = ide.spec.lua.marksymbols,
}
ide:AddSpec("teal", spec) |
Yes, you can submit it to https://github.com/pkulchenko/ZeroBranePackage repository. |
What's the syntax of ide:AddLexer(name, lexer)? Specifically, what does it expect for "lexer", a path to a file? |
(for others who may be looking at this) It's a string with the lexer code to be loaded from a plugin.
Let me take a quick look. |
@qEagleStrikerp, the function does exist for sure (it's in src/editor/autocomplete.lua file), but you're probably making AddSpec call too early, before the setup is completed. You need to call it from |
@pkulchenko This was indeed the case. Calling it within onRegister works. However, now I have another issue: ide:AddLexer() doesn't actually do anything, I get the same error message |
@pkulchenko Could you take a look at my previous Edit 4? |
Thank you for the update; good to see you're making progress! Colors are a bit problematic, as they are remapped using |
@pkulchenko Thanks for your answer! Is changing colors and changing the underlining / crossing out all related to the same problem? Because changing colors is not nearly as important for the visuals as changing the way the grammar is processed. Especially the following problem:
becomes local which really destroys the optics, unfortunately. |
This is controlled by |
@pkulchenko Thanks, works like a charm, looks really beautiful. I created a pull request for the plugin :). |
@pkulchenko I noticed there was a little feature missing, namely the ability to save both .lua and .tl files. I found a workaround, but I think the way I solved it is not the intended way (every other thing I tried messed up either the lua or the teal lexer though). Would be nice if you could take a look at it some time: |
@pkulchenko Any chance you could take a look at the aforementioned pull request? Then I could link to it from the Teal Repo. |
Bump |
Teal is still relatively new, but it looks very promising. Currently there is no IDE for it with debugging support, and seeing as ZeroBraneStudio is most people's favorite Lua IDE, it would be nice to have Teal support for it (via Plugin maybe?).
The text was updated successfully, but these errors were encountered: