Skip to content

Commit

Permalink
Merge pull request renpy#21 from rdurfee/master
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
LuqueDaniel authored Oct 15, 2021
2 parents febc2c1 + f3b6bb7 commit d39c224
Show file tree
Hide file tree
Showing 33 changed files with 6,292 additions and 17 deletions.
5 changes: 3 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// Place your settings in this file to overwrite default and user settings.
{
"files.exclude": {
"out": false // set this to true to hide the "out" folder with the compiled JS files
"**/*.rpyc": true
},
"search.exclude": {
"out": true // set this to false to include "out" folder in search results
}
},
"cmake.configureOnOpen": true
}
5 changes: 4 additions & 1 deletion .vscodeignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
.vscode/**
.vscode-test/**
node_modules
out/test/**
out/**/*.map
src/**
**/*.ts
.gitignore
tsconfig.json
vsc-extension-quickstart.md
tslint.json
!renpy.json
!renpyauto.json
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Changelog

## 2.0.0 (2021/09/01)

### Features

* 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 detection of issues with indentation or invalid filenames/variable names and marks them as errors or warnings in the editor

## 1.1.0 (2021/08/13)

### Features
Expand Down
41 changes: 39 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

# Ren'Py Languague for Visual Studio Code
# Ren'Py Language for Visual Studio Code

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

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

## Features

### Syntax Highlight
### Syntax Highlighting

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

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

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

### Completion

![completion](https://user-images.githubusercontent.com/12246002/137429951-63043065-57c7-4fb2-8bc3-27f69616f439.gif)

> Displays a pop-up auto-complete menu with context-appropriate choices as you type your script or enter screen properties.
### Document Color

![colors](https://user-images.githubusercontent.com/12246002/137429939-a813bc82-e067-4306-9d4b-9d3fa064b1b6.gif)

> Displays a color block next to detected colors in your script and allows you to pick new colors with a click.
### Hover

![hover](https://user-images.githubusercontent.com/12246002/137430452-3ae9e16a-6bd9-474b-837c-f19040a92766.gif)

> 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.
### Go To Definition

> Adds support for right-click Go To Definition (F12), which will jump to the selected keyword's source.
### Signature Help

> Shows the documentation pop-up as you enter a function's arguments.
### Diagnostics

![diagnostics](https://user-images.githubusercontent.com/12246002/137431018-978530fd-4af4-4d10-b72a-fe852a5ddffd.gif)

> Adds support for detection of issues with indentation or invalid filenames/variable names and marks them as errors or warnings in the editor.
### Document Symbols

> Document Symbols are displayed in the Outline window in the sidebar.

## Thanks To

* [language-renpy](https://github.com/renpy/language-renpy). All contributors
Expand Down
66 changes: 66 additions & 0 deletions Visual Studio Code.edit.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import os
import subprocess
import sys

import renpy.editor

class Editor(renpy.editor.Editor):

has_projects = True

def get_code(self):
"""
Returns the path to the code executable, if None.
"""

DIR = os.path.abspath(os.path.dirname(__file__))

if renpy.windows:
code = "Code.exe"
elif renpy.macintosh:
DIR = os.path.abspath("/Applications")
code = os.path.join(DIR, "Visual Studio Code.app", "Contents", "Resources", "app", "bin", "code")
else:
code = "code"

return code

def open(self, filename, line=None, **kwargs):
if line:
filename = "{}:{}".format(filename, line)
self.args.append(filename)

def open_project(self, project):
if renpy.windows:
project = '"{}"'.format(project)
elif renpy.macintosh:
project = project.replace(' ', '\ ')
self.args.append(project)

def begin(self, new_window=False, **kwargs):
self.args = [ ]

def end(self, **kwargs):
self.args.reverse()

if renpy.macintosh:
code = self.get_code()
args = [ code ] + self.args
args = [ renpy.exports.fsencode(i) for i in args ]
subprocess.Popen(args)
else:
args = self.args
args = [ renpy.exports.fsencode(i) for i in args ]
subprocess.call(["code", "-g", args], shell=True)

def main():
e = Editor()
e.begin()

for i in sys.argv[1:]:
e.open(i)

e.end()

if __name__ == "__main__":
main()
5 changes: 5 additions & 0 deletions examples/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"files.exclude": {
"**/*.rpyc": true
}
}
Loading

0 comments on commit d39c224

Please sign in to comment.