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

{project} Placeholder not implemented for custom external dotnet editor #81845

Closed
crazyStewie opened this issue Sep 18, 2023 · 0 comments · Fixed by #81847
Closed

{project} Placeholder not implemented for custom external dotnet editor #81845

crazyStewie opened this issue Sep 18, 2023 · 0 comments · Fixed by #81847

Comments

@crazyStewie
Copy link
Contributor

Godot version

4.1.1 (Still present on 4df80b0 )

System information

Manjaro Linux, gtx 1060

Issue description

When specifying an external code editor, one has the option to do so by specifying an executable path, and the arguments to be passed to the given executable.

Those arguments can contain certain placeholders (described on https://github.com/godotengine/godot-docs/blob/8a08321d93219228107efac3a8a19594d1ca06ab/tutorials/editor/external_editor.rst?plain=1#L24 ), which get replaced by specific information from the engine when the external editor is launched.

While these arguments seem to work fine when specifying an external text editor via Editor > Editor Settings > Text Editor > External, as is described in the documentation above , only the {file}, {line} and {col} placeholders are implemented for external c# editor, configured under Editor > Editor Settings > Dotnet > Editor (which seems to be undocumented), while the {project} placeholder is left as is. In fact, one can see that, while it is implemented for the external text editor at

// do path replacement here, else there will be issues with spaces and quotes
arg = arg.replacen("{project}", project_path);
arg = arg.replacen("{file}", script_path);
args.push_back(arg);
, It's missing on the dotnet external editor implementation at
arg = arg.ReplaceN("{file}", file);
args.Add(arg);

Steps to reproduce

  • Make a new godot project with c#
  • Go to Editor > Editor Settings > Dotnet > Editor and specify External Editor as custom, and pass in the path to some external editor, like Visual Studio Code
  • In Custom Exec Path Args, put in some argument string containing {project} (For vscode, the docs give as an example
    {project} --goto {file}:{line}:{col}
  • Open some c# script

Once vscode opens, one will see that, instead of opening the project folder, as one might expect, vscode opens a file with a new file called {project}, since the placeholder was passed directly as an argument, and not replaced with the project path

Minimal reproduction project

N/a (This bug is about an editor setting, which isn't stored as part of a project, so a minimum reproduction project isn't possible)

@akien-mga akien-mga added this to the 4.2 milestone Sep 20, 2023
mandryskowski pushed a commit to mandryskowski/godot that referenced this issue Oct 11, 2023
Implements the {project} placeholder, available when setting an external editor
in the project settings, via Editor > Editor Settings > Text Editor > External
for the c# external editor, under Editor > Editor Settings > Dotnet > Editor,

This allows passing the project folder as a command line argument when using a
custom external editor that isn't one of the available options.

Fixes godotengine#81845
YuriSizov pushed a commit to YuriSizov/godot that referenced this issue Jan 23, 2024
Implements the {project} placeholder, available when setting an external editor
in the project settings, via Editor > Editor Settings > Text Editor > External
for the c# external editor, under Editor > Editor Settings > Dotnet > Editor,

This allows passing the project folder as a command line argument when using a
custom external editor that isn't one of the available options.

Fixes godotengine#81845

(cherry picked from commit c01a478)
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