Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply insert_final_newline setting to csproj files #43

Open
501st-alpha1 opened this issue Jun 9, 2016 · 1 comment
Open

Apply insert_final_newline setting to csproj files #43

501st-alpha1 opened this issue Jun 9, 2016 · 1 comment

Comments

@501st-alpha1
Copy link

When I modify a setting in Visual Studio that modifies the project file (<something>.csproj), that file is saved without a final newline, even though my .editorconfig contains insert_final_newline = true.

Since I occasionally edit the file outside of Visual Studio, my current workaround is to disable the final newline for the project file, but it would be nice to not have to do this.

@robertcoltheart
Copy link
Contributor

Project and solution files are not currently being processed. This is definitely a bug, but as yet I haven't found a solution.

For technical reasons unknown, .csproj and .sln items are in the IVsRunningDocumentTable table at save time, but do not have a text buffer associated with them, likely because they do not have an active open window (?). Thus the plugin sees that project and solution files are modified, but can't intercept the text buffer to apply editorconfig rules.

One way around this would be to listen to the OnAfterSave event and then modify the project/solution files straight from the disk. However the side-effect would be that VS would get 'project changed' notifications, so this is far from ideal.

I'm still searching for a solution to this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants