Skip to content

Label completion is not context aware #48

Description

@rcorre

I build bazel-lsp 0.6.1 from source and I'm using it as a LSP in helix. GoToDefinition on labels works, but completion doesn't seem very accurate or context aware. Here's a few examples:

  1. I'd expect @crat to complete to @crates//
   11  rust_library_group(
   12      name = "tonic_runtime",
   13      deps = [
   14 ▔        "@crates//:tonic",
●  15 ▍        "@crat
   16      ],        java_package_configuration    function
   17  )             constraint_setting            function
   18                constraint_value              function
   19  rust_prost_to package_relative_label        function
   20      name = "p starlark_doc_extract          function

I'd expect @crates//:pr to complete to @crates//:prost

   11  rust_library_group(
   12      name = "tonic_runtime",
   13      deps = [
   14 ▔        "@crates//:tonic",
●  15 ▍        "@crates//:pr
   16      ],                propeller_optimize            function ▐
   17  )                     proto_lang_toolchain          function ▐
   18                        proto_library                 function ▐
   19  rust_prost_toolchain( print                         function ▐
   20      name = "prost_too rust_prost_toolchain          method   ▐
   21      prost_plugin = "@ cc_proto_library              function ▐st",
   22      prost_runtime = " fdo_prefetch_hints            function ▐
   23      prost_types = "@c fdo_profile                   function ▐
   24      proto_compiler =  java_lite_proto_library       function ▐
   25      tonic_plugin = "@ java_proto_library            function ▐ic",

I'd expect //src/b to complete to //src/builtin:

   11  rust_library_group(
   12      name = "tonic_runtime",
   13      deps = [
   14 ▔        "@crates//:tonic",
●  15 ▍        "//src/bu
   16      ],          rust_library_group            method
   17  )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions