Jump to content

VS does not respect my settings

TheBean

Im using VS Enterprise 2019 and this is really bothering me. No matter what I do, VS does not use tabs for indentation and keeps using 2 spaces. I cant even get it to change to 4 spaces. ive tried everything but nothing works. Is there an extension or something I can do to force this to happen?

 

I dont like 2 spaces at all.. wayy too cramped

Link to comment
Share on other sites

Link to post
Share on other sites

Tools->Options->Text Editor->All Languages->Tabs
 

It's in VS 2019 for me.  Although maybe the specific language you're using is overriting the All Languages setting.

Or if you're working on legacy code Intellisense could see that it has spaces for indentation and it's overwriting all the tab/space program settings. 

Workstation:  14700nonk || Asus Z790 ProArt Creator || MSI Gaming Trio 4090 Shunt || Crucial Pro Overclocking 32GB @ 5600 || Corsair AX1600i@240V || whole-house loop.

LANRig/GuestGamingBox: 9900nonK || Gigabyte Z390 Master || ASUS TUF 3090 650W shunt || Corsair SF600 || CPU+GPU watercooled 280 rad pull only || whole-house loop.

Server Router (Untangle): 13600k @ Stock || ASRock Z690 ITX || All 10Gbe || 2x8GB 3200 || PicoPSU 150W 24pin + AX1200i on CPU|| whole-house loop

Server Compute/Storage: 10850K @ 5.1Ghz || Gigabyte Z490 Ultra || EVGA FTW3 3090 1000W || LSI 9280i-24 port || 4TB Samsung 860 Evo, 5x10TB Seagate Enterprise Raid 6, 4x8TB Seagate Archive Backup ||  whole-house loop.

Laptop: HP Elitebook 840 G8 (Intel 1185G7) + 3080Ti Thunderbolt Dock, Razer Blade Stealth 13" 2017 (Intel 8550U)

Link to comment
Share on other sites

Link to post
Share on other sites

2 hours ago, AnonymousGuy said:

Tools->Options->Text Editor->All Languages->Tabs
 

It's in VS 2019 for me.  Although maybe the specific language you're using is overriting the All Languages setting.

Or if you're working on legacy code Intellisense could see that it has spaces for indentation and it's overwriting all the tab/space program settings. 

image.png.e22e60bdaf0323be91560c162da2d9fc.png

image.png.27a4cac6ed1fa8086a2faa7f4cf5c6b8.png

 

 

Ive done this for both already but it still wont work. 

Link to comment
Share on other sites

Link to post
Share on other sites

how do I stop intellisense from changing it? idk even know what that is

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, TheBean said:

how do I stop intellisense from changing it? idk even know what that is

 go to Text Editor > Advanced and turn off "Use adaptive formatting". It was overwriting my preferences based off of the already-existing formatting of a given file

 

(from stackexchange)  You probably want to do a find replace all of ^(\s\s) regex to \t .  I dunno if that's actually correct but play around with it.

 

VS basically tries to be smart all the time and work with the code you already have.   Intellisense I think is their branding of autocomplete and real time syntax checking and whatnot.  Looks like "adaptive formatting" is what I was thinking they were probably doing is actually called.

Workstation:  14700nonk || Asus Z790 ProArt Creator || MSI Gaming Trio 4090 Shunt || Crucial Pro Overclocking 32GB @ 5600 || Corsair AX1600i@240V || whole-house loop.

LANRig/GuestGamingBox: 9900nonK || Gigabyte Z390 Master || ASUS TUF 3090 650W shunt || Corsair SF600 || CPU+GPU watercooled 280 rad pull only || whole-house loop.

Server Router (Untangle): 13600k @ Stock || ASRock Z690 ITX || All 10Gbe || 2x8GB 3200 || PicoPSU 150W 24pin + AX1200i on CPU|| whole-house loop

Server Compute/Storage: 10850K @ 5.1Ghz || Gigabyte Z490 Ultra || EVGA FTW3 3090 1000W || LSI 9280i-24 port || 4TB Samsung 860 Evo, 5x10TB Seagate Enterprise Raid 6, 4x8TB Seagate Archive Backup ||  whole-house loop.

Laptop: HP Elitebook 840 G8 (Intel 1185G7) + 3080Ti Thunderbolt Dock, Razer Blade Stealth 13" 2017 (Intel 8550U)

Link to comment
Share on other sites

Link to post
Share on other sites

13 hours ago, AnonymousGuy said:

 go to Text Editor > Advanced and turn off "Use adaptive formatting". It was overwriting my preferences based off of the already-existing formatting of a given file

 

(from stackexchange)  You probably want to do a find replace all of ^(\s\s) regex to \t .  I dunno if that's actually correct but play around with it.

 

VS basically tries to be smart all the time and work with the code you already have.   Intellisense I think is their branding of autocomplete and real time syntax checking and whatnot.  Looks like "adaptive formatting" is what I was thinking they were probably doing is actually called.

adaptive formatting has always been turned off. 

I used regex to change that and it worked for a sec. but then when I press Ctrl+K, Ctrl+D (format all code), then it reverts back to 2 spaces. 

Link to comment
Share on other sites

Link to post
Share on other sites

Do you have a .editorconfig file anywhere in the repo? I don't know about VS specifically, but many editors will prefer the settings from .editorconfig over your settings because they are specific to that repo.

HTTP/2 203

Link to comment
Share on other sites

Link to post
Share on other sites

On 9/4/2021 at 11:31 AM, colonel_mortis said:

Do you have a .editorconfig file anywhere in the repo? I don't know about VS specifically, but many editors will prefer the settings from .editorconfig over your settings because they are specific to that repo.

do i have to do this for every project? idk how to use this kinda file or what to put it. 

Link to comment
Share on other sites

Link to post
Share on other sites

12 hours ago, TheBean said:

do i have to do this for every project? idk how to use this kinda file or what to put it. 

You could use it to override it, but I intended this as something you should check to make sure it isn't the cause of your problems - if there is an editorconfig file, it would explain why your settings are being ignored. If there isn't, and you wanted to use it to try and force settings, then yes you would need to put it for each project, and it's documented in https://editorconfig.org/.

HTTP/2 203

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×