New VS Code extension to integrate with Castle Game Engine perfectly — build, run, debug CGE projects, use Pascal with code completion and highlighting

Posted on

VS Code code completion
VS Code symbols in workspace
VS Code symbols in file

We are proud to announce new Castle Game Engine VS Code extension! We have put a lot of work into it in recent months, to make sure VS Code users can very comfortably work on Castle Game Engine projects.

You can build, run, debug CGE projects, you have Pascal syntax highlighting and code completion. We’ve made all the features with the mindset the defaults should work out-of-the-box (as much as possible) for people who just download CGE, but can be tweaked for custom needs. You literally need to set only 1 value in the extension settings — “Engine Path” — to enjoy the full functionality.

The extension page in the marketplace already lists all the features, and our VS Code documentation has been updated with all the necessary details. Moreover, Andrzej Kilijański (who is also the lead developer of this feature) has prepared a demonstration video showing the extension installation and usage:

Please try out the extension, report any issues, and rate us in VS Code marketplace!

If you have already followed our recommended VS Code configuration in the past, you will notice these improvements:

  • As mentioned above, more things “just work out-of-the-box”. The process to configure is easier. Including e.g. support for bundled FPC (with CGE).

  • You can use Ctrl + T to jump to workspace symbols. Use “Engine Developer Mode” to even jump to engine routines too!

  • You can use Ctrl + Shift + O to jump to symbols in the current file.

  • We fixed the LSP pasls to make creating new empty Pascal file in VS Code work OK, i.e. code completion will “kick in” as it should.

  • We fixed the LSP pasls to not show a lot of messages when we search for identifiers by holding Ctrl. In such case, it is normal that most identifiers don’t exist — as you can easily hover over comments, keywords etc.

  • You can uninstall the VS Code extension we recommended in the past, “Pascal Language Server” VS Code extension from Ryan Joseph now, if you use new CGE extension. If you’ll keep both extensions installed, you will get duplicate completions (from both extensions), duplicate entries in Ctrl + T etc.

Have fun and if you like this please support us on Patreon!

Start the discussion at Castle Game Engine Forum