3

Does anyone work with EditorConfig files in VS?

dotnet_naming_rule.Variable_bool.symbols = Variable_bool
dotnet_naming_symbols.Variable_bool.applicable_kinds = field
dotnet_naming_style.Variable_bool.required_prefix = b
dotnet_naming_style.Variable_bool.capitalization = camel_case
dotnet_naming_rule.Variable_bool.severity = suggestion

this is part of one i'm currently working on. My intention is to let it detect every boolean variable that is not named correctly. Am i doing this right? Am I missing something? (Because at the moment it doesn't work).

Comments
  • 1
    I'm not sure .editorconfig works like that. I could ofc be very wrong.

    But Editor config is more for consistent line endings and encoding. Here's a document you might find helpful: https://github.com/editorconfig/...
  • 1
    @Kandelborg thank you^^
    I have no idea about EditorConfig files either but my boss wants me to write one containing our coding conventions.
  • 1
    @KittyMeowstika make sure to uldefine line endings and utf. That's really important.

    Besides that, something like Prettier might do you better in order to make sure lines a x chars long and there's a space after a function name etc. etc. But I'm really not well versed in VS so I have no idea. I personally use VSCode for everything and there it's just plusing and a settings file away.
  • 0
    @Kandelborg do you know how i do that? and what should be the default for line-endings?
  • 0
    @KittyMeowstika I don't want to impose anything but CRLF endings have always worked for me and is something I see quite often.

    Prettier is for JS, I always forget its not universal.. But, you're in luck because VS has great docs on this: https://docs.microsoft.com/en-us/...

    There's two links in this section, those will have a lot more useful info than me. https://docs.microsoft.com/en-us/...
  • 0
    @KittyMeowstika Did you define the affected files in your config? Like here

    https://docs.microsoft.com/en-us/...
  • 0
    @Kandelborg what do you mean by that? my editorConfig file is in my project folder.
    i have several filetypes defined. (all, c# + c++, c#, c++)
    the file i use for testing is in the same hirachie and i formated it (fomat document option) to make sure changes are visible
  • 0
    some things work now (like indent-space and style and naming rules for properties) but naming rules for fields dont. i don't understand this. is there a good tutorial/ example i can use to understand what i'm doing?
  • 1
    @KittyMeowstika My best bet would be to use the official documentation with the links I've given.

    Are you sure the file positioning is correct?

    Is VS setup to use it correctly?

    Is the rule correctly spelled out?

    I'm almost certain it's a VS problem. The syntax looks fine
Add Comment