Skip to content

Conversation

@van800
Copy link
Member

@van800 van800 commented Nov 13, 2025

Currently too many manual steps to consider it a recommended approach.

Given that godot.sln is opened in Rider.

  1. Include your SConstuct files in the project
    <ItemGroup>
        <None Include="**/SConstruct"/>
    </ItemGroup>
  1. Install Python Community plugin in Rider
  2. Point Python File Type to Sconstruct
image
  1. Generate _scons_stubs or coping from this PR
  2. In the context menu of the solution call "Attach existing folder", point it to _scons_stubs folder.
  3. Add
from typing import TYPE_CHECKING

if TYPE_CHECKING:
    from _scons_stubs.SCons.Stubs import *  # noqa: F401,F403 — used only for IDE/type checking

on top of your SConstruct file. Check example in the PR.

I think I know how to automate steps 3 and 4, 5, but not 6.

The main SConstruct is almost green except 4 unresolved place, which static analysers would never handle.

image

@van800 van800 marked this pull request as draft November 13, 2025 09:15
@van800
Copy link
Member Author

van800 commented Nov 13, 2025

It looks a bit sad on the scons side though
SCons/scons#4661
SCons/scons#4662 (comment)

@van800
Copy link
Member Author

van800 commented Nov 14, 2025

Heh, today I found that actually stubs were already done in
https://github.com/godotengine/godot/blob/9f9ee0c813443333a49c797083ff456629c009fb/misc/utility/scons_hints.py

Only requires just copy-paste scons_hints.py to https://github.com/godotengine/godot-cpp and import in every SConstruct with a line similar to https://github.com/godotengine/godot/blob/bc85da65a54cc29a9a18311c5980c25f7f492b2c/SConstruct#L2

@van800
Copy link
Member Author

van800 commented Nov 14, 2025

If you see trouble with setting Python Interpreter https://youtrack.jetbrains.com/issue/DEXP-913018
You may workaround it for now by invoking Solution -> Add -> Existing folder, select your godot folder.
image

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