[REL] SublimePapyrus - Major update

Post » Sat Mar 05, 2016 4:49 pm

https://github.com/Kapiainen/SublimePapyrus

https://github.com/Kapiainen/SublimePapyrus/releases


The day has finally arrived and I can now release the rewritten SublimePapyrus. One part of this project was started about a year or so ago, but the majority of the work has taken place during the last two months or so.


Here's a quick description of the project for those who are not familiar with it (everyone else can jump to the next paragraph). SublimePapyrus is a package for a text editor called Sublime Text. This package includes things such as syntax highlighting for the Papyrus language, build systems for compiling script from Sublime Text, and various commands that make scripting a bit easier (less memorization of e.g. valid keys that are required when using certain functions).


What's new? The build system has been rewritten to be modular in anticipation of the release of Fallout 4's Creation Kit. The INI file has been replaced with a .sublime-settings file since it is easier to work with in the plugin. The syntax highlighting for Skyrim has also been rewritten and is also available in YAML-format to make it easier to read and modify. However, most notably three new major features have been added: a linter, a completion generation command, and an intelligent code completion system.


The linter, for those who are not familiar with the term, verifies the validity of source code. If you e.g. try to declare a variable outside of a function/event and initialize it by assigning it the value returned by a function call, then that will prompt an error and highlight the line in question. The linter is not perfect, but it should catch most mistakes. If you find any discrepancies between what the linter and the official compiler think is valid source code, then please let me know.


The completion generation command replaces the executable that was previously used for this purpose. As a result anybody can quickly and easily generate completions from within Sublime Text. However, I suspect most people won't need this command and will instead use the next feature that is described below.


The biggest new feature is the intelligent code completion system. It requires that the linter is enabled as it uses the linter to figure out the context of the line that is being edited. The system can figure out what to suggest and provide information about the things that it suggests. Let's say you type 'game.' inside of a function. The system would have suggested 'game' and told you that it is a script since a file with that name exists in one or more of the import folders that have been defined in the package's settings. If auto-completion is triggered by typing something after the dot or by pressing CTRL+SPACE, then the system will suggest functions from the 'Game' script and tell you the return type of each of those functions. The system can also determine if a completion should insert e.g. a function call or a function definition depending on the context. Variables, parameters, properties, functions, and events that are in the scope can also be suggested and described.


I would recommend using the latest version of Sublime Text 3. Sublime Text 2 is supported, but certain technical limitations mean that e.g. the linter cannot show error messages if triggered by editing a script.


From now on version numbers will be used as well. I had not thought to do so at the inception of SublimePapyrus and I never felt that I could find a good justification for suddenly starting to use version numbers later on. However, this rewrite provided in my eyes a good justification and opportunity to finally introduce version numbers to the releases as new releases should not be necessary whenever a third party resource is updated.
User avatar
Ridhwan Hemsome
 
Posts: 3501
Joined: Sun May 06, 2007 2:13 pm

Return to V - Skyrim