Skip to content

languages: Add first-line C++ language detection for extensionless libcpp headers#47443

Merged
osiewicz merged 2 commits intozed-industries:mainfrom
ozacod:feat/cpp-firstline-pattern
Jan 28, 2026
Merged

languages: Add first-line C++ language detection for extensionless libcpp headers#47443
osiewicz merged 2 commits intozed-industries:mainfrom
ozacod:feat/cpp-firstline-pattern

Conversation

@ozacod
Copy link
Copy Markdown
Contributor

@ozacod ozacod commented Jan 23, 2026

Several libcpp headers lack file extensions. Added a first line pattern for recognition.

https://github.com/llvm/llvm-project/blob/main/libcxx/include/random)](https://github.com/llvm/llvm-project/blob/main/libcxx/include/random

Before:
before

After:
after

Release Notes:

  • Added first-line C++ language detection for extensionless libcpp headers.

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Jan 23, 2026
@ozacod ozacod force-pushed the feat/cpp-firstline-pattern branch from 08062d2 to 3309318 Compare January 23, 2026 04:56
@maxdeviant maxdeviant changed the title languages: Add first-line C++ language detection for extensionless libcpp headers. languages: Add first-line C++ language detection for extensionless libcpp headers Jan 23, 2026
@ozacod ozacod force-pushed the feat/cpp-firstline-pattern branch from 3309318 to d1ad3c1 Compare January 23, 2026 15:33
@osiewicz
Copy link
Copy Markdown
Member

It seems that there's a conflict with main at the moment.

@ozacod ozacod force-pushed the feat/cpp-firstline-pattern branch from d1ad3c1 to 3996c32 Compare January 23, 2026 15:39
# Conflicts:
#	crates/languages/src/cpp/config.toml

# Conflicts:
#	crates/languages/src/cpp/config.toml
@ozacod ozacod force-pushed the feat/cpp-firstline-pattern branch from 3996c32 to 370c687 Compare January 23, 2026 15:47
@ozacod
Copy link
Copy Markdown
Contributor Author

ozacod commented Jan 23, 2026

Resolved, ready for review. Thank you,

@osiewicz osiewicz enabled auto-merge (squash) January 28, 2026 10:23
@osiewicz osiewicz merged commit 9249532 into zed-industries:main Jan 28, 2026
27 checks passed
@hly1204
Copy link
Copy Markdown

hly1204 commented Feb 2, 2026

Thanks a lot! Is it possible to be modified to detect libstdc++ headers also? For example, the first line of <random> is // <random> -*- C++ -*- in libstdc++.

@ozacod
Copy link
Copy Markdown
Contributor Author

ozacod commented Feb 2, 2026

@hly1204 it is exactly same pattern so it should be working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants