Coder Social home page Coder Social logo

editorconfig-visualstudio's Introduction

editorconfig-visualstudio's People

Contributors

allen-zeng avatar bbenoist avatar breyed avatar coliff avatar hmemcpy avatar iristyle avatar jaredpar avatar jedmao avatar jednano avatar karaken12 avatar kinddragon avatar marcusrbrown avatar mikkelbu avatar mpdreamz avatar nulltoken avatar robertcoltheart avatar samsalisbury avatar shanselman avatar slaks avatar swansontec avatar takeshik avatar treyhunner avatar xuhdev 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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

editorconfig-visualstudio's Issues

EditorConfigWrapper not found on VisualStudio 2015

After opening a project without a .editorconfig file i'm getting an error from VisualStudio, after checking the ActivityLog.xml file I found the following error:

662 2015/08/26 14:28:33.116 Error Editor or Editor Extension System.IO.FileNotFoundException: Could not load file or assembly 'EditorConfigWrapper.dll' or one of its dependencies. The specified module could not be found. File name: 'EditorConfigWrapper.dll' at EditorConfig.VisualStudio.Plugin.LoadSettings(String path) at EditorConfig.VisualStudio.Plugin..ctor(IWpfTextView view, ITextDocument document, DTE dte, ErrorListProvider messageList, IViewSettingsContainer viewSettingsContainer) at EditorConfig.VisualStudio.PluginFactory.TextViewCreated(IWpfTextView view) at Microsoft.VisualStudio.Text.Editor.Implementation.WpfTextView.<>c__DisplayClass241_0.<BindContentTypeSpecificAssets>b__1() at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.CallExtensionPoint(Object errorSource, Action call)

Have tried removing and reinstalling the addon and the error persists.

File filter without curley braces crashes visual stuido

Hello,

I originally downloaded the roslyn / .editorConfig file and found it caused this extension to crash and opened this issue: dotnet/roslyn#17914

From that discussion it sounds like [.cs] should be a valid file filter.

Steps to Reproduce:
Install the EditorConfig extension for VS 2015
Place the roslyn / .editorconfig file in the solution folder
Open the solution in VS 2015

Expected Behavior:
Visual studio doesn't crash due to the missing curly braces in the [.cs] file type filter under the CSharp code style settings: section. The file filter [.cs] should be [*.{cs}]

Actual Behavior:
Microsoft Visual Studio 2015 has stopped working

b1a93a8c-0a5e-11e7-9e3b-986fc01d5589

Conflicts with SaveAllTheTime

I did some digging, it seems that the new refactored version and Paul Betts' extension SaveAllTheTime are conflicting.

