MCPcopy Create free account
hub / github.com/bufbuild/buf / GetModule

Method GetModule

private/buf/buflsp/workspace.go:213–223  ·  view source on GitHub ↗

GetModule resolves the Module for the protocol URI.

(uri protocol.URI)

Source from the content-addressed store, hash-verified

211
212// GetModule resolves the Module for the protocol URI.
213func (w *workspace) GetModule(uri protocol.URI) bufmodule.Module {
214 if w == nil {
215 return nil
216 }
217 fileName := uri.Filename()
218 if fileInfo, ok := w.fileNameToFileInfo[fileName]; ok {
219 return fileInfo.Module()
220 }
221 w.lsp.logger.Warn("workspace: module not found", slog.String("file", fileName), slog.String("parent", w.workspaceURI.Filename()))
222 return nil
223}
224
225// CheckClient returns the buf check Client configured for the workspace.
226func (w *workspace) CheckClient() bufcheck.Client {

Callers 4

runFunction · 0.45
RunChecksMethod · 0.45
documentLinkMethod · 0.45

Calls 2

ModuleMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected