Search code examples
c++syntaxluacompletion

c++ lua support with syntax checking and function completion


I recently added lua support in one of my c++ applications. The goal is that my application is the core and the users can access functions from my core using lua. I have seen that it is possible to have syntax correction and auto completion like visual studio has. And that is exactly what I want to have, too. How to I implement this feature? The lua file can be written inside a window of my application. Can I connect my c++ function pool with this lua scripting? Any help on this would be greatly appreciated.

Fabian


Solution

  • Use Scintilla. It's crossplatform and is available as a library for different platforms and frameworks.

    As an example, here are few links:

    Sure, it is possible to use Scintilla even if you are not using any GUI editors and your application is pure code. It's just an external library, and can be either static (part of your binary after compilation) or dynamic (should be bundled with your application).