SaveAllTheTime calls Save periodically / after certain changes. This causes the new version to react to the save event, and apply various transformations on the content, sometimes this applies an old version, replacing the changes. Sometimes this happens in mid typing, causing intellisense (and various other open popup windows, like ReSharper's Alt-Enter) to disappear.

I haven't investigated myself a potential solution yet, but I have disabled SaveAllTheTime at the moment. Will see what to do about it...

.EditorConfig - Mark // to do as "Warning"

Hi Dear Developer,
I am looking for a way to mark // to do in the code as warning.

Ex:
void GetInfoFromAPI()
{
// to do - Call Azure DevOps API
}

This should be marked as a "warning". Please suggest me.

first word lower

Hello,

i want a rule to make the first word in lower of my method/function names.

I have this block of code:

#method names first word lower
dotnet_naming_rule.functions_should_be_camel_case.severity = warning
dotnet_naming_rule.functions_should_be_camel_case.symbols = functions
dotnet_naming_rule.functions_should_be_camel_case.style = function_style

dotnet_naming_symbols.functions.applicable_kinds = method
dotnet_naming_symbols.functions.required_modifiers = *
dotnet_naming_symbols.functions.applicable_accessibilites = *

dotnet_naming_style.function_style.capitalization = camel_case

But it's not working. What am i doing wrong ? Please help.

Error HRESULT E_FAIL has been returned from a call to a COM component. at

System.Runtime.InteropServices.COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component. at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo) at Microsoft.VisualStudio.Shell.Design.Serialization.DesignerDocDataService.Microsoft.VisualStudio.Shell.Interop.IVsRunningDocTableEvents.OnBeforeLastDocumentUnlock(UInt32 docCookie, UInt32 lockType, UInt32 readLocksRemaining, UInt32 editLocksRemaining) at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo) at Microsoft.VisualStudio.Shell.Design.Serialization.DesignerDocDataService.Microsoft.VisualStudio.Shell.Interop.IVsRunningDocTableEvents.OnBeforeLastDocumentUnlock(UInt32 docCookie, UInt32 lockType, UInt32 readLocksRemaining, UInt32 editLocksRemaining) at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo) at System.Runtime.InteropServices.CustomMarshalers.EnumerableViewOfDispatch.GetEnumerator() at System.Collections.IEnumerable.GetEnumerator() at System.Linq.Enumerable.d__921.MoveNext() at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable1 source, Func`2 predicate) at EditorConfig.VisualStudio.Logic.Cleaning.InitialCleanup..ctor(ITextDocument textDocument, _DTE ide, FileConfiguration settings) at EditorConfig.VisualStudio.Logic.Settings.TextViewMonitor.ViewOnGotAggregateFocus(Object sender, EventArgs eventArgs) at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.RaiseEvent(Object sender, EventHandler eventHandlers)

Visual Studio 2017 support

Now, after VS2017 release, we can see what have been done there, and what haven't been done.

I have been using EditorConfig for Visual Studio to consistently set the following properties on my projects:

[*]
charset = utf-8 # that means without BOM
indent_style = space
indent_size = 4
insert_final_newline = true
trim_trailing_whitespace = true

VS2017 doesn't support charset = utf-8 (and forces the BOM all the way), nor insert_final_newline neither trim_trailing_whitespace, and that causes mess in my sources. The kind of mess I'd like to exterminate.

I think that embedded EditorConfig support in VS2017 isn't very useful in its current state, and I'd like the plugin to be resurrected and released for VS2017.

VS 2015 Git merge conflict tool ignoring indentation settings

I just fixed a fairly big merge conflict with VS 2015's built-in Git merge conflict resolving thing (i.e. the thing where you see the changes in the base branch at the top left, the changes in the target branch at the top right, and the combined file at the bottom). This involved manually rewriting some lines instead of picking an existing version of them from one of the existing branches. Upon finishing the merge commit, I realised that the lines I'd rewritten now had the wrong indentation type.

This is with the 5.0.0 release, so it's not impossible that it's been resolved in an unreleased build.

Use only one bugtracker

I am very confused as to which issue tracker should be used; the one on this repository,
or the one on the editorconfig repository which has a vs-plugin label and is pointed to by the README in this repository.

If both had all tickets that maybe would have been less of a problem, but I see ticket comments pointing to the other tracker to an issue that is not in the other.

IIRC you can disable the issue tracker on repositories, so I would suggest dropping one for the other.
If need be, there is also a (manual) migration path for existing tickets (prepare JSON data for github stuff and send it to them).

As it currently is, its confusing, potentially redundant, more for to maintain, and harder to search.

Future of this project with regards to VS 2017

I was just going over the release notes of VS 2017 and noticed this:

New in RC Visual Studio editor now supports EditorConfig, which allows developers to define and maintain consistent coding style conventions between different editors and IDEs. See known issues for a list of known limitations in EditorConfig support in this RC release.

I suppose that this extension will be deprecated then in favour of the built-in support? Either way, thanks for all the work so far, since it probably encouraged Microsoft to add built-in support :)

Version 0.6.0 was not released to Visual Studio Marketplace

Last version of editorconfig 0.5.0 was released to vs marketplace in Oct 2014. Since then a lot of fixes were made that didn't made to the end users. We are specifically interested in #44.

For now, we're going to distribute your extension manually to our end-users but it would be nice if you could release the latest version on the store. Thanks!

Indentation settings visually change when focus is lost

Using Visual Studio 2015 with the bleeding edge version of the extension.

I understand that the global settings are reset when focus is lost, but I don't understand why it has a visual effect on open files.

.editorconfig at solution level

root = true

[*]
charset = utf-8
indent_size = 4
indent_style = tab
tab_width = 4
end_of_line = crlf
insert_final_newline = false
trim_trailing_whitespace = true

When the text editor has focus:
focus

When the text editor does not have focus:
no-focus

The actual file content is as you see it when it has focus, but it's confusing to see the indentation change.

Restore global settings

I've seen in the code that for certain functions to work properly the application's global editor settings must be changed for the currently focused document. I haven't seen any code that restores these settings though. The EditorConfig website states that anything unspecified in the .editorconfig file is handled as configured by the user. This fallback configuration seems to be irreversibly manipulated as soon as a document is opened that is under control of a .editorconfig file.

Did I miss something or is the restoration of modified settings really missing? If not, maybe a note could be added to the ApplyGlobalSettings method.

'Quick Actions' gets Visual Studio stuck in some kind of loop

Using Visual Studio 2015 with the bleeding edge version of the extension.

When trying to use the Quick Actions menu, either via the lightbulb icon or via the shortcut, Visual Studio gets stuck in some kind of loop where the lightbulb icon flickers. The only way to get rid of it is by forcibly closing Visual Studio.

.editorconfig at solution level

root = true

[*]
charset = utf-8
indent_size = 4
indent_style = tab
tab_width = 4
end_of_line = crlf
insert_final_newline = false
trim_trailing_whitespace = true

Example:
focus

Vue templates

How do you create a file extension filter for sub types in a vue template?

Ex: In a vue template, there is the actual html template area, a script area, and a style area. Our normal styling rules are for js/ts content to be space indented at 2, and css/less/sass to be space indented at 4. But we cannot tell how to create the filter in the editorconfig to apply them to each as they are supposed to be, only to the entire file.

Doesn't reset to defaults when switching to a project with no .editorconfig

Newbie here. I'm not sure if this is a bug or to be expected. I'm using the latest version 0.5.0 with VS2015.

I set up a .editorconfig file like this for a cpp project. My default setting is 2 spaces for indents.

root = true

[*]
indent_style = space
indent_size = 4

So I open the project with the .editorconfig and it changes the indent to 4. Now I switch back to the other project using open recent and the indent size is still 4 spaces. I was expecting it to switch back to an indent size of 2. Anyone have any insight?

Not working correctly on Update 1

I do not know if it worked correctly before but currently with this config

# This file is for unifying the coding style for different editors and IDEs.
# EditorConfig http://EditorConfig.org
# In VisualStudio use the EditorConfig extension - https://visualstudiogallery.msdn.microsoft.com/c8bccfe2-650c-4b42-bc5c-845e21f96328

# top-most EditorConfig file
root = true

# unix style line endings with a newline ending every file
# Line-ending will interact with git line ending transformation processing
[*]
indent_style = space
indent_size = 4
end_of_line = lf
insert_final_newline = true
charset = utf-8
trim_trailing_whitespace = true

[Makefile]
indent_style = tab

#[{package.json,.travis.yml}]
#indent_size = 2

If I create edit and save a new txt file file (in git for windows) says it is

TextFile2.txt:   ASCII text, with CRLF line terminators

not LF line endings

if I insert áá it becomes ISO-8859 not UTF-8

Visual studio crash with 'zombie' file

I cannot reproduce this now but I had a package.json that was somehow listed in solution explorer but not part of the project. I can't figure how to get a file into that state again

When I saved the file I got a VS crash everytime. EditorConfig was the only extension I had added that was enabled.

See microsoft/nodejstools#621

Feel free to close thais a not reproducible. I wanted to log it.

Conditional editorconfig

We are trying to conditionally add an editoconfig to our projects. Our first idea was the possibility of adding the editorconfig at the project level under an MSBuild variable. If the condition was met, the editorconfig file (located in another folder) was added as a link to the project.

Example of adding editorconfig at the project level on demand:

<ItemGroup Condition=” $(AnalyzeAutoGeneratedCode) == ‘true’ “>

Since it doesn't work at the project level, we thought we'd add the editorconfig at the solution level. The problem is that we don't know how to add it conditionally.

Our intention would be to include an editorconfig file at the solution level that contains these exclusions, but that depends on some MSBuild variable to be able to configure it according to the needs of the programmers:

If (someVariable) # this code is the one we would like to add.
[/fakes/.cs]
dotnet_diagnostic.S1128.severity = none
dotnet_diagnostic.cs1591.severity = none
endif # this code is the one we would like to add.

Is there any way to do this?

Does not work in VS2015 with cshtml

root = true
[*]
end_of_line = crlf
charset = utf-8
insert_final_newline = true
indent_style = space
trim_trailing_whitespace = true

; 4-column space indentation
[*.{cs,js,ts,html,cshtml,aspx}]
indent_style = space
indent_size = 4
tab_width = 4

; 2-column tab indentation
[*.{xml,props,config,css,less}]
indent_style = space
indent_size = 2
tab_width = 2

indent style is ignored for cshtml files

Not working on Visual Studio 2013

Note: moved from editorconfig/editorconfig#217.

Given the following configuration file:

.editorconfig

root = true

[*]
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

And the following sample file (deliberately unformatted):

sample.html (original)

<!DOCTYPE html>
<html>
<head>
<title>Lorem ipsum</title>
</head>
<body>
<p>Lorem ipsum dolor sit amet.</p>
</body>
</html>

When I open this file in Visual Studio 2013 and do Edit > Advanced > Format Document (Ctrl+E, D), the document is indented to four spaces, seemingly ignoring the .editorconfig file:

sample.html (Visual Studio 2013)

<!DOCTYPE html>
<html>
<head>
    <title>Lorem ipsum</title>
</head>
<body>
    <p>Lorem ipsum dolor sit amet.</p>
</body>
</html>

On the other hand, when I do the same thing in Visual Studio 2012, the document is indented properly:

sample.html (Visual Studio 2012)

<!DOCTYPE html>
<html>
<head>
  <title>Lorem ipsum</title>
</head>
<body>
  <p>Lorem ipsum dolor sit amet.</p>
</body>
</html>

If it matters, this is the version of Visual Studio 2013 I use:

Microsoft Visual Studio Community 2013
Version 12.0.31101.00 Update 4

And this is Visual Studio 2012:

Microsoft Visual Studio Professional 2012
Version 11.0.61030.00 Update 4

I'm running EditorConfig 0.5.0 on both.

Note that this might be related to editorconfig/editorconfig#191, though I am not 100% sure.

"Input file must be a full path name" when using ReSharper

ReSharper uses the Visual Studio editor for various windows, such as the Stack Trace Explorer. When showing one of these windows, the Error List window pops up, showing an error of EditorConfig core error: Input file must be a full path name.

Can EditorConfig not report an error if the document is in-memory, rather than a physical file?

Doesn't apply settings to new files

Editorconfig doesn't apply my .editorconfig whitespace settings when I'm creating a new file. And it doesn't correct erroneous whitespace on save either.

This kind of defeats the purpose of using editorconfig, as I still have to configure all the whitespace settings manually in Tools > Options > Text editor to make sure that visual studio (2015) creates new files with the correct indentation. Is it possible to apply .editorconfig whitespace settings when creating a new file as well? Otherwise it doesn't really make sense to use this plugin.

Core error with Resharper file

From time to time, Editorconfig crashes with a core error on files named like StackTractExplorerEditor.Bozepih when compiliong. The extension name may vary. The file comes from Resharper, but I am not able to see it afterwards. It seems to be a temporary file.

image

Visual Studio 2015 - Update 1.
Restart of Visual Studio is required to clear it, repeated compilations causes same error.

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

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,

Apply insert_final_newline setting to csproj files

When I modify a setting in Visual Studio that modifies the project file (<something>.csproj), that file is saved without a final newline, even though my .editorconfig contains insert_final_newline = true.

Since I occasionally edit the file outside of Visual Studio, my current workaround is to disable the final newline for the project file, but it would be nice to not have to do this.

Long config section does not work

Does not work:

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

Works (found the limit to be this length):

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

Support for UTF-16

I don't know if this is a limitation or bug in the editor or the whole plug-in, but specifying utf-16le or utf16-be results in a warning in the Error List that the value is not support for charset. This feature would actually be necessary to properly support .rc and .rc2 files in our projects as Visual Studio normally encode them as UTF-16LE.

Extension occasionally crashes VS2015

One example: opening https://github.com/dotnet/roslyn/blob/32a8f40cec5d917a1356d694c6d0310ce502d5ee/src/Compilers/CSharp/Portable/Symbols/MissingMetadataTypeSymbol.cs as a single file (not csproj) from local filesystem.

Message:

Unhandled exception at 0x1DCC1F76 (EditorConfigWrapper.dll) in devenv.exe: Stack cookie instrumentation code detected a stack-based buffer overrun.

Stack:

>	EditorConfigWrapper.dll!1dcc1f76()	Unknown
 	mscorlib.ni.dll!57d60156()	Unknown
 	[Frames below may be incorrect and/or missing, native debugger attempting to walk managed call stack]	
 	mscorlib.ni.dll!57d60156()	Unknown
 	mscorlib.ni.dll!57d60156()	Unknown
 	mscorlib.ni.dll!57d6010f()	Unknown
 	mscorlib.ni.dll!57d6000a()	Unknown
 	EditorConfigWrapper.dll!1dcc4c0e()	Unknown
 	EditorConfigWrapper.dll!1dcc49ce()	Unknown
 	EditorConfigWrapper.dll!1dcc3f73()	Unknown
 	1dc377d5()	Unknown
 	1dc371f4()	Unknown
 	1dc3484a()	Unknown
 	1dc33f94()	Unknown
 	Microsoft.VisualStudio.Platform.VSEditor.ni.dll!6b0486d3()	Unknown
 	Microsoft.VisualStudio.Platform.VSEditor.ni.dll!6b03fad5()	Unknown
 	Microsoft.VisualStudio.Platform.VSEditor.ni.dll!6b04825d()	Unknown
 	Microsoft.VisualStudio.Platform.VSEditor.ni.dll!6b0414cb()	Unknown
 	Microsoft.VisualStudio.Platform.VSEditor.ni.dll!6b040ec8()	Unknown
 	Microsoft.VisualStudio.LanguageServices.ni.dll!11db2339()	Unknown
 	Microsoft.VisualStudio.LanguageServices.ni.dll!11d9acf0()	Unknown
 	Microsoft.VisualStudio.Shell.Interop.ni.dll!5dbddbae()	Unknown
 	clr.dll!5e8cee9c()	Unknown
 	clr.dll!5e9c4028()	Unknown
 	02a2d060()	Unknown
 	06643fac()	Unknown
 	0053611c()	Unknown

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.