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

Add Godot Resource Language #6185

Merged
merged 6 commits into from
Feb 17, 2023
Merged

Add Godot Resource Language #6185

merged 6 commits into from
Feb 17, 2023

Conversation

lildude
Copy link
Member

@lildude lildude commented Nov 24, 2022

Description

project.godot, .tres and .tscn files form part of many GoDot apps and are really popular on GitHub.

I've stuck with the same colour as used by GDScript as they're related so may as well share the same colour of: #355570

Fixes #6060

Checklist:

@lildude lildude requested a review from a team as a code owner November 24, 2022 11:16
lib/linguist/languages.yml Outdated Show resolved Hide resolved
Copy link
Contributor

@aaronfranke aaronfranke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is completely and totally wrong.

  • .tres and .tscn files are specific to Godot Engine, not to the GDScript language. Games using C# in Godot with no GDScript will still have .tres and .tscn files.

  • The syntax highlighting needed for .tres and .tscn is completely different from GDScript.

@lildude
Copy link
Member Author

lildude commented Jan 3, 2023

@aaronfranke I was kinda expecting a comment like this as I know nothing about Godot and was winging it 😁

  • .tres and .tscn files are specific to Godot Engine, not to the GDScript language. Games using C# in Godot with no GDScript will still have .tres and .tscn files.

The issue here is we can't add "Godot Engine" or similar as its own language to Linguist as it isn't a language, it's framework, hence I chose GDScript which brings me to your next point:

  • The syntax highlighting needed for .tres and .tscn is completely different from GDScript.

I was motivated to add these files to GDScript as that's what the Godot docs use for the code blocks (see the page source) and things seem to look OK.

Now I'm looking at it again, and looking at the grammar itself, would it make more sense to add a new "GDResource" data language for these extensions? That's what VSCode identifies these file as when I open them with https://github.com/godotengine/godot-vscode-plugin/ installed (which we use for the GDScript syntax highlighting).

@aaronfranke
Copy link
Contributor

@lildude Yes, these files use Godot's Resource / ConfigFile format, including project.godot, *.tres, and *.tscn.

Note that we want to avoid marking these files as code (we should use Linguist type: data).

@lildude lildude changed the title Add .tres and .tscn to GDScript Add GDResource Language Jan 9, 2023
@lildude lildude changed the title Add GDResource Language Add Godot Resource Language Jan 9, 2023
...and move tres and tscn samples to this language
Copy link
Collaborator

@Alhadis Alhadis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@lildude lildude merged commit 0b8b3d6 into master Feb 17, 2023
@lildude lildude deleted the lildude/add-tscn-tres-gdscript branch February 17, 2023 11:15
@github-linguist github-linguist locked as resolved and limited conversation to collaborators Jun 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Godot resources
3 participants