jimporter / bfg9000

bfg9000 - build file generator
https://jimporter.github.io/bfg9000
BSD 3-Clause "New" or "Revised" License
76 stars 21 forks source link

Is there some way to import the builtin functions to appease an IDE? #135

Closed abingham closed 4 years ago

abingham commented 4 years ago

Since bfg9000 injects the builtin names into the build.cfg module namespace dynamically, my IDE gives me warnings about a lot undefined names (i.e. all of the builtin names). Is there something I can import that will give my IDE more information about these symbols? I've tried doing things like from bfg9000.builtins.file_types import source_file, but it's pulling in some different (but related?) object.

I've lived with similar problems in SCons for years, but I was hoping bfg had a solution.

jimporter commented 4 years ago

Not easily, no. The actual builtins that are available in a .bfg file are partially-applied functions from bfg9000.builtins.*, so an IDE would have to know about that. Perhaps there's a way to tell the IDE explicitly what bfg's API is, but that's probably IDE-specific. I've considered adding an emacs mode for it, but that obviously only helps emacs users...