Hacker News new | ask | show | jobs
by turboponyy 743 days ago
Why not integrate a Lua LSP instead of reimplementing all that language support?
1 comments

Good question. But essentially because things started out small and then grew from there.

Going forward being able to have seamless integration between the scripting and rest of the editor is a key differentiator and value added. For example being able to jump to the right API documentation relevant for the function call under the caret, or being able to open and jump to the game asset from the script.

I'm not sure how well a LSP type of integration would work here. As far as I can tell it'd need to evaluate the script in order to have best possible diagnostics and analysis and that won't work without the interpreter having the native game engine code available as well.

Of course my "solution" was mostly about slapping components other people built together.

  - Qt already has a text editor component with components for doing stuff such as syntax highlight quite easily.
  - I use tree sitter to extract symbol information from the Lua code.
  - I use an open source code formatter someone else built.