Git Product home page Git Product logo

lineendingsunifier's People

Contributors

jakubbielawa avatar liulex avatar sherief avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

lineendingsunifier's Issues

Ending line incorrect VS2015

I use the setting Dominant for line endings because my project mix LF and CRLF endings.
In my case, some files with full LF endings switch to CRLF without reasons.
Is there anyway we can debug this problem ?

Only changes files that are currently open

When running "Unify line endings in this folder" on a folder in Solution Explorer, the completion message box will show what should have happened, but no files are actually changed.
When a file that needs to be changed is currently open in Visual Studio, the correct changes will be applied to the text buffer, but the file will not be saved (which can be seen as correct behavior).

Tested in both VS 2015 Update 3 and VS 2017 with the latest update applied.

csproj files

Might this help us with our csproj problems, or only files you edit in VS?

Dockerfile and unsupported file format

Great plugin!

Running this on a Dockerfile produces the error:

Error

This is not a valid source file!

Workaround:

  1. Rename Dockerfile to Dockerfile.txt file
  2. Run the plugin on Dockerfile.txt
  3. Rename Dockerfile.txt to Dockerfile

Would be awesome if it could be fixed!

Can't unify in solution/project/folder structure

Hi.
I currently have an issue with the management of inconsistent line endings in my project across multiple files. I found your plugin which seems to be exactly what I need, however I'm having difficulty with it.

I can't unify line endings for an entire solution (containing 2 projects) or per project. Whenever I select the unify option after right-clicking on any of the above items, nothing happens. The output window simply says Unifying started.... If I select a folder to unify, only the items in the first folder will be unified. It seems as if the extension is having difficulty with a complex folder structure where it can't traverse back to the parent folder after scanning its first child folder.

Please see the examples below:

Unify Line Endings In This Project
image

Unify Line Endings In This Folder
image

I am using Visual Studio 2017, and the extension settings is configured as follows:
image

Would you be able to assist with this issue?
Thank you.

Python files not supported - even after changing "Supported File Formats"

I changed "Supported File Formats" to:
.cpp; .c; .h; .hpp; .cs; .js; .vb; .txt;*.sh;*.py

However, if I right click on a Python file, and try to unify the line endings, it says:

image

If I rename the .py file to an otherwise supported file, i.e. .cpp, and try to unify the line endings, it works fine.

Honestly - these are all text files, it's frustrating to have it enforce file safety.

I also tried putting the *.py extension at the start of the "Supported File Formats" but that didn't do anything either.

All other options were default.

Crashes, then continues, sometimes popup at end, sometimes not, always shows "changed 0 of xxx line endings"

Thanks for this, it really made my life better, I got so annoyed by VS popping up with the "inconsistent line endings" message.

