jimporter / bfg9000

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

Linter errors #139

Closed ompadu closed 3 years ago

ompadu commented 3 years ago

Is there a way to make the linter happy by importing a dummy package or something when opening .bfg files in an ide?

jimporter commented 3 years ago

Unfortunately, no not really. I think the answer here is to add an LSP configuration for bfg scripts, but that's complicated and I don't fully understand how it works. There's also #136 and #135 for this issue.

ompadu commented 3 years ago

Oh, it's okay. Thank you for the answer :)

jimporter commented 3 years ago

I filed #140 to track the LSP implementation. I'd like to get something working for it for 0.7, but I haven't been able to find much information out there on how you'd make a "derived" LSP language; all I really need is a way to say "this file is in Python syntax with these extra builtin symbols", but that seems to be nontrivial (or at least no one else has tried to do this, so there's no documentation on how to do it).

ompadu commented 3 years ago

Maybe forking an existing python LSP, and adding the bfg stuff to it?

jimporter commented 3 years ago

Yeah, that's about what I'm thinking. Maybe there are even some hooks in one or another Python LSP implementation that I could use...

ompadu commented 3 years ago

Wouldn't it have been easier to just have bfg9000 be a ordinary python module, that we could just import in the build script and run it with python? What are the advantages of doing it like this?

jimporter commented 3 years ago

The main advantage is that the .bfg script evaluation is only one phase of all the work necessary to generate the Makefiles for an actual build. While it's easy enough to do stuff before the .bfg script when it's just a module, it's not easy to do stuff after it.