Godot: Add color status and gutters for VCS

Created on 28 Jan 2019  路  12Comments  路  Source: godotengine/godot

Case:

If the project is under Git, SVN or other VCS

Proposal:

1) Add color highlight for changed and new files in project file tree.

2) Mark gutters in code editor by color of Git diff for added/changed/deleted lines.
Be able to see a Git diff for these line.

Both are really convenient features and I'm missing them so much in Godot Editor.

How it's done in different editors:

VS Code

defold_vcs_gutter_vscode

IntelliJ IDEA

defold_vcs_gutter_idea

archived feature proposal editor

Most helpful comment

I think this is not necessarily related to Git, because in Visual Studio and QtCreator I can see the same "modification marks" in a project that does not use Git. They are very useful to quickly jump back to the place you modified files and give an overview.

image

Basically, the editor just highlights modified lines that were not saved, changes their color when they are, and keeps that information until the file is closed.

This is even more useful with full-scale overview scrollbars such as code minimaps.

Then, once we have that, Git-style (or whatever VCS) modification marks could be done as a plugin once we better expose script editors to the plugin API.

All 12 comments

This feature looks quite useful. I'd like to know how Godot can go by implementing this. A simple hacky solution would be just using the output from git diff or a flagged version of it and highlighting the lines according to that.
But this can be done only when the user uses Git in their Godot project.

A simple hacky solution would be just using the output from git diff or a flagged version of it and highlighting the lines according to that.

I can assume that it will be slow and laggy. Still, I'm not familiar with low-level languages and do not know how it's implemented, f.e., in IntelliJ IDEA.

But this can be done only when the user uses Git in their Godot project.

Lets start with Git as the most widespread version control system.

Git would be the easiest to use to get this done. Deploying an entire file system watcher for this seems is probably overkill.
EDIT: We can probably look into how VSCode or any other open source text editor acquires this functionality.

I think this is not necessarily related to Git, because in Visual Studio and QtCreator I can see the same "modification marks" in a project that does not use Git. They are very useful to quickly jump back to the place you modified files and give an overview.

image

Basically, the editor just highlights modified lines that were not saved, changes their color when they are, and keeps that information until the file is closed.

This is even more useful with full-scale overview scrollbars such as code minimaps.

Then, once we have that, Git-style (or whatever VCS) modification marks could be done as a plugin once we better expose script editors to the plugin API.

@Zylann Remember that scripts are saved every time you run the project, so ths usefulness of this would be limited when you're iterating on a script. (This would be even less useful if we had a "save on focus loss" mode, like in Visual Studio Code.)

Agreeing with Calinou. If the prompts/highlights go away as soon as you save the file then this way of implementation without any VCS communication wouldn't work. The time in which this feature would be useful would be incredibly short for people who just instinctively like to save after an arbitrary amount of edits.

Well, I personally save compulsively so I kind of agree that the "modified but not saved" state of modification marks is not often useful, but they are not going away because they stay until the script is not closed: the "modified and saved" marks are the ones I find useful, at least in my own usage. They would stay even if you launch the game or if you unfocus the editor. Both exist in QtCreator and it's still handy even if they don't relate to VCS.

If we can get VCS work with that then fine, but IMO the non-VCS behavior is a lot easier to implement and can be built-in, while VCS-aware functionality would need to both have that, and a VCS API and a plugin for the VCS you use.

@Zylann Yes a VCS API would be required for proper implementation. The non-VCS behavior is beneficial too and I think having both would be a treat rather than any one of them

@Zylann in the example you provided (QtCreator), the marks stay even after saving. So, at which point do they go away?

@jahd2602 I know you're asking about Qt Creator, but for reference, in Visual Studio Code, they go away when you stage changes using git add.

@Calinou Good to know. But what about vcs-less files?

I am asking because a possible course of action could be:

  1. Start implementing marker that goes away on save: the code simply compares the current buffer with the saved one
  2. Implement marker that persists even after saving (keep it until...?)
  3. Integrate with VCS a la VSCode

Feature and improvement proposals for the Godot Engine are now being discussed and reviewed in a dedicated Godot Improvement Proposals (GIP) (godotengine/godot-proposals) issue tracker. The GIP tracker has a detailed issue template designed so that proposals include all the relevant information to start a productive discussion and help the community assess the validity of the proposal for the engine.

The main (godotengine/godot) tracker is now solely dedicated to bug reports and Pull Requests, enabling contributors to have a better focus on bug fixing work. Therefore, we are now closing all older feature proposals on the main issue tracker.

If you are interested in this feature proposal, please open a new proposal on the GIP tracker following the given issue template (after checking that it doesn't exist already). Be sure to reference this closed issue if it includes any relevant discussion (which you are also encouraged to summarize in the new proposal). Thanks in advance!

Note: In this case, it may be better to open in the https://github.com/godotengine/godot-git-plugin repository

Was this page helpful?
0 / 5 - 0 ratings

Related issues

blurymind picture blurymind  路  3Comments

Spooner picture Spooner  路  3Comments

ducdetronquito picture ducdetronquito  路  3Comments

Zylann picture Zylann  路  3Comments

mefihl picture mefihl  路  3Comments