Skip to content

Commit d39c224

Browse files
authored
Merge pull request #21 from rdurfee/master
* Extension Settings - allows you to enable/disable certain new functionality * Hover - Hovering over a keyword will display the selected item's source file/location as well as documentation if available * Definition - Adds support for right-click Go To Definition (F12), which will jump to the selected keyword's source * Document Symbols - Document Symbols are displayed in the Outline window in the sidebar * Signature Help - Shows the documentation pop-up as you enter a function's arguments * Completion - Displays a pop-up auto-complete menu with appropriate choices as you type your script * Document Color - Displays a color block next to detected colors in your script and allows you to pick new colors with a click * Reference - Adds support for Go To Reference, which searches your documents for the selected keyword * Folding - Adds folding support to collapse logical sections of your script in the editor * Semantic Tokens - Detects parameters and variables in screens and functions and colorizes them correctly * Diagnostics - Adds support for the detection of issues with an indentation or invalid filenames/variable names and marks them as errors or warnings in the editor * Updated README.md to provide more information about the new features.
2 parents febc2c1 + f3b6bb7 commit d39c224

33 files changed

+6292
-17
lines changed

.vscode/settings.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
// Place your settings in this file to overwrite default and user settings.
22
{
33
"files.exclude": {
4-
"out": false // set this to true to hide the "out" folder with the compiled JS files
4+
"**/*.rpyc": true
55
},
66
"search.exclude": {
77
"out": true // set this to false to include "out" folder in search results
8-
}
8+
},
9+
"cmake.configureOnOpen": true
910
}

.vscodeignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
.vscode/**
22
.vscode-test/**
3+
node_modules
34
out/test/**
45
out/**/*.map
5-
src/**
6+
**/*.ts
67
.gitignore
78
tsconfig.json
89
vsc-extension-quickstart.md
910
tslint.json
11+
!renpy.json
12+
!renpyauto.json

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
# Changelog
22

3+
## 2.0.0 (2021/09/01)
4+
5+
### Features
6+
7+
* Extension Settings - Allows you to enable/disable certain new functionality
8+
* Hover - Hovering over a keyword will display the selected item's source file/location as well as documentation if available
9+
* Definition - Adds support for right-click Go To Definition (F12), which will jump to the selected keyword's source
10+
* Document Symbols - Document Symbols are displayed in the Outline window in the sidebar
11+
* Signature Help - Shows the documentation pop-up as you enter a function's arguments
12+
* Completion - Displays a pop-up auto-complete menu with appropriate choices as you type your script
13+
* Document Color - Displays a color block next to detected colors in your script and allows you to pick new colors with a click
14+
* Reference - Adds support for Go To Reference, which searches your documents for the selected keyword
15+
* Folding - Adds folding support to collapse logical sections of your script in the editor
16+
* Semantic Tokens - Detects parameters and variables in screens and functions and colorizes them correctly
17+
* Diagnostics - Adds support for detection of issues with indentation or invalid filenames/variable names and marks them as errors or warnings in the editor
18+
319
## 1.1.0 (2021/08/13)
420

521
### Features

README.md

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
# Ren'Py Languague for Visual Studio Code
2+
# Ren'Py Language for Visual Studio Code
33

