-
Notifications
You must be signed in to change notification settings - Fork 18
Language Definition
The Papyrus language definition includes syntax highlighting, bracket matching, and snippet insertions.
Syntax highlighting will colorize source code symbols such as types, operators, literals, functions, events, comments, and other Papyrus language constructs.
The Papyrus syntax highlighting supports VS Code Color Themes. A color theme lets you modify the colors in Visual Studio Code's user interface to suit your preferences and work environment.
With bracket matching, bracket pairs will be highlighted as soon as the cursor is near one of them. The bracket completion will automatically insert closing symbols for appropriate language constructs.
Tip: You can jump to the matching bracket with
Ctrl+Shift+\
The extension will suggest a variety of snippets for common boiler-plate and Papyrus language keywords. This greatly increases a developers speed and productivity. To get started with snippets simply start typing its name.
The following snippets are provided.
Inserts a script header line.
-
scriptname
: The file name of this script. -
ScriptObject
: The extending script.
Scriptname <scriptname> extends <ScriptObject>
{The documentation string.}
; code
Inserts a script header line with Namespace. Only supported by Fallout 4.
-
namespace
: The Namespace to use. -
scriptname
: The file name of this script. -
ScriptObject
: The extending script.
Scriptname <namespace>:<scriptname> extends <ScriptObject>
{The documentation string.}
; code
Inserts an import statement.
-
scriptname
: The script or namespace to import.
import <scriptname>
Inserts a comment region into the script. This might be used to separate regions of code.
-
Region
: The region label to use.
; <Region>
;---------------------------------------------
Inserts a function into the script.
Function Foo()
; code
EndFunction
Inserts a getter function into the script.
var Function GetFoo()
var value = "type"
; code
return value
EndFunction
Inserts a setter function into the script.
Function SetFoo(var argument)
; code
EndFunction
Inserts a full function into the script.
var Function Foobar(var argument)
; code
return none
EndFunction
Inserts an if statement into the script.
If ()
EndIf
Inserts a while statement into the script.
While ()
EndWhile
Inserts a "for loop" into the script.
int index = 0
While (index < size)
; code
index += 1
EndWhile
Inserts a "for each in loop" into the script.
int index = 0
While (index < array.Length)
type item = array[index]
type
index += 1
EndWhile
Inserts a state into the script.
State state
EndState
Inserts an auto state into the script.
Auto State state
EndState
Inserts a structure into the script. Structures are only supported in Fallout 4.
Struct StructureName
type Value
EndStruct
Inserts an auto property into the script.
The Mandatory
is only supported in Fallout 4.
type Property PropertyName Auto Const Mandatory
Inserts a full property into the script.
type PropertyName_var
type Property PropertyName Hidden
type Function Get()
return PropertyName_var
EndFunction
Function Set(type value)
PropertyName_var = aValue
EndFunction
EndProperty
Inserts a group into the script. Groups are only supported in Fallout 4.
Group GroupName
EndGroup
Inserts a collapsed group into the script. Groups are only supported in Fallout 4.
Group GroupName Collapsed
EndGroup
![](media/icon-small.png)
Extension
Features
- Language Definition
- IntelliSense
- Code Navigation
- Refactoring
- Compilation
-
Debugging
- Debug View
- [Debug Console](Debug Console)
- [Assembly View](Assembly View)
Creation Engine
Language
Help