Skip to content

Autodetect indentSize cannot detect tabs for a TSV file #132991

@kriswuollett

Description

@kriswuollett

Issue Type: Bug

A file containing tabs instead of spaces, especially one with a .tsv file extension should automatically be detected to be indented using tabs when editor.detectIndentation is set to true.

Steps to Reproduce:

  • Include in Settings: "editor.detectIndentation": true
  • Create a file named something like packages.tsv
  • Press the Spaces: 4 button at the bottom and select Indent Using Tabs, tab size 4
  • Add content to the file and save like the following:
_	10	nodejs	16.7.0
_	10	awscli	2.2.32
_	10	terraform	1.0.5
_	10	golang	1.17.1
apt	10	vim	_
  • Close the file and reopen it, the mode used is Spaces: 4 when it should have been detected as Tab Size: 4
  • Detect Indentation from Content also does not change the mode to tabs (I assume this is the same issue)

VS Code version: Code 1.60.0 (e7d7e9a, 2021-09-01T10:54:53.442Z)
OS version: Darwin x64 20.6.0
Restricted Mode: No
Remote OS version: Linux x64 5.10.47-linuxkit

System Info
Item Value
CPUs Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz (16 x 2300)
GPU Status 2d_canvas: enabled
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
webgl: enabled
webgl2: enabled
Load (avg) 2, 2, 2
Memory (System) 64.00GB (0.03GB free)
Process Argv --crash-reporter-id 8067519b-e432-4f58-bfd4-020219e81bca
Screen Reader no
VM 0%
Item Value
Remote Dev Container: kriswuollett
OS Linux x64 5.10.47-linuxkit
CPUs Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz (8 x 2300)
Memory (System) 15.64GB (1.58GB free)
VM 0%
Extensions (14)
Extension Author (truncated) Version
postcss css 1.0.9
mustache daw 1.1.1
flatbuffers gab 0.1.0
jq-syntax-highlighting jq- 0.0.2
python ms- 2021.9.1218897484
vscode-pylance ms- 2021.9.1
jupyter-keymap ms- 1.0.0
remote-containers ms- 0.194.0
remote-ssh ms- 0.65.7
remote-ssh-edit ms- 0.65.7
vscode-pbtxt the 0.0.3
aws-toolkit-vscode ama 1.29.0
terraform has 2.14.0
vscode-docker ms- 1.16.1
A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383:30185418
pythonvspyt700cf:30270857
pythonvspyt602:30300191
vspor879:30202332
vspor708:30202333
vspor363:30204092
vstes627:30244334
pythonvspyt639:30300192
pythontb:30283811
pythonvspyt551:30345470
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
vscoreces:30358480
pythondataviewer:30285071
pythonvsuse255:30340121
vscod805:30301674
pythonvspyt200:30340761
vscextlang:30333561
binariesv615:30325510
vsccppwt:30364497
pythonvssor306:30344512
bridge0708:30335490
pygetstartedt2:30360495
bridge0723:30353136
pythonrunftest32:30365366
pythonf5test824:30361777
javagetstartedt:30364666
pythonvspyt187cf:30365362
pydsgsc2:30361791
vscus224:30358039
vssid140:30363603
vssur157:30365996

Metadata

Metadata

Assignees

Labels

*out-of-scopePosted issue is not in scope of VS Codeeditor-indent-detectionIssues around the guessing of indentation for files

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions