Skip to content

Inconsistent comment toggle in in .ini / .properties depending on which file is opened first #298730

@alexchexes

Description

@alexchexes

Does this issue occur when all extensions are disabled?: Yes

Version: 1.108.2 (user setup)
Commit: c9d7799
Date: 2026-01-21T13:52:09.270Z
Electron: 39.2.7
ElectronBuildId: 12953945
Chromium: 142.0.7444.235
Node.js: 22.21.1
V8: 14.2.231.21-electron.0
OS: Windows_NT x64 10.0.26100

Please reopen #116729 and/or #151655. The issue is real and reproducible. Below are a screencast and exact steps.

To Reproduce

Create two files in the same workspace: one .ini and one .properties. The contents can be anything, for example:

foo
bar

Part 1

  1. Close all files and restart VS Code.
  2. Open the .properties file first.
  3. Toggle line comment. See that VS Code uses # in the .properties file.
  4. Open the .ini file.
  5. Toggle line comment. See that VS Code also uses # in the .ini file.

Part 2

  1. Close all files and restart VS Code.
  2. Open the .ini file first.
  3. Toggle line comment. See that VS Code uses ; in the .ini file.
  4. Open the .properties file.
  5. Toggle line comment. See that VS Code also uses ; in the .properties file.

For the same two files, the comment character used by Toggle Line Comment depends on which file type was opened first.

Screencast

explorer_2026-03-02--15-41-48--715.mp4

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bugeditor-coreEditor basic functionality

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions