Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Support for new _ren.py format used in Renpy 8 #342

Open
Tristimdorion opened this issue Jun 14, 2023 · 6 comments · Fixed by #343
Open

[Feature] Support for new _ren.py format used in Renpy 8 #342

Tristimdorion opened this issue Jun 14, 2023 · 6 comments · Fixed by #343

Comments

@Tristimdorion
Copy link

All objects defined in _ren.py files are not recognized by the code analysis, so IntelliSense and autocomplete won't work for anything defined in these files.
Could this be resolved by treating _ren.py files the same as .rpy?

@duckdoom4
Copy link
Collaborator

Thanks for the suggestion. I'll have a look at the renpy 8 documentation on this file type and see what I can do. I'm not sure if vscode will allow me to override the default python extensions for this specific file only.

In the meantime, you can simply force this file to be treated as renpy by clicking the 'file language' button in the status bar and selecting the Renpy language extension

@duckdoom4
Copy link
Collaborator

duckdoom4 commented Jun 14, 2023

So reading up on the documentation, it seems that *_ren.py files are basically python files, with some doc strings that 'inject' renpy code.

Assuming this is the case and no renpy code is allowed outside of these doc strings; I could add an injection grammar, that adds renpy syntax highlighting in docstrings that start with """renpy. This grammar would be injected into the default python extensions you use for .py files

@duckdoom4 duckdoom4 linked a pull request Jun 14, 2023 that will close this issue
@duckdoom4
Copy link
Collaborator

This will be added in the next update. I'll let you know when a new update will be released

@Tristimdorion
Copy link
Author

I'm not looking for syntax highlighting in the _ren.py file (python extension do that perfectly), what would be nice if the objects in the _ren.py files would be available in the .rpy files, giving autocomplete and intellisense in the renpy files, I'm guessing this is done in the static parser that goes over the rpy files to find classes, so adding these files to the 'parser' should add this for usage in the renpy files? Right?

@duckdoom4
Copy link
Collaborator

duckdoom4 commented Jun 14, 2023

What I added was syntax highlighting for the renpy code that is injected:
image

If you're looking for any other features you'll have to wait. (Probably quite a while)

We don't currently have a parser, not even for the renpy files. The way it's done currently, is through the navigation.json file that is produced by the renpy SDK when you compile a project.

I'm currently working on a fully fledged parser, but it will take a while before it's complete.
See #335 for more info

@Tristimdorion
Copy link
Author

Just had time to look this over, the _ren.py info is contained in the navigation.json file, it just isn't picked up by the extension.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants