-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support syntax highlighting in _ren.py files
Add injection grammar for renpy comments in _ren.py files For now this will only work in doc strings, python syntax highlighting isn't changed
- Loading branch information
Showing
3 changed files
with
57 additions
and
2 deletions.
There are no files selected for viewing
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,17 @@ | ||
# This is not included in the game. It's here so that an editor knows | ||
# the type of strength. | ||
strength = 100 | ||
|
||
"""renpy | ||
init python: | ||
""" | ||
|
||
class BoostStrength(Action): | ||
""" | ||
Boosts the strength of the player by 10. | ||
""" | ||
|
||
def __call__(self): | ||
global strength | ||
strength += 10 | ||
renpy.restart_interaction() |
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,26 @@ | ||
{ | ||
"scopeName": "renpy.comment.injection", | ||
"injectionSelector": "L:string.quoted.docstring", | ||
"patterns": [ | ||
{ | ||
"include": "#renpy-source" | ||
} | ||
], | ||
"repository": { | ||
"renpy-source": { | ||
"contentName": "meta.embedded.renpy", | ||
"begin": "(?<=^\\\"\\\"\\\")renpy", | ||
"beginCaptures": { | ||
"0": { | ||
"name": "keyword.renpy" | ||
} | ||
}, | ||
"end": "(?=^\\\"\\\"\\\")", | ||
"patterns": [ | ||
{ | ||
"include": "source.renpy" | ||
} | ||
] | ||
} | ||
} | ||
} |