44
Adds syntax highlight and snippets for [Ren'Py](https://www.renpy.org/) to [Visual Studio Code](https://code.visualstudio.com/)
55

@@ -16,7 +16,7 @@ Feel free to [contribute](https://github.com/LuqueDaniel/vscode-language-renpy/b
1616

1717
## Features
1818

19-
### Syntax Highlight
19+
### Syntax Highlighting
2020

2121
![syntax](https://user-images.githubusercontent.com/1286535/40073232-9509274a-5876-11e8-98ff-e14b46bfab8a.gif)
2222

@@ -26,6 +26,43 @@ Feel free to [contribute](https://github.com/LuqueDaniel/vscode-language-renpy/b
2626

2727
![snippets](https://user-images.githubusercontent.com/1286535/40073650-b999c5dc-5877-11e8-8910-596f9e94b281.gif)
2828

29+
### Completion
30+
31+
![completion](https://user-images.githubusercontent.com/12246002/137429951-63043065-57c7-4fb2-8bc3-27f69616f439.gif)
32+
33+
> Displays a pop-up auto-complete menu with context-appropriate choices as you type your script or enter screen properties.
34+
35+
### Document Color
36+
37+
![colors](https://user-images.githubusercontent.com/12246002/137429939-a813bc82-e067-4306-9d4b-9d3fa064b1b6.gif)
38+
39+
> Displays a color block next to detected colors in your script and allows you to pick new colors with a click.
40+
41+
### Hover
42+
43+
![hover](https://user-images.githubusercontent.com/12246002/137430452-3ae9e16a-6bd9-474b-837c-f19040a92766.gif)
44+
45+
> Hovering over a Ren'Py or user-defined keyword will display the selected item's source file/location as well as documentation if available. Clicking the filename location will jump to that document and position.
46+
47+
### Go To Definition
48+
49+
> Adds support for right-click Go To Definition (F12), which will jump to the selected keyword's source.
50+
51+
### Signature Help
52+
53+
> Shows the documentation pop-up as you enter a function's arguments.
54+
55+
### Diagnostics
56+
57+
![diagnostics](https://user-images.githubusercontent.com/12246002/137431018-978530fd-4af4-4d10-b72a-fe852a5ddffd.gif)
58+
59+
> Adds support for detection of issues with indentation or invalid filenames/variable names and marks them as errors or warnings in the editor.
60+
61+
### Document Symbols
62+
63+
> Document Symbols are displayed in the Outline window in the sidebar.
64+
65+
2966
## Thanks To
3067

3168
* [language-renpy](https://github.com/renpy/language-renpy). All contributors

Visual Studio Code.edit.py

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
import os
2+
import subprocess
3+
import sys
4+
5+
import renpy.editor
6+
7+
class Editor(renpy.editor.Editor):
8+
9+
has_projects = True
10+
11+
def get_code(self):
12+
"""
13+
Returns the path to the code executable, if None.
14+
"""
15+
16+
DIR = os.path.abspath(os.path.dirname(__file__))
17+
18+
if renpy.windows:
19+
code = "Code.exe"
20+
elif renpy.macintosh:
21+
DIR = os.path.abspath("/Applications")
22+
code = os.path.join(DIR, "Visual Studio Code.app", "Contents", "Resources", "app", "bin", "code")
23+
else:
24+
code = "code"
25+
26+
return code
27+
28+
def open(self, filename, line=None, **kwargs):
29+
if line:
30+
filename = "{}:{}".format(filename, line)
31+
self.args.append(filename)
32+
33+
def open_project(self, project):
34+
if renpy.windows:
35+
project = '"{}"'.format(project)
36+
elif renpy.macintosh:
37+
project = project.replace(' ', '\ ')
38+
self.args.append(project)
39+
40+
def begin(self, new_window=False, **kwargs):
41+
self.args = [ ]
42+
43+
def end(self, **kwargs):
44+
self.args.reverse()
45+
46+
if renpy.macintosh:
47+
code = self.get_code()
48+
args = [ code ] + self.args
49+
args = [ renpy.exports.fsencode(i) for i in args ]
50+
subprocess.Popen(args)
51+
else:
52+
args = self.args
53+
args = [ renpy.exports.fsencode(i) for i in args ]
54+
subprocess.call(["code", "-g", args], shell=True)
55+
56+
def main():
57+
e = Editor()
58+
e.begin()
59+
60+
for i in sys.argv[1:]:
61+
e.open(i)
62+
63+
e.end()
64+
65+
if __name__ == "__main__":
66+
main()

examples/.vscode/settings.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"files.exclude": {
3+
"**/*.rpyc": true
4+
}
5+
}

0 commit comments

Comments
 (0)