vscode-csproj icon indicating copy to clipboard operation
vscode-csproj copied to clipboard

Setting to disable the "would you like to add it?" popup

Open cknightdevelopment opened this issue 9 years ago • 9 comments

I am really enjoying using the extension EXCEPT for getting a prompt every time I open a non-project file asking me if I want to add it. Can you make a setting to disable this popup? It gets really annoying quickly. Thanks!

cknightdevelopment avatar Aug 31 '17 21:08 cknightdevelopment

Second'd. There are situations when this plugin just clutters up my work.

JesseNewman19 avatar Oct 25 '17 20:10 JesseNewman19

Please add the reciprocal setting to allow/prevent opening the "X was deleted. Remove it ... ?" prompt.

Thx

ChuckyHelse avatar Mar 12 '25 12:03 ChuckyHelse

I stumbled upon this extension and found it useful for Unity development because you have to wait for a domain reload or manually regenerate project files to add a C# file to the workspace, so I created a fork at https://github.com/ongyx/vscode-csproj/tree/modernize which adds the csproj.autoAdd and csproj.autoRemove settings to address this issue.

Given the lack of activity on this repo, I'm considering publishing this fork to the Marketplace at some point, but feel free to build it from source and test it out first!

ongyx avatar Sep 07 '25 05:09 ongyx

Given the lack of activity on this repo, I'm considering publishing this fork to the Marketplace at some point, but feel free to build it from source and test it out first!

@ongyx I think there is good reason to release the new project, but I'm confused as to how you'd use it with Unity given you don't appear to have addressed #24.

rhys-vdw avatar Dec 17 '25 01:12 rhys-vdw

@rhys-vdw Hi rhys, I also noticed this was a pain point because the extension kept flipping between Assembly-CSharp.csproj and Assembly-CSharp-Editor.csproj when adding new references.

#24 can be solved using a simple string/array setting I'll tentatively call csproj.priority, where the first csproj path that exists in the array will be used by the extension on activation. A workspace setting like

{
    "csproj.priority": "Assembly-CSharp.csproj"
}

would be sufficient for most Unity projects. If the setting doesn't exist, the extension will search for csproj files in the workspace and prompt the user for which ones to put into the priority setting.

ongyx avatar Dec 23 '25 14:12 ongyx

The "would you like to add it" feature would need to let me choose from a list of csproj files as we have a multi-assembly project.

rhys-vdw avatar Dec 23 '25 16:12 rhys-vdw

@rhys-vdw I settled on another format for the priority setting, which looks like:

{
    "csproj.projectFiles": [
        {
            "path": "Assembly-CSharp-Editor.csproj",
            "glob": "**/Editor/*.cs"
        },
        {
            "path": "Assembly-CSharp.csproj",
            "glob": "**/*.cs"
        }
    ]
}

where the extension will use the first project with a matching glob for a given file path.

If you'd like, you can review the source code of and build the fork here: https://github.com/ongyx/vscode-csproj/tree/modernize Some QoL I plan to add soon:

  • XML pretty-print - linkedom, the XML parsing library in use, doesn't support it
  • A prompt to configure csproj.projectFiles

ongyx avatar Dec 27 '25 12:12 ongyx

@ongyx I'll check it out. Maybe enable comments on your fork?

rhys-vdw avatar Dec 27 '25 12:12 rhys-vdw

Sure, please refer to https://github.com/ongyx/semitone.

Edit 1: I also enabled discussions if anyone else in this issue would like to give feedback on my fork. Edit 2: Added link to new fork.

ongyx avatar Dec 27 '25 12:12 ongyx