-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
ScriptEditor
'goto_line' on external editor is not working
#52294
Comments
I don't think that's feasible. We have no control over another executable, and there is no guarantee that it even supports any outside interactions. Opening files is simple, as it's an operating system level operation. But you can't just tell another code editor to jump to a line. |
Can't the LSP server hosted by the Godot editor do that? However, the built-in script editor isn't active at all when the external editor is enabled. So this wouldn't work anyway unless a dedicated method was added to handle this. |
This seems to be for C#/Mono. |
Ok, I have understood the problem, Can I access the information which external editor is set? A dedicated function would be very helpfull ;) |
You can get the external editor path from the EditorSettings: var editor_interface := plugin.get_editor_interface()
var settings := editor_interface.get_editor_settings()
settings.get_setting("text_editor/external/exec_path") Settings:
If the external editor is VSCode you can open a file on the line 42 using the following command: /path/to/code -g /path/to/my/file.cs:42 See the documentation for the VSCode CLI options. However, my recommendation would be to avoid hardcoding this for each editor. In your code you are calling The next line in your code Ideally, you would use the You also don't have access to |
Thanks for this detailed anwser. |
Yes, currently You can't really check if an external editor is configured because that depends on the scripting language (some languages may or may not override the global external editor setting). I have created PR #55709 to expose an |
Thanks so much ;) |
Godot version
Godot Engine v3.3.3.stable.mono.official.b973f997f
System information
Windows 10
Issue description
I'm current extending GdUnit3 to support C# testing inside the Godot editor.
I use the
ScriptEditor
over the plugin interface to jump to a specific line.For GdScripts is works fine.
Is external editor set than it only opens the correct source but it not jumps to specified line.
Example code:
For external editor is set
I tryed to configure the external Text Editor but it has no affect.
Enable or disable makes no difference
Steps to reproduce
The external editor is open the file but ignoring the line_number
Minimal reproduction project
No response
The text was updated successfully, but these errors were encountered: