microsoft / microsoft/vscode-cpptools

Format Document doesn't work with Untitled c/cpp files

Open
#4,143 8 comments 9 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Feature Request Feature: Code Formatting Language Service
Dominant language
TypeScript
Stars
6.2k
Forks
1.7k
Avg merge
14h 46m
Merged PRs (30d)
61

Description

@bobbrow Issue still exist with documents that was not saved on disk. Version 0.25.0. Steps to reproduce (via command palette):

  1. New Untitled File
  2. Change Language Mode -> C
  3. Format Document

But if you save that document, problem will gone.

Originally posted by @lorond in https://github.com/microsoft/vscode-cpptools/issues/1232#issuecomment-524623481

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue through the command palette with a new untitled file set to C, then compare the Format Document behavior before and after saving the file. Trace the formatting path for unsaved C/C++ documents and verify that formatting works without saving while preserving the existing saved-file behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, cpp
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.