editorconfig / editorconfig-visualstudio

EditorConfig Visual Studio Addin
http://editorconfig.org
Other
353 stars 75 forks source link

Not recognizing file pattern *.{cpp,h,...} #29

Closed jojastahl closed 8 years ago

jojastahl commented 8 years ago

Hello, I installed the extension from visual studio gallery in VS2015. However, it doesn't apply settings specified in the .editorconfig file. I checked with command line editorconfig and it correctly finds and interprets my editorconfig file. editorconfig.exe was v12.0. I decided to build from sources, went into the debugger. ec_fnmatch doesn't find any match. Then found that the core is bound to v11.5, so updated core to v12.0. This brought in a dependency to PCRE library which I resolved with some hacks. Rebuild and tested again, working. So I think, the v11.5 core has a bug. I found the push request with a rework with core-net, installed it and it is working. So it would be nice to integrate the core-net and update the VS gallery item. Thanks so far,

clairernovotny commented 8 years ago

I think I'm seeing this same issue but with XML fles.

My top level .editorconfig looks like this

# editorconfig.org

# top-most EditorConfig file
root = true

# Default settings:
# A newline ending every file
# Use 4 spaces as indentation
[*]
insert_final_newline = true
indent_style = space
indent_size = 4

# C++ Files
[*.{cpp,h,in}]
curly_bracket_next_line = true
indent_brace_style = Allman

# Xml project files
[*.{csproj,vcxproj,vcxproj.filters,proj,nativeproj,locproj}]
indent_size = 2

# Xml files
[*.{xml,stylecop,resx,ruleset}]
indent_size = 2

# Xml config files
[*.{props,targets,config,nuspec}]
indent_size = 2

# Shell scripts
[*.sh]
end_of_line = lf
[*.{cmd, bat}]
end_of_line = crlf

But when I open up a csproj file to edit it in the XML editor, the XML tab & space settings get changed to 4, not the default of 2. It seems to be not picking up that csproj line.

I'm using VS 2015 Update 1 with the Editor Config 0.5 from the VS Gallery.

thomaslevesque commented 8 years ago

I noticed this issue too (v0.5, VS2015 Update 1). Not being able to use patterns with multiple extensions is really annoying, it means I have to duplicate the configuration for each file extension.

xumix commented 8 years ago

can't +1 this enough

Mpdreamz commented 8 years ago

This is fixed in the upcomming release which uses the c# port of the core engine:

https://github.com/editorconfig/editorconfig-core-net

thanks for reporting this