-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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 external editor presets #42736
base: master
Are you sure you want to change the base?
Add external editor presets #42736
Conversation
ba07fa0
to
d8c0341
Compare
?
|
@capnm Since VS Codium and VS Code use the same command-line arguments, I think it would be better to let the user override Exec Path themselves if they use VS Codium. |
Admittedly I wasn't sure where to draw the line, so I simply took the editors already mentioned in the documentation as the base group. I'd love to hear what others think we should include. I also agree that in case of VS Codium, which is practically a fork of VS Code, simply entering Other editors that I considered, but wasn't sure about adding:
The C# ones are going to be mostly useless in non-Mono builds, but I felt like changing the options based on whether mono is enabled for an editor setting might be weird. Either the numerical values wouldn't match between the builds or the alphabetical order would be broken. Suggestions welcome. Notepad++ can only really be ran on Windows (at least without wine). dte and nano might be too simple, but different people use different tools. |
The current selection of the text editor is a bit strange, it should also update the corresponding fields/labels (defaults) in the settings. |
@capnm I initially explored the idea of updating the |
Yeah, that's weird too ;) Is it somehow possible to change all the values and then do an update? |
|
@capnm Right, so the delay seems to be deliberately caused by the Editor Settings Dialog with a 1.5s timer started when the settings change (source). I presume the delay is there to prevent the editor from updating the UI several times in case multiple settings are changed one after another. Changing the timer delay to 0.1s feels more responsive but still visibly laggy, with the delay seemingly fluctuating. Another problem is that if the user changes Other options:
Overall I feel like the @Hazarel As for the order: the settings are already declared in the appropriate order, but since I had an older config version that didn't include the |
This is a good feature, but I'm concerned about this not working out of the box on Windows and macOS. On those operating systems, most editors/IDEs are not added to the |
Users are welcome to change the path to the editor's executable while still getting the benefits of Godot filling in the Exec Flags field for them. This means it's no longer necessary to look them up in Godot's or the editor's documentation. |
I'm still worried about users expecting the default paths to work out of the box and reporting issues here 🙂 |
I already submitted a companion PR that updates the docs to explain how the settings work in an attempt to combat this. I'd also argue that right now, by forcing users to do this manually, we are making the experience worse and creating an opportunity for them to make mistakes. For users like me, who previously used the function, they likely had to look up what the value for Exec Flags should be every time they're setting up Godot (whether it be after an update or during engine development). For new users, this makes it easier to miss that Godot allows opening not only the file, but also the project directory and a specific line + column. I agree that some of it could be more intuitive, but as I explained above with the way the settings dialog works right now it's difficult to make it so. In the end, I believe that this should allow wasting less time on setup until a better solution comes along. |
Sorry for the late review. The feature makes sense, one thing we're not too sure of is:
It should probably be refactored so that it's string based, so that we can order them alphabetically (no favoritism) and add new entries without breaking compat. |
d8c0341
to
e51974f
Compare
Had another go at implementing this the way I felt it should work, and this time I managed to find some code I could hook into which allowed me to do exactly what I wanted: (Switching to Kate appears to fail in this recording because of #20708) |
e51974f
to
95705fe
Compare
Resolved the merge conflict, and fixed a setting definition going missing at some point. |
Can this and the linked issue be merged? |
The I think we should fix this by changing the default executable path depending on the current OS to match the default used by each editor. This will require some research (such as manually installing each editor to find its default executable path). I know this is quite a lot of work, but it's important that presets truly work as intended on any platform. |
I imagine that assumption will very quickly break down. What if the user installed the editor on D: instead of C:? How far should we go in an attempt to find these existing paths? The flip side is that if we just assume everyone installs the editor in its default location, it will appear as though the editor path is already configured and doesn't require any attention, even if it's wrong. If we start calling various APIs to figure out the actual location, that's potentially a whole lot of extra code to maintain just to determine where the program might be. Additionally, I don't even have Windows nor Mac available to me, so I'm literally unable to implement this myself without going extremely out of my way to gather even the most basic defaults. Ultimately, this PR has been stuck in limbo for over two years at this point, and while I understand the maintainers are busy, I'd like to see some resolution. I wasn't even aware these defaults were blockers for you as you never expressed that beyond describing it as a worry. Personally, I think something is far better than nothing, as I find |
One alternative that sidesteps the issue with the path would be to make the presets only set the flags, but not the path.
This is definitely worth a PR 🙂 I do see this error printed to the Output panel when the path is empty, but I think it should be turned into an AcceptDialog that will be more noticeable:
The fallback to the internal editor also doesn't work – the editor doesn't switch to the Script tab when double-clicking a script in the FileSystem dock. |
Allows filling in external editor
exec_path
andexec_flags
settings by choosing from a list of presets.Original
You can choose a preset to set
exec_path
andexec_flags
to values for the chosen editor. Optionally, if your editor is not in PATH, you can change theexec_path
to a non-empty path to override the preset, while keeping the presetexec_flags
value for the selected editor.Choosing "Custom" (default) as the preset uses the old behavior.