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

Dragging nodes to a C# file in editor handles it as GDScript #91295

Open
aki-art opened this issue Apr 29, 2024 · 1 comment · May be fixed by #91297
Open

Dragging nodes to a C# file in editor handles it as GDScript #91295

aki-art opened this issue Apr 29, 2024 · 1 comment · May be fixed by #91297

Comments

@aki-art
Copy link

aki-art commented Apr 29, 2024

Tested versions

v4.2.2 Stable Mono [15073af]

System information

Windows 10 - Godot v4.2.2.stable.mono.official

Issue description

Dragging and dropping a node to the script editor window ignores the currently opened file's language, and inserts a GDScript snippet into the .cs file. Either $ExampleNode, or @onready var example_node = $ExampleNode if done while holding Ctrl.

This is of course invalid code for C#.

Expected behavior: Either insert C# code or just do nothing if the active file's extension does not match .gd

gdscriptursilly

Steps to reproduce

  1. Create and attach a C# script to a node.
  2. Drag and drop any node to the script window, to quick insert a reference to it.

Minimal reproduction project (MRP)

N/A

@theraot
Copy link
Contributor

theraot commented May 15, 2024

Last time I was looking at this code I was becoming convinced it needed some redesign. I think it could use some kind of language provider that would be used to generate code for different langauges. But that was beyond the scope of what I was doing (I fixed generating a typed expression, and was working on dragging and dropping a property from the inspector).

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.

3 participants