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

Expose ScriptEditor::edit to scripting #55709

Merged
merged 1 commit into from
Dec 8, 2021

Conversation

raulsntos
Copy link
Member

Exposes a method in EditorInterface to open scripts on a specified line and column.
This method handles if the internal or the external editor should be used.

Without this method, users can only use EditorInterface::edit_resource to open scripts but can't specify a line and/or column position.

Closes #52294.

@raulsntos raulsntos added enhancement topic:editor topic:plugin cherrypick:3.x Considered for cherry-picking into a future 3.x release labels Dec 7, 2021
@raulsntos raulsntos added this to the 4.0 milestone Dec 7, 2021
@raulsntos raulsntos requested a review from a team as a code owner December 7, 2021 22:41
<argument index="2" name="column" type="int" default="0" />
<argument index="3" name="grab_focus" type="bool" default="true" />
<description>
Edits the given [Script]. The line and column on which to open the script can also be specified.
Copy link
Member

Choose a reason for hiding this comment

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

Might be worth specifying how this works with user-configured external editor. And maybe add a backreference to it in edit_resource to edit [Script] resources?

Copy link
Member Author

@raulsntos raulsntos Dec 8, 2021

Choose a reason for hiding this comment

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

That's a good point, I've added that information. I didn't want the description of edit_resource to make it sound like they always have to use edit_script for [Script], but I hope it doesn't make users get confused about which one they should use.

Basically, if you don't need to specify the line and column position I would recommend to use edit_resource for everything since that will still use the properly configured editor and you don't have to worry about what type of resource it is. I don't want users to think they have to check the resource type before editing it if they don't care about the line and column position.

Exposes a method in `EditorInterface` to open scripts on a specified
line and column. This method handles if the internal or the external
editor should be used.
@MikeSchulze
Copy link

would be very nice to back port to 3.4 when is approved.

@akien-mga akien-mga merged commit f1e3c87 into godotengine:master Dec 8, 2021
@akien-mga
Copy link
Member

Thanks!

@raulsntos raulsntos deleted the expose_script_edit branch December 8, 2021 16:38
@akien-mga
Copy link
Member

Cherry-picked for 3.5.

@akien-mga akien-mga removed the cherrypick:3.x Considered for cherry-picking into a future 3.x release label Dec 9, 2021
@akien-mga
Copy link
Member

Cherry-picked for 3.4.1.

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

Successfully merging this pull request may close these issues.

ScriptEditor 'goto_line' on external editor is not working
3 participants