Skip to content

C++ outline panel does not correctly parse classes/structs with preprocessor macros between class keyword and the class name #44596

@Be-ing

Description

@Be-ing

Reproduction steps

  1. git clone https://webrtc.googlesource.com/src (this is a large repository and may take a minute to clone)
  2. Open repository in Zed
  3. Open file api/audio/audio_processing.h. This file has code like:
class RTC_EXPORT AudioProcessing : public RefCountInterface {
  public:
    // ... class API is here
}

This is a common pattern to control symbol visibility in C++ libraries.
5. Open outline panel

Current vs. Expected behavior

The outline panel interprets the RTC_EXPORT preprocessor macro as the name of the class and fails to parse any of the class functions or members:
Image

If the macro is replaced with what the preprocessor expands it to, the outline panel parses the class correctly:
Image

Zed version and system specs

Zed: v0.217.0+dev.71ca6c4d47e3815f07fbc6d4c7557a36a4f9f1ae (Zed Dev 71ca6c4)
OS: Linux Wayland fedora 43
Memory: 15.4 GiB
Architecture: x86_64
GPU: Intel(R) UHD Graphics 620 (KBL GT2) || Intel open-source Mesa driver || Mesa 25.2.7

Attach Zed log file

Zed.log

2025-11-03T14:15:22-06:00 INFO  [zed] ========== starting zed version 0.212.0, sha f51114c ==========
2025-11-03T14:16:39-06:00 INFO  [zed] ========== starting zed version 0.212.0, sha f51114c ==========
2025-11-03T14:16:46-06:00 INFO  [zed] Using git binary path: None
2025-11-03T14:16:46-06:00 WARN  [zed::reliability] Minidump endpoint not set
2025-11-03T14:16:46-06:00 INFO  [extension_host] extensions updated. loading 4, reloading 0, unloading 0
2025-11-03T14:16:47-06:00 INFO  [util] set environment variables from shell:/usr/bin/fish, path:/home/be/.config/netlify/helper/bin:/home/be/sw/depot_tools:/home/be/local/libexec:/home/be/.cargo/bin:/home/be/.npm_global/bin:/home/be/local/bin:/home/be/.local/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin
2025-11-03T14:16:47-06:00 WARN  [audio::audio_settings] Denoise does not work on debug builds, not enabling
2025-11-03T14:16:47-06:00 WARN  [audio::audio_settings] Denoise does not work on debug builds, not enabling
2025-11-03T14:16:47-06:00 INFO  [gpui::platform::linux::platform] activate is not implemented on Linux, ignoring the call
2025-11-03T14:16:49-06:00 INFO  [client] set status on client 0: Authenticating
2025-11-03T14:16:49-06:00 INFO  [workspace::persistence] Got 1 breakpoints from database at path: /home/be/sw/zed/crates/livekit_client/src/livekit_client/playback.rs
2025-11-03T14:16:49-06:00 INFO  [gpui::platform::blade::blade_renderer] Initializing Blade pipelines for surface SurfaceInfo { format: Bgra8Unorm, alpha: PreMultiplied }
2025-11-03T14:16:49-06:00 INFO  [workspace] Rendered first frame
2025-11-03T14:16:49-06:00 INFO  [zed::zed] Using GPU: GpuSpecs { is_software_emulated: false, device_name: "Intel(R) UHD Graphics 620 (KBL GT2)", driver_name: "Intel open-source Mesa driver", driver_info: "Mesa 25.2.5" }
2025-11-03T14:16:51-06:00 INFO  [client] set status on client 467069: Authenticated
2025-11-03T14:16:51-06:00 WARN  [task::vscode_format] Skipping deserializing of a task `build` with the unsupported `dependsOn` key
2025-11-03T14:16:54-06:00 INFO  [languages::rust] found rust-analyzer in PATH. trying to run `rust-analyzer --help`
2025-11-03T14:16:55-06:00 INFO  [language] found user-installed language server for rust-analyzer. path: "/home/be/.cargo/bin/rust-analyzer", arguments: []
2025-11-03T14:16:55-06:00 INFO  [lsp] starting language server process. binary path: "/home/be/.cargo/bin/rust-analyzer", working directory: "/home/be/sw/zed", args: []
2025-11-03T14:17:10-06:00 INFO  [zed] Using git binary path: None
2025-11-03T14:17:11-06:00 WARN  [zed::reliability] Minidump endpoint not set
2025-11-03T14:17:11-06:00 INFO  [extension_host] extensions updated. loading 4, reloading 0, unloading 0
2025-11-03T14:17:11-06:00 INFO  [client] set status on client 467069: Reauthenticating
2025-11-03T14:17:11-06:00 ERROR [channel::channel_store] not connected
2025-11-03T14:17:11-06:00 INFO  [client] set status on client 467069: Reauthenticated
2025-11-03T14:17:11-06:00 INFO  [client] set status on client 467069: Connecting
2025-11-03T14:17:11-06:00 INFO  [util] set environment variables from shell:/usr/bin/fish, path:/home/be/.config/netlify/helper/bin:/home/be/sw/depot_tools:/home/be/local/libexec:/home/be/.cargo/bin:/home/be/.npm_global/bin:/home/be/local/bin:/home/be/.local/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin
2025-11-03T14:17:11-06:00 INFO  [client] connected to rpc endpoint https://collab.zed.dev/rpc
2025-11-03T14:17:11-06:00 WARN  [audio::audio_settings] Denoise does not work on debug builds, not enabling
2025-11-03T14:17:11-06:00 WARN  [audio::audio_settings] Denoise does not work on debug builds, not enabling
2025-11-03T14:17:11-06:00 INFO  [gpui::platform::linux::platform] activate is not implemented on Linux, ignoring the call
2025-11-03T14:17:12-06:00 INFO  [client] set status on client 467069: Connected { peer_id: PeerId { owner_id: 901, id: 103487 }, connection_id: ConnectionId { owner_id: 0, id: 0 } }
2025-11-03T14:17:15-06:00 INFO  [client] unhandled message RoomUpdated
2025-11-03T14:17:15-06:00 WARN  [audio] Audio does not sound correct without optimizations. Use a release build to debug audio issues
2025-11-03T14:17:16-06:00 INFO  [client] set status on client 0: Authenticating
2025-11-03T14:17:16-06:00 INFO  [workspace::persistence] Got 1 breakpoints from database at path: /home/be/sw/zed/crates/livekit_client/src/livekit_client/playback.rs
2025-11-03T14:17:16-06:00 INFO  [gpui::platform::blade::blade_renderer] Initializing Blade pipelines for surface SurfaceInfo { format: Bgra8Unorm, alpha: PreMultiplied }
2025-11-03T14:17:17-06:00 INFO  [workspace] Rendered first frame
2025-11-03T14:17:17-06:00 INFO  [zed::zed] Using GPU: GpuSpecs { is_software_emulated: false, device_name: "Intel(R) UHD Graphics 620 (KBL GT2)", driver_name: "Intel open-source Mesa driver", driver_info: "Mesa 25.2.5" }
2025-11-03T14:17:21-06:00 INFO  [client] set status on client 467069: Authenticated
2025-11-03T14:17:21-06:00 WARN  [task::vscode_format] Skipping deserializing of a task `build` with the unsupported `dependsOn` key
2025-11-03T14:17:30-06:00 INFO  [languages::rust] found rust-analyzer in PATH. trying to run `rust-analyzer --help`
2025-11-03T14:17:33-06:00 INFO  [languages::rust] found rust-analyzer in PATH. trying to run `rust-analyzer --help`
2025-11-03T14:17:35-06:00 INFO  [language] found user-installed language server for rust-analyzer. path: "/home/be/.cargo/bin/rust-analyzer", arguments: []
2025-11-03T14:17:35-06:00 INFO  [lsp] starting language server process. binary path: "/home/be/.cargo/bin/rust-analyzer", working directory: "/home/be/sw/zed", args: []
2025-11-03T14:17:36-06:00 INFO  [audio] Output stream: OutputStream { config: OutputStreamConfig { channel_count: 2, sample_rate: 44100, buffer_size: Default, sample_format: F32 }, .. }
2025-11-03T14:17:39-06:00 WARN  [audio] Audio does not sound correct without optimizations. Use a release build to debug audio issues
2025-11-03T14:17:39-06:00 WARN  [audio] Audio does not sound correct without optimizations. Use a release build to debug audio issues
2025-11-03T14:17:39-06:00 INFO  [livekit_api::signal_client::signal_stream] connecting to wss://zed.livekit.cloud/rtc?sdk=rust&protocol=16&auto_subscribe=1&adaptive_stream=0&version=0.7.21
2025-11-03T14:17:40-06:00 INFO  [gpui::platform::blade::blade_renderer] Initializing Blade pipelines for surface SurfaceInfo { format: Bgra8Unorm, alpha: PreMultiplied }
2025-11-03T14:17:40-06:00 INFO  [zed::zed] Using GPU: GpuSpecs { is_software_emulated: false, device_name: "Intel(R) UHD Graphics 620 (KBL GT2)", driver_name: "Intel open-source Mesa driver", driver_info: "Mesa 25.2.5" }
2025-11-03T14:17:40-06:00 INFO  [gpui::platform::linux::platform] activate is not implemented on Linux, ignoring the call
2025-11-03T14:19:03-06:00 ERROR [gpui::window] window not found
2025-11-03T14:19:03-06:00 ERROR [gpui::window] window not found
2025-11-03T14:19:03-06:00 ERROR [gpui::window] window not found
2025-11-03T14:19:03-06:00 ERROR [gpui::window] window not found
2025-11-03T14:19:03-06:00 ERROR [gpui::window] window not found
2025-11-03T14:19:03-06:00 ERROR [gpui::window] window not found
2025-11-03T14:19:03-06:00 ERROR [gpui::window] window not found
2025-11-03T14:19:03-06:00 ERROR [gpui::window] window not found
2025-11-03T14:19:03-06:00 ERROR [gpui::window] window not found
2025-11-03T14:19:03-06:00 ERROR [gpui::window] window not found
2025-11-03T14:19:03-06:00 ERROR [gpui::window] window not found
2025-11-03T14:19:03-06:00 ERROR [gpui::window] window not found
2025-11-03T14:19:03-06:00 ERROR [gpui::window] window not found
2025-11-03T14:19:03-06:00 ERROR [gpui::window] window not found
2025-11-03T14:19:03-06:00 ERROR [gpui::window] window not found
2025-11-03T14:19:03-06:00 ERROR [gpui::window] window not found
2025-11-03T14:19:03-06:00 ERROR [gpui::window] window not found
2025-11-03T14:19:03-06:00 ERROR [gpui::window] window not found
2025-11-03T14:19:03-06:00 ERROR [gpui::window] window not found
2025-11-03T14:19:03-06:00 ERROR [gpui::window] window not found
2025-11-03T14:19:03-06:00 ERROR [gpui::window] window not found
2025-11-03T14:19:03-06:00 ERROR [gpui::window] window not found
2025-11-03T14:19:03-06:00 ERROR [gpui::window] window not found
2025-11-03T14:19:06-06:00 ERROR [client::telemetry] task 42 was cancelled


</details>


### Relevant Zed settings

<details><summary>settings.json</summary>

<!-- Paste your settings inside the code block. -->
```json

(for AI issues) Model provider details

No response

If you are using WSL on Windows, what flavor of Linux are you using?

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:languages/c++C++ programming language supportarea:outlineFeedback for outline view, symbols, etccommunity championIssues filed by our amazing community champions! 🫶frequency:commonBugs that happen for at least a third of the users across all platforms and kinds of usagepriority:P2Average run-of-the-mill bugs

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions