Giter Site home page Giter Site logo

Comments (3)

citizenmatt avatar citizenmatt commented on July 2, 2024

This is ReSharper itself that is opening the files, the StyleCop extension has no influence on this.

However, what might be happening is that the extension is modifying the file, but setting it to exactly what it already was (e.g. normalising spacing that was already normalised, or applying formatting to a code block that was already formatted). ReSharper might be seeing the modifications, so opening the files, but since the text doesn't actually change, the documents aren't make modified.

Do you have an example where this happens?

from stylecop.

dmitriyse avatar dmitriyse commented on July 2, 2024

Hi!
Steps to reproduce:

  1. Download and open solution from this link (https://www.dropbox.com/s/fxvijb9qdcduool/StyleCopReformatOpenFilesAlways.zip?dl=0)

  2. Close all files

  3. Select solution node in the solution explorer

  4. Push CTRL + E,C (CodeCleanup)

  5. Check "To enable Undo, open all files with changes for edititng

  6. Select "WithoutStyleCop" formatting settings.
    image

  7. Push Run and ensure there no any files opened after this operation.


  1. Select solution node in the solution explorer
  2. Push CTRL + E,C (CodeCleanup)
  3. Select "WithStyleCop" formatting settings.
  4. Push Run and see that assemlyInfo.cs is opened, but no any changes performed by cleanup.
    image

Those to settings "WithStyleCop" and "WithoutStyleCop" should works equally.
"StyleCop reformat" forces resharper to think that some files was modified or puts files to some special state that leads to wrongly opening files.

This problem is critical on a big projects, where you want to control what was reformatted, but 1000+ unchanged files are opened.

from stylecop.

citizenmatt avatar citizenmatt commented on July 2, 2024

Looks like it's blindly reapplying the sorted list of using statements, so ReSharper opens the "changed" file.

from stylecop.

Related Issues (20)

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.