Add files with Finder

Is it possible to make it so that adding files into the project with Finder updates references. And you could remove files in this way as well?

Can you elaborate?

It says I can’t upload (images) files currently.

Im looking for the behaviour that exists in VSCode. This means If you have a file on desktop, and drag it to a Finder window in a directory of a project - the IDE updates. It’s shown in the IDE file explorer and I can use it’s code.

That’s the main behaviour I would like to work with. Linked files is good to have but I only use it in some scenarios when I store api keys and such.

It feels like Im doing work twice. Adding file to folders in the project (Which is usually where you want them?) and then dragging them to Fire file explorer.
(I want to move code from elsewhere into the project)

I don’t understand. Upload what where?

Ah I see. That’s not how our projects work, no. A project is defined by the files it references, not by what bis contained in its folder. It’s possible to have more than one project in the same folder, and/or have file as part of the project that are not in the same folder (structure).

What you can do (right now only by manually editing the project file) is include all files matching a wildcard from a folder, by adding an item such as <Compile Include="foo/*.cs"/>, which would treat all .cs files in folder “foo” as part of the project.

But note that this is a a bit of a “hack”, not the way .elements projects are supposed to be used, and as such not well supported by the IDEs.

It was just I couldn’t upload screenshots here on the forum for a while.


That seems like great workaround for me.

It feels counter intuitive to have projects in one folder and their files mixed and scattered across the file system?

Ah. strange. I’ll look into that.

I’m not saying you should do that ;). I’m just saying for Elements (same as for classic VC#, for example), project content is driven by whats in the project file, not by the content of a folder.

Blockquote
I’m not saying you should do that ;). I’m just saying for Elements (same as for classic VC#, for example), project content is driven by whats in the project file, not by the content of a folder.

If the files are intended to be inside the folders of the project most of the time it would help if they would move there by default in my opinion.

I’m afraid the current behavior is as-designed, for now.

Note that when dragging new files to the project from Finder, you can hold down Option to have the copied to the target folder, rather than referenced from where they are — as is standard macOS drag-and-drop behavior.

Right moving files in with Option key helps a bit

1 Like