Skip to content

Commit a98c420

Browse files
authored
Version 2.7.0 (#38)
- **Skyrim** - Added completions for End* keywords (e.g. EndWhile). - Fixed a bug that caused the linter to crash.
1 parent b87e7c5 commit a98c420

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

README.md

+6
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,12 @@ Single file build system and a batch build variant.
228228
- SKSE mod event names
229229

230230
## **Changelog**
231+
**Version 2.7.0 - 2017/01/27:**
232+
233+
- **Skyrim**
234+
- Added completions for End* keywords (e.g. EndWhile).
235+
- Fixed a bug that caused the linter to crash.
236+
231237
**Version 2.6.10 - 2017/01/12:**
232238

233239
- **Skyrim**

Source/Modules/Skyrim/Plugin.py

+9
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ def __init__(self):
143143
self.completionKeywordFalse = ("false\tkeyword", "False",)
144144
self.completionKeywordNone = ("none\tkeyword", "None",)
145145
self.completionKeywordTrue = ("true\tkeyword", "True",)
146+
self.scriptContents = None
146147

147148
# Clear cache in order to force an update
148149
def on_close(self, view):
@@ -396,6 +397,8 @@ def Exit():
396397
scriptContents = view.substr(sublime.Region(0, view.size()))
397398
else:
398399
scriptContents = self.scriptContents
400+
if not scriptContents:
401+
return Exit()
399402
lineCount = scriptContents.count("\n") + 1
400403
statements = []
401404
lines = []
@@ -549,11 +552,15 @@ def Completions(self, view, prefix, locations):
549552
completions.append(SublimePapyrus.MakeEventCompletion(obj, sem, False, "parent"))
550553
completions.append(("import\timport statement", "Import ${0:$SELECTION}",))
551554
completions.append(("property\tproperty def.", "${1:Type} Property ${2:PropertyName} ${3:Auto}",))
555+
completions.append(("endproperty\tkeyword", "EndProperty",))
552556
completions.append(("fullproperty\tfull property def.", "${1:Type} Property ${2:PropertyName}\n\t${1:Type} Function Get()\n\t\t${3}\n\tEndFunction\n\n\tFunction Set(${1:Type} Variable)\n\t\t${4}\n\tEndFunction\nEndProperty",))
553557
completions.append(("autostate\tauto state def.", "Auto State ${1:StateName}\n\t${0}\nEndState",))
554558
completions.append(("state\tstate def.", "State ${1:StateName}\n\t${0}\nEndState",))
559+
completions.append(("endstate\tkeyword", "EndState",))
555560
completions.append(("event\tevent def.", "Event ${1:EventName}(${2:Parameters})\n\t${0}\nEndEvent",))
561+
completions.append(("endevent\tkeyword", "EndEvent",))
556562
completions.append(("function\tfunction def.", "${1:Type} Function ${2:FunctionName}(${3:Parameters})\n\t${0}\nEndFunction",))
563+
completions.append(("endfunction\tkeyword", "EndFunction",))
557564
# Types to facilitate variable declarations
558565
completions.extend(self.GetTypeCompletions(view, True))
559566
return completions
@@ -707,7 +714,9 @@ def Completions(self, view, prefix, locations):
707714
completions.append(("if\tif", "If ${1:$SELECTION}\n\t${0}\nEndIf",))
708715
completions.append(("elseif\telse-if", "ElseIf ${1:$SELECTION}\n\t${0}",))
709716
completions.append(("else\telse", "Else\n\t${0}",))
717+
completions.append(("endif\tkeyword", "EndIf",))
710718
completions.append(("while\twhile-loop", "While ${1:$SELECTION}\n\t${0}\nEndWhile",))
719+
completions.append(("endwhile\tkeyword", "EndWhile",))
711720
completions.append(("for\tpseudo for-loop", "Int ${1:iCount} = 0\nWhile ${1:iCount} < ${2:maxSize}\n\t${0}\n\t${1:iCount} += 1\nEndWhile",))
712721
if e.signature.data.type:
713722
completions.append(("return\tstat.", "Return ",))

0 commit comments

Comments
 (0)