-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
84 additions
and
0 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
...src/main/kotlin/com/jetbrains/rider/plugins/godot/textMate/GdScriptTemplateContextType.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.jetbrains.rider.plugins.godot.textMate | ||
|
||
import com.intellij.codeInsight.template.TemplateActionContext | ||
import com.intellij.codeInsight.template.TemplateContextType | ||
|
||
class GdScriptTemplateContextType : TemplateContextType("GdScript") { | ||
|
||
override fun isInContext(context: TemplateActionContext): Boolean = | ||
context.editor?.virtualFile?.extension.equals("gd", true); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
<templateSet group="GDScript"> | ||
|
||
<template name="for loop" value="for $VAR$ in $ITERABLE$: 	$END$" description="for loop" toReformat="false"> | ||
<variable name="ITERABLE" expression="" alwaysStopAt="true" /> | ||
<variable name="VAR" expression="" alwaysStopAt="true" /> | ||
<context> | ||
<option name="GDSCRIPT" value="true" /> | ||
</context> | ||
</template> | ||
<template name="for range loop" value="for $VAR$ in range($RANGE_START$, $RANGE_END$): 	$END$" | ||
description="for range loop" toReformat="false"> | ||
<variable name="RANGE_START" alwaysStopAt="true" /> | ||
<variable name="RANGE_END" alwaysStopAt="true" /> | ||
<variable name="VAR" alwaysStopAt="true" /> | ||
<context> | ||
<option name="GDSCRIPT" value="true" /> | ||
</context> | ||
</template> | ||
<template name="while" value="while $CONDITION$: 	$END$" description="while"> | ||
<variable name="CONDITION" expression="condition()" defaultValue="expr" alwaysStopAt="true" /> | ||
</template> | ||
<template name="if" value="if $CONDITION$: 	$END$" description="if" toReformat="false"> | ||
<variable name="CONDITION" expression="" defaultValue="expr" alwaysStopAt="true" /> | ||
<context> | ||
<option name="GDSCRIPT" value="true"/> | ||
</context> | ||
</template> | ||
|
||
<!-- <template name="Inner class" value="class $1 extends ${2:Reference} 	$3" description="Inner class"/>--> | ||
<!-- <template name="Print messages to console" value="print($1)" description="Print messages to console"/>--> | ||
<!-- <template name="_ready method of Node" value="func _ready(): 	${1:pass}" description="_ready method of Node"/>--> | ||
<!-- <template name="_init method of Object" value="func _init(): 	${1:pass}" description="_init method of Object"/>--> | ||
<!-- <template name="_process method of Node" value="func _process(delta): 	${1:pass}"--> | ||
<!-- description="_process method of Node"/>--> | ||
<!-- <template name="_physics_process method of Node" value="func _physics_process(delta): 	${1:pass}"--> | ||
<!-- description="_physics_process method of Node"/>--> | ||
<!-- <template name="_input method of Node" value="func _input(event): 	${1:pass}"--> | ||
<!-- description="_input method of Node"/>--> | ||
<!-- <template name="_input_event method of Node" value="func _input_event(event): 	${1:pass}"--> | ||
<!-- description="_input_event method of Node"/>--> | ||
<!-- <template name="_unhandled_input method of Node" value="func _unhandled_input(event): 	${1:pass}"--> | ||
<!-- description="_unhandled_input method of Node"/>--> | ||
<!-- <template name="_draw method of Node" value="func _draw(): 	${1:pass}" description="_draw method of Node"/>--> | ||
<!-- <template name="_gui_input method of Node" value="func _gui_input(event): 	${1:pass}"--> | ||
<!-- description="_gui_input method of Node"/>--> | ||
<!-- <template name="if elif else"--> | ||
<!-- value="if ${1:condition}: 	${3:pass} elif ${2:condition}: 	${4:pass} else: 	${5:pass}"--> | ||
<!-- description="if elif else"/>--> | ||
<!-- <template name="if else" value="if ${1:condition}: 	${2:pass} else: 	${3:pass}"--> | ||
<!-- description="if else"/>--> | ||
<!-- <template name="if" value="if ${1:condition}: 	${2:pass}" description="if"/>--> | ||
<!-- <template name="function define" value="func ${1:method}(${2:args}): 	${3:pass}"--> | ||
<!-- description="function define"/>--> | ||
<!-- <template name="match"--> | ||
<!-- value="match ${1:expression}: 	${2:pattern}: 		${3} \t_:\n\t\t${0:default}"--> | ||
<!-- description="match"/>--> | ||
<!-- <template name="signal declaration" value="signal ${1:signalname}(${2:args})" description="signal declaration"/>--> | ||
<!-- <template name="export variables"--> | ||
<!-- value="export(${1:type}${2:,other_configs}) var ${3:name}${4: = default}${5: setget }"--> | ||
<!-- description="export variables"/>--> | ||
<!-- <template name="define variables" value="var ${1:name}${2: = default}${3: setget }" description="define variables"/>--> | ||
<!-- <template name="define onready variables" value="onready var ${1:name} = get_node($2)"--> | ||
<!-- description="define onready variables"/>--> | ||
<!-- <template name="Is instance of a class or script" value="${1:instance} is ${2:class}"--> | ||
<!-- description="Is instance of a class or script"/>--> | ||
<!-- <template name="element in array" value="${1:element} in ${$2:array}" description="element in array"/>--> | ||
<!-- <template name="GDScript template"--> | ||
<!-- value="extends ${1:BaseClass} # class member variables go here, for example: # var a = 2 # var b = "textvar" func _ready(): 	# Called every time the node is added to the scene. 	# Initialization here 	pass "--> | ||
<!-- description="GDScript template"/>--> | ||
<!-- <template name="pass statement" value="pass" description="pass statement"/>--> | ||
</templateSet> |