cameron-martin / bazel-lsp

A language server implementation for Bazel
Apache License 2.0
36 stars 1 forks source link

Add cc, py and java builtins #12

Closed cameron-martin closed 4 months ago

cameron-martin commented 5 months ago

8 added some builtins, but this proto does not include things like cc_library. I'm not sure where these are meant to come from.

daivinhtran commented 5 months ago

I think cc_library is now migrated to Starlark?

cameron-martin commented 5 months ago

Is it, but they're still available at globals. Do you think the starlark builtins are exported differently to the java ones?

daivinhtran commented 5 months ago

The cc rules come from https://github.com/bazelbuild/rules_cc (Starlark implementation of cc rules). I believe if we can resolve http_archive and/or local_repository declaring @rules_cc, it should work.

cameron-martin commented 5 months ago

That repo still just calls builtins. I think they might be written in starlark now but in the bazel repo.

See https://github.com/bazelbuild/rules_cc/blob/51b77439a109b8c8f75ad70a130293291ed8b851/cc/defs.bzl#L49

cameron-martin commented 4 months ago

Builtins such as toolchain, toolchain_type and package also aren't included in this protobuf.

cameron-martin commented 4 months ago

Looks like we can use bazel info build-language here. See https://github.com/bazelbuild/vscode-bazel/issues/1#issuecomment-1993870458