Skip to content

build(clangd): add config for IDE include resolution#2164

Merged
alandtse merged 2 commits into
community-shaders:devfrom
alandtse:build/clangd-ide-includes
Apr 20, 2026
Merged

build(clangd): add config for IDE include resolution#2164
alandtse merged 2 commits into
community-shaders:devfrom
alandtse:build/clangd-ide-includes

Conversation

@alandtse
Copy link
Copy Markdown
Collaborator

@alandtse alandtse commented Apr 20, 2026

Summary

  • Adds .clangd config to the repo root so clangd-based IDEs (VS Code, CLion, etc.) resolve includes without spurious warnings
  • Covers the default ALL preset build dir (build/ALL/vcpkg_installed/...), which also covers ALL-WITH-AUTO-DEPLOYMENT since it shares the same binaryDir
  • Sets the three Skyrim edition defines (ENABLE_SKYRIM_AE/SE/VR) so edition-gated code is properly analyzed

Test plan

  • Open a source file in VS Code with clangd — verify no spurious "file not found" include warnings
  • Confirm Tracy-gated code (#ifdef TRACY_ENABLE) is correctly inactive in default analysis

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Added development environment configuration to establish compiler settings and improve code analysis capabilities.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 20, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 88de8316-e915-430d-9083-cca1a4ec7660

📥 Commits

Reviewing files that changed from the base of the PR and between 49eb260 and f2d2dbe.

📒 Files selected for processing (1)
  • .clangd
✅ Files skipped from review due to trivial changes (1)
  • .clangd

📝 Walkthrough

Walkthrough

A .clangd configuration file is added to configure the Clang Language Server with compiler settings, including C++23 standard support, Skyrim-related preprocessor macros, and include paths for CommonLibSSE-NG, vcpkg dependencies, and shader resources.

Changes

Cohort / File(s) Summary
Clangd Configuration
.clangd
Added configuration to enable C++23 mode, define Skyrim version macros (ENABLE_SKYRIM_AE, ENABLE_SKYRIM_SE, ENABLE_SKYRIM_VR), and set include paths for project dependencies and external libraries.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly related PRs

Suggested reviewers

  • doodlum

Poem

🐰 A bunny hops through code so bright,
Clangd config set just right,
C++23 flags now aligned,
Skyrim paths forever defined,
Compilation bliss, oh what a sight!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: adding a .clangd configuration for IDE include resolution, which matches the primary objective of the pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.clangd:
- Line 11: Update the .clangd configuration to use MSVC-compatible Clang driver
by replacing the "Compiler: cl" setting with "Compiler: clang-cl"; locate the
"Compiler: cl" entry in the file and change it to "Compiler: clang-cl" so clangd
invokes the clang-cl compatibility mode for MSVC project analysis.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 48efc9b0-040b-4bb8-802f-c9df29e53ef5

📥 Commits

Reviewing files that changed from the base of the PR and between 24c22be and 5c70cfb.

📒 Files selected for processing (1)
  • .clangd

Comment thread .clangd Outdated
@github-actions
Copy link
Copy Markdown

Actionable Suggestions

  • Skylighting (Alan Tse): Needs version bump to 1-3-0
  • Terrain Blending (Alan Tse): Needs version bump to 1-1-0

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/Feature.h (1)

229-245: Minor: fold duplicated callback(feature) branches.

Both branches invoke callback(feature); the GPU zone can be emitted conditionally in its own sub-scope without duplicating the call. Tracy transient zones end at scope exit, so this preserves semantics while reducing duplication.

♻️ Suggested refactor
-#ifdef TRACY_ENABLE
-				{
-					const auto zoneName = std::format("{}::{}", feature->GetShortName(), methodName);
-					ZoneTransientN(___tracy_feature_zone, zoneName.c_str(), true);
-					if (emitGpuZone) {
-						TracyD3D11ZoneTransientS(s_tracyCtx, ___tracy_d3d11_feature_zone, zoneName.c_str(), 0, s_tracyCtx != nullptr);
-						callback(feature);
-					} else {
-						callback(feature);
-					}
-				}
+#ifdef TRACY_ENABLE
+				{
+					const auto zoneName = std::format("{}::{}", feature->GetShortName(), methodName);
+					ZoneTransientN(___tracy_feature_zone, zoneName.c_str(), true);
+					if (emitGpuZone) {
+						TracyD3D11ZoneTransientS(s_tracyCtx, ___tracy_d3d11_feature_zone, zoneName.c_str(), 0, s_tracyCtx != nullptr);
+					}
+					callback(feature);
+				}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/Feature.h` around lines 229 - 245, The duplicated callback(feature) can
be collapsed by creating the Tracy zone scope only when TRACY_ENABLE is defined
and conditionally emitting the GPU zone inside that scope; specifically, replace
the current dual-branch that calls callback(feature) twice with a single scope
created when TRACY_ENABLE is defined (using ZoneTransientN with zoneName from
feature->GetShortName() and methodName) and then inside that scope, if
emitGpuZone call TracyD3D11ZoneTransientS(s_tracyCtx,
___tracy_d3d11_feature_zone, zoneName.c_str(), 0, s_tracyCtx != nullptr) before
invoking callback(feature); when TRACY_ENABLE is not defined simply call
callback(feature) once. This preserves semantics of scope-based Tracy zones and
removes duplicate callback invocations.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/State.cpp`:
- Around line 693-694: The call to Feature::SetTracyCtx(tracyCtx) must be
compiled only when TRACY_ENABLE is defined because SetTracyCtx is declared
inside that macro; wrap the call (the tracyCtx assignment and the
Feature::SetTracyCtx invocation) in an `#ifdef` TRACY_ENABLE / `#endif` block
(matching the guard used in the destructor) so TracyD3D11Context tracyCtx and
the Feature::SetTracyCtx call are omitted when TRACY_ENABLE is not defined.

---

Nitpick comments:
In `@src/Feature.h`:
- Around line 229-245: The duplicated callback(feature) can be collapsed by
creating the Tracy zone scope only when TRACY_ENABLE is defined and
conditionally emitting the GPU zone inside that scope; specifically, replace the
current dual-branch that calls callback(feature) twice with a single scope
created when TRACY_ENABLE is defined (using ZoneTransientN with zoneName from
feature->GetShortName() and methodName) and then inside that scope, if
emitGpuZone call TracyD3D11ZoneTransientS(s_tracyCtx,
___tracy_d3d11_feature_zone, zoneName.c_str(), 0, s_tracyCtx != nullptr) before
invoking callback(feature); when TRACY_ENABLE is not defined simply call
callback(feature) once. This preserves semantics of scope-based Tracy zones and
removes duplicate callback invocations.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 1d54cebc-5791-4efb-93af-89fc70c56704

📥 Commits

Reviewing files that changed from the base of the PR and between 5c70cfb and 49eb260.

📒 Files selected for processing (8)
  • .clangd
  • src/Deferred.cpp
  • src/Feature.h
  • src/Features/IBL.cpp
  • src/Features/ScreenSpaceShadows.cpp
  • src/Features/Skylighting.cpp
  • src/Features/TerrainBlending.cpp
  • src/State.cpp
💤 Files with no reviewable changes (1)
  • src/Features/IBL.cpp
✅ Files skipped from review due to trivial changes (3)
  • src/Features/ScreenSpaceShadows.cpp
  • src/Features/Skylighting.cpp
  • src/Features/TerrainBlending.cpp
🚧 Files skipped from review as they are similar to previous changes (1)
  • .clangd

Comment thread src/State.cpp Outdated
alandtse and others added 2 commits April 20, 2026 16:26
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@alandtse alandtse force-pushed the build/clangd-ide-includes branch from 49eb260 to f2d2dbe Compare April 20, 2026 23:26
@alandtse alandtse merged commit ab5eec0 into community-shaders:dev Apr 20, 2026
6 checks passed
ParticleTroned pushed a commit to ParticleTroned/skyrim-community-shaders that referenced this pull request May 2, 2026
…rs#2164)

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
(cherry picked from commit ab5eec0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants