Skip to content

symbols in outline view are not synced when they are changed in editor #13967

@lijh8

Description

@lijh8

Environment

ms-vscode.cpptools: 1.27.7
VSCode: 1.104.2 (Universal)
macOS: 12.7.6 (21H1320)
Debian 13.1: forky/sid (through ms-vscode-remote.remote-ssh)

The function name is changed to foobar in editor, while it is still bar in outline view.
Even after the file is changed and saved.
The outline view refresh only happens until a next change, like reformat caused by extra spaces, etc. with formatOnSave.

llvm-vs-code-extensions.vscode-clangd does not have this problem.

Image

Bug Summary and Steps to Reproduce

As provided

Configuration and Logs

c_cpp_properties.json:

{
  // ms-vscode.cpptools
  // https://code.visualstudio.com/docs/cpp/customize-cpp-settings
  "configurations": [
    {
      "name": "Linux",
      "compilerPath": "/usr/bin/gcc",
      "intelliSenseMode": "linux-gcc-x64",
      "includePath": [
        "${workspaceFolder}/**",
        "${workspaceFolder}/src/foo",
        "/home/ljh/Downloads/ng-log-0.8.2/src",
        "/home/ljh/Downloads/ng-log-0.8.2/build",
      ],
      "cStandard": "c17",
      "cppStandard": "c++20",
    }
  ],
  "version": 4,
}

Logs:

LSP: (received) textDocument/didChange: file:///Users/ljh/Documents/tmp/main.cpp
LSP: (invoked) textDocument/didChange: file:///Users/ljh/Documents/tmp/main.cpp
LSP: (received) cpptools/didChangeTextEditorSelection
LSP: (invoked) cpptools/didChangeTextEditorSelection
LSP: (received) textDocument/didChange: file:///Users/ljh/Documents/tmp/main.cpp
LSP: (invoked) textDocument/didChange: file:///Users/ljh/Documents/tmp/main.cpp
LSP: (received) cpptools/didChangeTextEditorSelection
LSP: (invoked) cpptools/didChangeTextEditorSelection
LSP: (received) textDocument/didChange: file:///Users/ljh/Documents/tmp/main.cpp
LSP: (received) cpptools/didChangeTextEditorSelection
LSP: (invoked) textDocument/didChange: file:///Users/ljh/Documents/tmp/main.cpp
LSP: (invoked) cpptools/didChangeTextEditorSelection
LSP: (received) cpptools/getDocumentSymbols: file:///Users/ljh/Documents/tmp/main.cpp (id: 77)
LSP: (invoked) cpptools/getDocumentSymbols: file:///Users/ljh/Documents/tmp/main.cpp (id: 77)
tag parsing file: /Users/ljh/Documents/tmp/main.cpp
LSP: Sending response (id: 77)
Intellisense update pending for: file:///Users/ljh/Documents/tmp/main.cpp
IntelliSense update scheduled and TU acquisition started for: file:///Users/ljh/Documents/tmp/main.cpp
Update IntelliSense time (sec): 0.015
LSP: (received) textDocument/willSaveWaitUntil: file:///Users/ljh/Documents/tmp/main.cpp (id: 78)
LSP: (invoked) textDocument/willSaveWaitUntil: file:///Users/ljh/Documents/tmp/main.cpp (id: 78)
LSP: Sending response (id: 78)
willSaveWaitUntil: 0ms
LSP: (received) cpptools/formatDocument: file:///Users/ljh/Documents/tmp/main.cpp (id: 79)
LSP: (invoked) cpptools/formatDocument: file:///Users/ljh/Documents/tmp/main.cpp (id: 79)
Formatting document: file:///Users/ljh/Documents/tmp/main.cpp
Formatting Engine: clangFormat
/Users/ljh/.vscode/extensions/ms-vscode.cpptools-1.27.7-darwin-x64/bin/../LLVM/bin/clang-format '--style={ BasedOnStyle: LLVM, UseTab: Never, IndentWidth: 2, TabWidth: 2, BreakBeforeBraces: Allman, AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: false, ColumnLimit: 0, AccessModifierOffset: -2, NamespaceIndentation: All, FixNamespaceComments: false }' --fallback-style=LLVM --sort-includes=0 --Wno-error=unknown --assume-filename=/Users/ljh/Documents/tmp/main.cpp
LSP: Sending response (id: 79)
LSP: (received) textDocument/didSave: file:///Users/ljh/Documents/tmp/main.cpp
LSP: (invoked) textDocument/didSave: file:///Users/ljh/Documents/tmp/main.cpp
Intellisense update pending for: file:///Users/ljh/Documents/tmp/main.cpp
tag parsing file: /Users/ljh/Documents/tmp/main.cpp
LSP: (received) cpptools/fileChanged: file:///Users/ljh/Documents/tmp/main.cpp
LSP: (invoked) cpptools/fileChanged: file:///Users/ljh/Documents/tmp/main.cpp
IntelliSense update scheduled and TU acquisition started for: file:///Users/ljh/Documents/tmp/main.cpp
Update IntelliSense time (sec): 1.02
Database safe to open.

Metadata

Metadata

Assignees

Labels

Feature: Document SymbolOutline view and breadcrumbsLanguage ServiceWorks in VSSo we'd need to fix it for VS Code to reach parity.bugfixedCheck the Milestone for the release in which the fix is or will be available.quick fixregressionA bug that didn't exist in a previous release

Type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions