Implement the simplest possible project file add

At the moment DIDE has no idea that particular file (source target) is part of the project or not (when user just opens some random file for editing).

What we want here is to have File/Add to project menu item, to add currently editing file to the currently open project (at the moment the "snippets" project). We want this from this moment to appear in the SRC list so that user can always open it by double-clicking (covered by another ticket).

List of requirements:

  • Projest/Add file menu item
  • File added to the SRC list
  • dide.json file in the snippets project must contain a key "files" and file would be added as an object to this list

Example: If /home/dejan/foo.d is added to the snippets project. Then dide.json should contain at minimum:

"files": [
  "/home/dejan/foo.d"
]

If file name starts with *, that replaces the project path. So */src/bar.d in snippets project actually means $HOME/.local/dide/snippets/src/bar.d. Similarly, if the file $HOME/htest.d is added to the project, it will show up as ~/htest.d.

Edited by Dejan Lekic