Menu

#2242 Settings from the .editorconfig file are not applied correctly

Bug
closed-fixed
nobody
5
2021-04-23
2021-04-03
No

Settings from the .editorconfig file are applied inside ReadProperties() method. ReadProperties() is often followed by SetIndentSettings() and SetEol(), which know nothing about the .editorconfig file and apply settings from properties.

As a result, settings from the .editorconfig file are not applied correctly when opening files from the command line. If you open files from the menu, the settings are applied correctly, but this is rather luck.

I tried to fix it myself.

1 Attachments

Discussion

  • Neil Hodgson

    Neil Hodgson - 2021-04-12
    • labels: --> scite, editorconfig
    • status: open --> open-fixed
     
  • Neil Hodgson

    Neil Hodgson - 2021-04-12

    Committed as [868a64] .

     

    Related

    Commit: [868a64]

  • Neil Hodgson

    Neil Hodgson - 2021-04-14
    • status: open-fixed --> open-accepted
     
  • Neil Hodgson

    Neil Hodgson - 2021-04-14

    Unfortunately this change was too aggressive - the changes made to props would often persist to unrelated files since they are not removed when a different .editorconfig or .editorconfig mode is active. A different mechanism is needed where these settings only last for the file they refer to.

    Backed out with [b3630f] .

     

    Related

    Commit: [b3630f]

  • Andrey Moskalyov

    In my opinion, it is enough to replace props.Set with propsLocal.Set. Or maybe propsDiscovered.Set would be better?

     
  • Andrey Moskalyov

    Patch with propsDiscovered.Set

     
  • Neil Hodgson

    Neil Hodgson - 2021-04-15
    • status: open-accepted --> open-fixed
     
    • Neil Hodgson

      Neil Hodgson - 2021-04-15

      Committed as [2c1b93] . A subsequent change [118b3f] extracted ReadEditorConfig as a separate method.

       

      Related

      Commit: [118b3f]
      Commit: [2c1b93]

  • Neil Hodgson

    Neil Hodgson - 2021-04-23
    • status: open-fixed --> closed-fixed
     

Log in to post a comment.

MongoDB Logo MongoDB