Divinity Engine Script Support for VS CodeThis extensions enables language features for the scripting language Osiris found in The Divinity Engine 2 based games. New: You can now use LSLib Compiler and Debugger with this extension. This allows you to compile story scripts directly from VS Code and use the debugger of VS Code with story scripts. More info available here: https://gist.github.com/Norbyte/8b7eb35cd17f799ea113636b15e1f967 Getting startedInstallation
Open project
FeaturesStory outlineThe story outline brings you the familiar tree view from the native editor to VS Code. You can add, delete, move and rename goals using it. Code analysisThe extension analyzes your code while you type and immediately shows you errors and problems. CompletionCode completion shows you matching symbols for your current input, it will show up automatically when typing or by pressing Shift+Space. The suggestions are context sensitive and only show you the symbols that are currently available. Find all references and go to definitionBring up a list of all usages of a procedure, query or database by pressing Shift+F12 or selecting the command Document structureUse the outline panel to get a broad overview over your current goal or jump to individial rules using the the shortcut Ctrl+Shift+O. Hover and signature helpQuickly gain information about the symbols on screen, move your mouse over them and the extension will show you a short info. The signature help shows up everytime you start writing a function call (when pressing RenameYou can rename custom procedures, databases and queries as well as variables and GUID references. Press F2 while the cursor is above the symbol you want to rename or use the rename command from the context menu. API ExplorerBuilt in browser for the complete API with contents fetched from the Divinity Wiki when available. Open the command palette (e.g. press Ctrl+Shift+P) and search for the command Custom documentation supportThe code completion, hovers and the signature help will show you short snippet from the Wiki to assist you. You can add documentation to your own procedures and queries by placing a JSDoc comment above them. Osiris log file highlightingThe extensions includes a special syntax highlighting for Osiris log files. Compiler and debuggerThis extension offers additional features when used together with LSLib Compiler and Debugger. You can install LSLib using the built-in installer. Open the command palette using Ctrl+Shift+P and search for the command CompileYou can compile your story by pressing Ctrl+Shift+B and select one of the compile tasks. DebugYou can setup the debugger like any other debugger in VS Code by creating a launch configuartion, press F5 to create the default launch configuartion. After that you can start the debugger from the debugger panel or by pressing F5 again. The debugger needs modifications to your game or editor directory, follow this guide for a detailed description: https://gist.github.com/Norbyte/8b7eb35cd17f799ea113636b15e1f967 Differences to the built in editorUnlike the built in editor VS Code will not display three different regions when editing story goals. Instead you'll see the complete source file of each goal. The basic file structure looks like this:
You can safely ignore the header section, it will be the same for all your goals. The three main sections are self explonary and are the equvalent of the three panels you see in the built in editor. Beneath the exit section you'll notice the command Known issues
FeedbackAll feedback is welcome. Please head over to the GitHub page of this project and start a new issue if you find any problems: LicenseThis extension is released under the MIT License. |