withered-magic / starpls

An LSP implementation for Starlark, the configuration language used by Bazel and Buck2.
Apache License 2.0
99 stars 9 forks source link

Warning: Type "ToolchainContext" is not indexable #252

Closed hauserx closed 4 months ago

hauserx commented 4 months ago

For sample rule implementation:

def _impl(ctx):
    info = ctx.toolchains["//:my_toolchain_type"].my_info

Getting: image

withered-magic commented 4 months ago

Put up a temporary fix here: https://github.com/withered-magic/starpls/issues/254

However, the result of the indexing operation will be Unknown instead of ToolchainInfo, the full fix is blocked by https://github.com/withered-magic/starpls/issues/253 so will leave this open until that gets fixed as well

withered-magic commented 4 months ago

This should be fixed on master now!