github.com/bazelbuild/bazel-gazelle@v0.36.1-0.20240520142334-61b277ba6fed/language/bazel/visibility/resolve.go (about)

     1  /* Copyright 2023 The Bazel Authors. All rights reserved.
     2  
     3  Licensed under the Apache License, Version 2.0 (the "License");
     4  you may not use this file except in compliance with the License.
     5  You may obtain a copy of the License at
     6  
     7     http://www.apache.org/licenses/LICENSE-2.0
     8  
     9  Unless required by applicable law or agreed to in writing, software
    10  distributed under the License is distributed on an "AS IS" BASIS,
    11  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  See the License for the specific language governing permissions and
    13  limitations under the License.
    14  */
    15  
    16  package visibility
    17  
    18  import (
    19  	"github.com/bazelbuild/bazel-gazelle/config"
    20  	"github.com/bazelbuild/bazel-gazelle/label"
    21  	"github.com/bazelbuild/bazel-gazelle/repo"
    22  	"github.com/bazelbuild/bazel-gazelle/resolve"
    23  	"github.com/bazelbuild/bazel-gazelle/rule"
    24  )
    25  
    26  const (
    27  	_extName = "visibility_extension"
    28  )
    29  
    30  // Name returns the extension name.
    31  func (*visibilityExtension) Name() string {
    32  	return _extName
    33  }
    34  
    35  // Imports noops because no imports are needed to leverage this functionality.
    36  func (*visibilityExtension) Imports(c *config.Config, r *rule.Rule, f *rule.File) []resolve.ImportSpec {
    37  	return nil
    38  }
    39  
    40  // Embeds noops because we are not a traditional rule, and cannot be embedded.
    41  func (*visibilityExtension) Embeds(r *rule.Rule, from label.Label) []label.Label {
    42  	return nil
    43  }
    44  
    45  // Resolve noops because we don't have deps=[] to resolve.
    46  func (*visibilityExtension) Resolve(c *config.Config, ix *resolve.RuleIndex, rc *repo.RemoteCache, r *rule.Rule, imports interface{}, from label.Label) {
    47  }