freezing-lamp-12123
08/02/2022, 3:06 PMBUILD files via vscode (i.e. autocomplete of target documentation and such, as if it was an actual python file with some globals in scope) ? and if so, how would one go about that? .. 🙏bitter-ability-32190
08/02/2022, 3:07 PMfreezing-lamp-12123
08/02/2022, 3:15 PMbusy-vase-39202
08/02/2022, 3:15 PMbitter-ability-32190
08/02/2022, 3:17 PMbusy-vase-39202
08/02/2022, 3:18 PMbitter-ability-32190
08/02/2022, 3:20 PMfreezing-lamp-12123
08/02/2022, 3:40 PMfreezing-lamp-12123
08/02/2022, 3:41 PMbitter-ability-32190
08/02/2022, 3:41 PMbitter-ability-32190
08/02/2022, 3:41 PMglobalsfreezing-lamp-12123
08/02/2022, 3:41 PMbitter-ability-32190
08/02/2022, 3:45 PMpython_sources and pex_binary.
The second are "objects" and "CAOF"s exposed. They're "baked-in" like Targets, but don't have any magic. A good example is http_source which can be used as the value of a file /`resource` source field. See https://www.pantsbuild.org/v2.13/docs/reference-file as an example
The last is user-defined macros. Basically "anything goes" preamble used for every BUILD file.bitter-ability-32190
08/02/2022, 3:47 PMexec for BUILD files: https://github.com/pantsbuild/pants/blob/23fc6b1bed933776da7725c76408942a870ccdef/src/python/pants/engine/internals/parser.py#L167
And here is for macros: https://github.com/pantsbuild/pants/blob/main/src/python/pants/engine/internals/build_files.py#L67bitter-ability-32190
08/02/2022, 3:49 PM.pyi file describing all targets/objects/COAFs/macros and then somehow plug into the Python support to tell it to always prentend the definitions in this .pyi are globally defined 🤔freezing-lamp-12123
08/02/2022, 3:59 PMfreezing-lamp-12123
08/02/2022, 4:09 PMbitter-ability-32190
08/02/2022, 4:16 PMfresh-cat-90827
08/02/2022, 4:52 PMBUILD files.
There is some limited support for code navigation and interaction as well such as
reporting syntax errors, ability to comment/uncomment blocks of code, and collapse/expand code sections.
• PyCharm users need to install the Bazel plugin
and add the BUILD file name pattern to the Bazel BUILD language in the Recognized File Types
section. See Change filename patterns associated with file type to learn more.
• VSCode users only need to install the Bazel plugin.fresh-cat-90827
08/02/2022, 4:53 PMfresh-cat-90827
08/02/2022, 4:54 PM.pyi idea won’t work, after my experiments, it seems, because the stubs are used when you import that module in another module, but you want the stubs to apply to the module currently being editedbitter-ability-32190
08/02/2022, 5:15 PM# __builtins__.pyi
def shell_sources(name: str) -> None: ...bitter-ability-32190
08/02/2022, 5:17 PMbitter-ability-32190
08/02/2022, 5:20 PMfresh-cat-90827
08/02/2022, 5:22 PMbitter-ability-32190
08/02/2022, 5:23 PMfresh-cat-90827
08/02/2022, 5:24 PMfresh-cat-90827
08/02/2022, 5:25 PMbitter-ability-32190
08/02/2022, 5:25 PMBUILD files at face-value. They aren't Starlark, they ARE Python, just with a different set of builtins.fresh-cat-90827
08/02/2022, 5:25 PMbitter-ability-32190
08/02/2022, 5:25 PMbitter-ability-32190
08/02/2022, 5:25 PMbitter-ability-32190
08/02/2022, 5:27 PMfreezing-lamp-12123
08/02/2022, 5:51 PMfreezing-lamp-12123
08/02/2022, 5:54 PMbitter-ability-32190
08/02/2022, 5:55 PMbitter-ability-32190
08/02/2022, 5:55 PMhappy-kitchen-89482
08/02/2022, 7:26 PM./pants help-all may be of use. For example, it'll tell you what all the registered target types are, I thinkbitter-ability-32190
08/02/2022, 7:27 PMwide-midnight-78598
08/02/2022, 7:36 PMpants.toml completions (https://pantsbuild.slack.com/archives/C046T6T9U/p1659243255507499), and this - we have some big ticket items surrounding developer experience.
Would these get lumped in as part of the experimental-bsp? Or separate?
I'm happy to help out, as I'm a long-time VSCode convert for almost everything I do.bitter-ability-32190
08/02/2022, 7:37 PMBUILD and pants.toml wouldn't be BSP, but closer to LSP or just a dedicated extensionfast-nail-55400
08/02/2022, 9:17 PMbitter-ability-32190
08/11/2022, 4:52 PMfreezing-lamp-12123
08/11/2022, 4:56 PM:hide:freezing-lamp-12123
08/11/2022, 4:56 PMfreezing-lamp-12123
08/11/2022, 5:28 PMbitter-ability-32190
08/11/2022, 5:29 PMfreezing-lamp-12123
08/11/2022, 5:56 PMfresh-cat-90827
08/11/2022, 5:58 PMfresh-cat-90827
08/11/2022, 5:59 PMfresh-cat-90827
08/11/2022, 6:00 PMfreezing-lamp-12123
08/11/2022, 6:01 PMfresh-cat-90827
08/11/2022, 6:02 PMfreezing-lamp-12123
08/11/2022, 6:04 PM