Editorconfig In Visual Studio In 10 Minutes or Less

  Рет қаралды 31,694

IAmTimCorey

IAmTimCorey

Күн бұрын

Пікірлер: 49
@ferrarijuan
@ferrarijuan 2 жыл бұрын
What great timing again Tim. We just today discussed this topic and how we are going to go about enforcing common coding styles. This is going to help a lot. Thanks for the video.
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
Great!
@Tsunami14
@Tsunami14 2 жыл бұрын
I remember a previous video of yours which showed how to set coding styles at a per-user level, and my immediate question was if this can be set per project/solution and checked into source control. Glad to see this has been addressed.
@tomthelestaff-iamtimcorey7597
@tomthelestaff-iamtimcorey7597 2 жыл бұрын
Thanks for being a consistent and faithful follower of Tim content!
@NiquelBones
@NiquelBones Жыл бұрын
For anyone having issues creating the editorconfig file, it's actually not rendering in the solution explorer, you'll have to open the solution in the regular windows explorer and drag the created file to the IDE to open it, if you're having more issues there is a video called "EditorConfig file doesn't work in Visual Studio 2022? Here is a workaround" that gives a good explanation and solution.
@IAmTimCorey
@IAmTimCorey Жыл бұрын
Thanks for sharing.
@EricKing
@EricKing 2 жыл бұрын
Those Visual Studio bugs are embarrassing. Thanks for the video.
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
You are welcome.
@YousefSh
@YousefSh 2 жыл бұрын
I do wish you ran code cleanup so we can see it in action. But this video helped me understand editorconfig a lot!
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
Glad it helped!
@alekseev74
@alekseev74 2 жыл бұрын
Nice feature. Will use it in my new project.
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
Great!
@biscuitbakerful
@biscuitbakerful 2 жыл бұрын
Tim, I had to add an additional step to get VS to use file scoped namespaces. I had to update my project properties to use C# version 10. example: net6.0 10
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
Are you using VS2019? You shouldn’t need to do that. Glad you got it to work, though.
@biscuitbakerful
@biscuitbakerful 2 жыл бұрын
@@IAmTimCorey I am using VS2022, but we are using .Net 5 at work.
@MrBan001
@MrBan001 Жыл бұрын
can I create a .editorconfig that has all values of the default settings from visual studio inside it? Because all the settings which are Visual Studio Settings and not read from the .editorconfig could still be different per developer
@almightyknight127
@almightyknight127 2 жыл бұрын
Thanks man,this is exactly what I was looking for
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
You are welcome.
@edburdo
@edburdo 2 жыл бұрын
Hi Tim. Great video. I have a question... when I add the EditorConfig to my solution (VS2019) - It's all text. I don't have the nice UI that you do. Just the text. Is that a plugin, or difference in project types?
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
I think that’s the problem. I’m using VS2022. If this isn’t for work, VS2022 Community Edition is free and you can install it side by side with VS2019.
@sandroco
@sandroco 2 жыл бұрын
Very informative, thx :) But in my case the Code Style settings have no effect. If I set "Prefer Braces", "Yes" and "Error", no error is shown when I create a if(x) y = x statement. Even if I restart VS (VS Community 2022) nothing happens. I have added the configfile to the solution. Why's that?
@unnamedsandwich
@unnamedsandwich Жыл бұрын
Hi previously when I open .editorconfig, it opens with code and not this interface. How do I revert it to that?
@milestonetrucks9588
@milestonetrucks9588 2 жыл бұрын
I do not get a choice of new editor config. I get New Item , or installation config I'm using Visual Studios 2022 running 6.0 ? any help
@christianista
@christianista Жыл бұрын
It's not possible to import this file as default for all projects ?
@IAmTimCorey
@IAmTimCorey Жыл бұрын
No, not really. This file is meant to be shared with your team, so even if you set up your Visual Studio to use these defaults, it would not work with your team.
@thelebanesehunter
@thelebanesehunter Жыл бұрын
I'm trying to add editConfig as you did, also using another way by clicking on the project tab > add new item > search for editorConfig and click on the default one, or the .NET one, but still don't see anything added on my solution explorer, any idea?
@michael-tsai
@michael-tsai Жыл бұрын
Hi, I think it's a bit late for this. If the issue still exists, I just record a video showing a workaround. You can find that video from my KZbin channel.
@sumanthdsharma
@sumanthdsharma 2 жыл бұрын
I created editor configuration file in visual studio 2022 but it never throws any error if do just what you did. Block and other thing it didn't complain of anything.
@andreibicu5592
@andreibicu5592 2 жыл бұрын
Neither on my side. I wonder why use this instead of other external analyzers ?!
@matejlaskomulej
@matejlaskomulej 7 ай бұрын
It doesn't really work well. ``` root = true [*] end_of_line = lf insert_final_newline = true charset = utf-8 indent_style = space indent_size = 4 trim_trailing_whitespace = true ``` This for example removes trailing whitespace in *.cs files, but not in *.md. `Ctrl+K,Ctrl+D` doesn't work in markdown at all, and I cannot find the fix with google or chatgpt for the life of me.
@syltis1994
@syltis1994 Жыл бұрын
Anyone has any experience with VS not doing anything when you select the option to add a EditorConfig file? I have to add it manually, and even then VS does not display it in the Solution Explorer. VS 2022.
@IAmTimCorey
@IAmTimCorey Жыл бұрын
It is quirky sometimes, for sure.
@richiehatch6719
@richiehatch6719 2 жыл бұрын
I don't have the option to add a new editor config when right-clicking. Does anyone know how to address this? Edit: I am using VS 2022, and the menu item does not show up even in brand new projects. I do have the intellicode module installed. Second Edit: For anyone else having issues, as of now, download and install the preview version of 2022.
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
It sounds like you might have needed an update or a feature added. I'm using Visual Studio 2022 Community Edition (not the preview edition) and it works.
@richiehatch6719
@richiehatch6719 2 жыл бұрын
@@IAmTimCorey That's crazy, not sure what I need to add then because I can add the new editor config but I still don't have the good looking UI. I appreciate the response! Let's me know that something still isn't correct.
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
OK, further update: mine just disappeared with the latest update in VS2022 (non-preview). It is still in the preview version. It must be a glitch. You can still right-click and add new item and add the .NET editorconfig.
@richiehatch6719
@richiehatch6719 2 жыл бұрын
@@IAmTimCorey Ah! I appreciate the update. I spent far too long trying to figure out why it wasn't working.
@richardzhang8028
@richardzhang8028 2 жыл бұрын
Right click .editorconfig file, then "Open With ...", then choose resource file, you will get an error. Then you are good.
@TCFdemonblade
@TCFdemonblade 2 жыл бұрын
Nice feature, but it is not working properly. If you init a git repo, the editorconfig won't save anymore. The only way to use it with git is to generate the file again by using the button from VS Setting.
@tomthelestaff-iamtimcorey7597
@tomthelestaff-iamtimcorey7597 2 жыл бұрын
Thanks for sharing what you encountered.
@user-rz1hv
@user-rz1hv Жыл бұрын
editorconfig is broken in vs 2022, at least for wpf projects, "Syntax tree is required to accomplish the task but is not supported by document [XAML file name].xaml"
@IAmTimCorey
@IAmTimCorey Жыл бұрын
Interesting. Have you submitted a ticket about it?
@user-rz1hv
@user-rz1hv Жыл бұрын
@@IAmTimCorey not yet
@NeZversSounds
@NeZversSounds 2 жыл бұрын
What a BS, I don't have it on VS 2022 as it is shown in the video nor in the documentation under New Item.
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
If you are on the Windows version of Visual Studio 2022 and have updated, you should have it. If not, submit a support ticket. Also, make sure you are looking in the right spot to add it. It is on the Add menu when clicking on the Solution or Project files. You can also add it manually when adding new files (not new projects).
Intro to Core WCF In 10 Minutes or Less
4:32
IAmTimCorey
Рет қаралды 36 М.
15 Visual Studio Editor Tips including Intellicode and EditorConfig
1:15:01
Wait for it 😂
00:19
ILYA BORZOV
Рет қаралды 7 МЛН
the balloon deflated while it was flying #tiktok
00:19
Анастасия Тарасова
Рет қаралды 34 МЛН
Human vs Jet Engine
00:19
MrBeast
Рет қаралды 162 МЛН
What is .editorconfig - EditorConfig full Guide
17:25
The Codeholic
Рет қаралды 10 М.
10 Time-Saving Tips in Visual Studio 2022 (with Tim Corey)
37:54
Microsoft Visual Studio
Рет қаралды 31 М.
Stop Recommending Clean Code
27:05
ThePrimeTime
Рет қаралды 520 М.
10 C# Libraries To Save You Time And Energy
33:59
IAmTimCorey
Рет қаралды 208 М.
How I would learn Leetcode if I could start over
18:03
NeetCodeIO
Рет қаралды 639 М.
Wait for it 😂
00:19
ILYA BORZOV
Рет қаралды 7 МЛН