roslyn icon indicating copy to clipboard operation
roslyn copied to clipboard

New .editorconfig designer does not save changes

Open vsfeedback opened this issue 3 years ago • 29 comments

This issue has been moved from a ticket on Developer Community.


git clone https://[email protected]/devdiv/DevDiv/_git/VS.CloudCache
cd VS.CloudCache
git checkout 2c9b11133a2fc8acfb9c73486d1fa5cca0703821
.\Microsoft.VisualStudio.Cache.sln

In Solution Explorer, expand the test folder and open .editorconfig. In the designer, make a change (check a box, or in my case set SA1611 to Disabled Save the document and close.

Expected

Git Changes shows the file has been changed on disk.

Actual

No change is applied to the file.

And BTW, since this designer now preempts the text editor opening the document, this is a regression in my ability to maintain these files from within VS.

Workaround

Use Open With... to force the text editor to open the document.


Original Comments

Feedback Bot on 5/12/2021, 07:25 PM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.

Aimee Cao [MSFT] on 5/24/2021, 02:58 AM:

Thank you for your feedback!
We were unable to open the .editorconfig file in your repo and it showed up blank. we verified the .editorconfig file in the other repo and after modifying it, it showed up in the git changes window. Could you give us a simple repo that reproduces this issue?
Do other types of files show up in the git changes window after they’ve been modified?

We are looking forward to hearing from you soon.
Thanks
Why do we ask for more info?
We try to reproduce all issues reported with the information provided in the description and comments. When we can’t reproduce the issue, we ask you for more information so we can resolve the issue as quickly and efficiently as possible.
In our guidelines, you can get tips on how to provide clear and simple reproducible steps.

Andrew Arnott [MSFT] on 5/24/2021, 07:28 AM:

This no longer repros as of 31324.4.main.

Feedback Bot on 6/2/2021, 07:21 AM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.

Feedback Bot on 6/2/2021, 09:41 AM:

Thank you for sharing your feedback! Our teams prioritize action on product issues with broad customer impact. See details at: https://docs.microsoft.com/en-us/visualstudio/ide/report-a-problem?view=vs-2019#faq. In case you need answers to common questions or need assisted support, be sure to use https://visualstudio.microsoft.com/vs/support/. We’ll keep you posted on any updates to this feedback.

Rasmus Wätjen on 6/7/2021, 00:51 AM:

I have this issue also. For me it is only when changing severity from Warning or Error to Suggestion.
In that case the file does not change on disk, and the file does not show as changed in the IDE.
When changing from Suggestion to Warning or Error it works as expected.

Also: If I change the severity FROM Suggestion to e.g. Warning, and change it back - without saving in the mean time, then the when I save the file, the severity is stored as Warning.


Original Solutions

Aimee Cao [MSFT] solved on 5/24/2021, 06:48 PM, 0 votes:

Thank you for your feedback! I’m going to close this as not a bug, if you encounter the issue again, please re-active it or summit a new one. Thanks for contributing to Developer Community.

Andrew Arnott [MSFT] on 6/2/2021, 07:19 AM:

Actually, this is still repro’ing. I’m on 31401.7.main now and the designer never saves changes I make to analyzer severity settings.

Jonathan Griffiths solved on 6/29/2021, 02:29 AM, 0 votes:

[Workaround]
This is a pain. The easiest workaround I’ve found is to expand the Solution Explorer > Dependencies > Analyzers and then to right-click on the rules in turn and set the severity. This seems to update the .editorConfig file.

vsfeedback avatar Jul 01 '21 18:07 vsfeedback

@jmarolf

mavasani avatar Jul 02 '21 03:07 mavasani

This is part of https://github.com/dotnet/roslyn/issues/53171 (the 7th point)

Youssef1313 avatar Jul 02 '21 07:07 Youssef1313

Any ETA about this bug? It is badly affecting the work.

light-traveller avatar Apr 19 '22 09:04 light-traveller

I am also getting the following error when adding a .editorconfig file to a blank solution. image

This is the VS version info: image

light-traveller avatar Apr 19 '22 10:04 light-traveller

There's at least three issues open for this problem (this one, #56676 and #60232) and somehow it's still an issue after nearly a year. I don't get how major software like this can ship with totally non-functional UI (over multiple versions!). It's not like it's a minor usability issue, it's literally just completely broken and useless. I also don't see how this is a Roslyn issue rather than a Visual Studio issue (but I have no idea how things are implemented internally so maybe it makes sense).

FWIW I'm seeing this issue while trying to set "Use Tabs" to true, but nothing changes in the file.

Clonkex avatar May 06 '22 04:05 Clonkex

There's at least three issues open for this problem (this one, #56676 and #60232) and somehow it's still an issue after nearly a year. I don't get how major software like this can ship with totally non-functional UI (over multiple versions!). It's not like it's a minor usability issue, it's literally just completely broken and useless. I also don't see how this is a Roslyn issue rather than a Visual Studio issue (but I have no idea how things are implemented internally so maybe it makes sense).

FWIW I'm seeing this issue while trying to set "Use Tabs" to true, but nothing changes in the file.

As far as I have seen throughout the years, Microsoft almost always acts like low-budget start-ups in releasing software-even for commercial products like VS 2022! It first releases a problematic software, then waits for the community to find bugs and report issues! This makes no sense whatsoever.

How come such a wealthy huge corporation does not posses enough resources to do a clean release for God's sake? Seriously how?

light-traveller avatar May 07 '22 18:05 light-traveller

@light-traveller we are a team with a given amount of resources, just like any project. Currently there are roughly 5k+ issues to get through, so that means at any time there are likely many thousands of things that don't make the cut to get fixed given the manpower and time we have.

If these issues are very important to you though, we are an open source project and would gladly accept help and contributions here like we do for many other areas. That can allow you to get things prioritized to your need level as opposed to the need of the entire community.

Thanks!

CyrusNajmabadi avatar May 07 '22 18:05 CyrusNajmabadi

@CyrusNajmabadi, please bear in mind that such basic things, i.e. saving a file, usually should not be problematic in the first place. In case of an unfortunate problem, like this one, it is expected to get these VERY BASIC THINGS fixed first, before adding more immature features to the whole product. And what need of the community (bugs to be specific) has a higher priority than saving a text file which is used in all types of projects? I see no point in your argument buddy. Sorry.

light-traveller avatar May 09 '22 12:05 light-traveller

And what need of the community (bugs to be specific) has a higher priority than saving

Crashes, hangs, data loss, etc. would all have higher priority.

@jmarolf can you ptal soon on this?

CyrusNajmabadi avatar May 09 '22 14:05 CyrusNajmabadi

Workaround at end of OP from Jonathan Griffiths worked. Not great but good enough for interim.

[Workaround] This is a pain. The easiest workaround I’ve found is to expand the Solution Explorer > Dependencies > Analyzers and then to right-click on the rules in turn and set the severity. This seems to update the .editorConfig file.

9swampy avatar May 10 '22 23:05 9swampy

data loss

FWIW, @CyrusNajmabadi, this is a data loss bug. Changes I'm making the editorconfig UI are getting lost.

333fred avatar Jun 29 '22 05:06 333fred

I'm assuming this issue is related to the refactoring tool not working for .editorconfig? i.e. The Apply button from this window does nothing. image

jeanplevesque avatar Jul 28 '22 12:07 jeanplevesque

We have 2 bugs here (maybe they are related).

  1. In some cases .editorconfig designer ignore all changes. I can't 100% repro this scenario :(
  2. .editorconfig designer cashing values that was on opening file. For example if property have value a on open then we can change it to b and save. But if we then change it back to a and save - property value remaining as b. See in video:

https://user-images.githubusercontent.com/17767561/208246072-a4389378-f4c2-4b88-b8ba-5edaeff2edcc.mp4

kirsan31 avatar Dec 17 '22 14:12 kirsan31

Tagging @arkalyanms

CyrusNajmabadi avatar Dec 26 '22 11:12 CyrusNajmabadi

I've seen bugs reported for this for OVER 2 years... Seriously. How the hell is a simple "Your shit doesn't work and save the file" not fixed at this point. There is not a single reason in this world that will justify this.

NONE.

Microsoft has enough resources for this to happen. No matter what the current team workload is, it's your job to report that you don't have enough resources and ask for more so us, the clients, can have the basics working.

drizztdourden08 avatar Mar 09 '23 00:03 drizztdourden08

It'd be great if they at least investigated and let us know what the problem is. Either the problem is easy to fix, in which case they can fix it, or it's hard to fix, in which case it'd be nice to know exactly why it's hard to fix. Anything to justify it being broken for so long.

Clonkex avatar Mar 09 '23 00:03 Clonkex

Seriously, what could be hard about this?

1- Populate the file from something (Actually don't know what that is) 2- Read the config from the file and bind the UI. 2- Let the user choose whatever. 3- Write the said lines to the file.

Done.

This is an easy job for even the newest of programmers.

I just solved the issues on my end by opening the file using "Open with", erasing literally everything. There was a class {} in it somehow. Afterward, everything worked just fine.

I'm pretty sure this is just a matter of checking if the source file is actually compatible and valid. Cause after that, it wrote everything as expected. How is that not a thing that's checked literally when the file is opened is beyond me.

drizztdourden08 avatar Mar 09 '23 01:03 drizztdourden08

@drizztdourden08 could you provide a repro that demonstrates the issue?

CyrusNajmabadi avatar Mar 09 '23 01:03 CyrusNajmabadi

@drizztdourden08 could you provide a repro that demonstrates the issue?

In a new project, create a file at the root using right click -> Add -> name it .editorconfig -> I didn’t choose anything thinking it’d be blank but c# class was selected so the template for this was in the file.

Open .editorconfig with double click, the ui show and populate normally but no matter what changes, there is no * beside the file name to signify you can save.

I opened it with “Open with”, then saw the tenplate for a c# class file. Deleted everything. Solved.

drizztdourden08 avatar Mar 09 '23 07:03 drizztdourden08

@drizztdourden08 I tried the above and had no issues saving changes. Something must be different about your setup. Any chance you could put your project on GitHub and give us a link?

CyrusNajmabadi avatar Mar 09 '23 16:03 CyrusNajmabadi

This is a Unity project so .Net version and stuff like that will conform to the latest LTS version of Unity. This is the only thing that could be different here.

Unfortunately, can’t share the project right now.

Get Outlook for iOShttps://aka.ms/o0ukef


From: CyrusNajmabadi @.> Sent: Thursday, March 9, 2023 11:11:16 AM To: dotnet/roslyn @.> Cc: Drizztdourden_ @.>; Mention @.> Subject: Re: [dotnet/roslyn] New .editorconfig designer does not save changes (#54556)

@drizztdourden08https://github.com/drizztdourden08 I tried the above and had no issues saving changes. Something must be different about your setup. Any chance you could put your project on GitHub and give us a link?

— Reply to this email directly, view it on GitHubhttps://github.com/dotnet/roslyn/issues/54556#issuecomment-1462336793, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AIWKT7DOCLSHLPBY4CCLFZDW3H6KJANCNFSM47V3UFFQ. You are receiving this because you were mentioned.Message ID: @.***>

drizztdourden08 avatar Mar 09 '23 18:03 drizztdourden08

Hi @drizztdourden08 , that's very helpful. We'll definitely try out on a Unity project to see if it reproes and then indicates what the problem is. Thanks for sharing that information!

CyrusNajmabadi avatar Mar 09 '23 18:03 CyrusNajmabadi

@CyrusNajmabadi Point 2 from my post is 100% reproducible, and may be global problem is related to it...

I agree with @drizztdourden08 that this UI editor is not usable from beginning :( For me it's mainly due to this (#54556) and https://github.com/dotnet/roslyn/issues/59325 bugs...

kirsan31 avatar Mar 10 '23 11:03 kirsan31

Hello @vsfeedback , I've faced with a similar issue. When I was adding edc file via solution explorer then changes hasn't been saved for the edc file. It can be resolved used follow steps:

  • go to Tool -> Options
  • go to Text Editor -> C# -> Code Style
  • press the Generate .editorconfig file from settings button
  • choose a folder and save the file It was weird case but standard methods didn't work only for this one project for others everything was fine. I hope you find my experience useful.

makimusan avatar Jun 11 '23 15:06 makimusan

I have the same issue. Basic .NET 6 API project. .editorconfig does not save. Visual Studio is entirely up to date as of 03/25/2024.

vchtelmakh avatar Mar 25 '24 14:03 vchtelmakh

Shit is STILL not solved. But I guess who cares about the editor config of an premium product where the UI is made by an hobbist.. Who earns money on this project? And has the fkn balls to ask the community to deliver free work, even worse, almost expected.. I wonder how long that kind of community abuse will work..

"Crashes, hangs, data loss, etc. would all have higher priority." ~ 3 years.. lets see what excuses are made now.. because at my job, we use planning, we can handle crashes and breaking UI in the same year. Sometimes they are correlated, so we dont make excuses, we make solutions (also no 50% solutions).

bcheung4589 avatar May 06 '24 12:05 bcheung4589

@bcheung4589 we'd welcome contributions here. Thanks!

CyrusNajmabadi avatar May 06 '24 14:05 CyrusNajmabadi

@bcheung4589 we'd welcome contributions here. Thanks!

Thats earned. People dont just go contribute their time and effort on projects. If I open our project up to public, the company I work for would welcome your contributions to the project also.

bcheung4589 avatar May 06 '24 15:05 bcheung4589

People dont just go contribute their time and effort on projects.

Lots of people do. Dotnet and Roslyn both have lots of external contributors. That's the great thing about open source :)

If you're interested, let us know and we'll happily work with you to help you get ramped up here. If not, we understand. Have a good day! :)

CyrusNajmabadi avatar May 06 '24 16:05 CyrusNajmabadi

Same issue here VS 2022 .NET 8 SDK projects. Cannot modify .editorconfig files. Always resets to default values.

ShadyHarbinger avatar May 24 '24 07:05 ShadyHarbinger