After a first trial run on a large F# project, I found a few issues, though (running the latest stable of VS2017):

  • When logging is on, it always shows "changed 0 of xxx line endings", even when multiple lines were changed in any particular file. When it doesn't need to change anything, it says "no need to change this file"
  • On the end, it shows a message box, even when thousands of lines were changed, it always shows:
    image
  • It crashes (but only when many lines are changed, when nothing needs to be changed, it doesn't crash), with VS showing a message to check the activity log. Clicking OK lets the tool continue
  • The message box at the end sometimes shows, sometimes doesn't
  • Sometimes it just stops, without the success message in the log. Doing it again will process the rest of the files

None of the above seem to break the basic functionality, pretty neat how it works, but I thought I'd let you know nonetheless.

Visual Studio 2017 support?

Would it be possible to update so Visual Studio 2017 is supported? It's out as a release candidate, and quite a few extensions support it now. I don't think there's be much to change. I've never worked with VS extensions before, but simply trying to compile it on VS2017 fails.

"Dominant" option seems to work incorrectly

From VS Marketplace: "I have configured "Dominant". This works fine if I set "Remove Trailing Whitespace" = "False". But If I set trailing whitespace removal to "True", then the resulting document always has Windows Line Endings, although most of the lines had Unix Line Endings before."

more source file extension support

Hi, thanks for the helpful tool, but would you kindly add more file extension support, e.g. '.cc' or '.inc', etc. Those are very commonly used extensions too, but seems not working.

add support for bash files

i need to support bash files (.sh extension) and .conf files. I added the supported extensions in the config, but it doesn't replace any of the line endings.

How do I go about adding support for these files? I thought it would be a simple.. add the extension and replace the \r\n for \n but apparently not!

Feature request: Option to reduce multiple newlines to 1

Thanks for making this extension! I find that while moving code around I often have multiple newlines (2 or 3) and I'd like to be able to reduce that to 1 empty line where there are multiple, so still keep some line spacing between, but not an inconsistent amount.

var a=123;
var b=345;


var c=a+b;

would become:

var a=123;
var b=345;

var c=a+b;

2022

Are you planning on updating the extension for 2022 ???

Add option for line ending on last line?

VS doesn't put a line ending on the last line, unless the user does. Most other editors do, including vim, just hide it. Some programs like git complain if there isn't a line ending on the last line.

It would be nice to have an option in your addon to put line endings on the last line, if that wouldn't be too difficult.

Remove Spaces Issue

In version 1.8 if you have the remove spaces enabled and there's a small file with lot's of space the program adds some date to the end of the file. You can also make it happen by adding a lot of spaces to a small file and then saving it.

Appears to fail on .xaml files

Hello,

I'm using Xamarin Forms with Visual Studio 16.6.1.

I added ".xaml;" to the list of Supported File Formats: ".xaml; .cpp; .c; .h; .hpp; .cs; .js; .vb; .txt".

In the solution explorer, I right-click on the solution, and choose "Unify Line Endings In This Solution". It processes a number of files, but then just stops - it appears to hang up on the first .xaml file it encounters. No further files are processed, and there is no dialog that appears at the end, and no ".leu" file is written.

If I remove the ".xaml;", all other files in the solution are processed, and the dialog appears at the end, and the ".leu" file is written.

Feature Request: Option to not create ".leu" file

Hello,

I have my files under source control, so I don't need the extension to keep a record of what it changed. When I run the extension, the ".leu" file is created, and therefore appears as a new file in the source control software - and I have to find it and delete it to make sure that it does not get committed every time.

Please add the option to simply write progress to the Output Window, without creating a log file.

Thanks!

.editorconfig support

Visual Studio supports .editorconfig file. It allows to setup all the settings which your extension provides, but in a bit more flexible way (you can set different options for different file types on per directory basis).

But it is buggy, it frequently mixes line endings in a lot of situations, and the developers of VS don't fix it for very long time. I have reported it twice:
https://developercommunity.visualstudio.com/content/problem/617952/vs2019-itself-creates-files-with-mixed-line-ending.html
https://developercommunity.visualstudio.com/idea/363894/mixed-and-inconsistent-line-endings.html

It would be nice if this extension detect that there is an .editorconfig file available, and just fix line endings according to what is specified in the .editorconfig. All the other things are already done by VS (adding a new line at the end, removing trailing spaces), but not unifying of the line endings.

UnfiyLineEndingsInSolution causes files to be opened in external editor

Hi Jakub,

I'm wondering if we can have a separate setting to disable the call to UnifyLineEndingsInSolution(false); at line 91 in LineEndingsUnifierPackage.cs?

Alternatively, could we make it only address open documents when one saves a solution?

I typically use the "SAVE-ALL" button in VS to save any open documents and to make sure that the .sln and .csproj files are saved...I never expected it to go into my un-opened files to change line endings. At first I did not realize it was doing this.

But now, I have set an external editor as the default editor for all of my JSON files and I noticed, as soon as I did this...whenever I hit "SAVE-ALL" in VS, all JSON files in my solution would open in the external editor. I suspected LineEndingsUnifier and disabled it, which confirmed my suspicion.

Do you experience this same behavior in the version of VS that you are using? I am on VS 2015 Pro.

If you tell me what course of action that you would like to take, I will be glad to send you a pull request. Thank you.

In Visual Studio 2019, the editor says that it uses a deprecated API and then disables the extension

After you install this extension to Visual Studio 2019 it complaints that the extension uses a deprecated API and can only be loaded if you enable synchronous loading of extensions. By default, it disables the extension.

I don't know what particular part of the API has been deprectated by Microsoft, but to enable this with asynchronous extension loading, I think the fix would be to get the deprecated code updated.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.