source

package
v0.8.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 26, 2026 License: Apache-2.0 Imports: 19 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildFieldSchema added in v0.7.0

func BuildFieldSchema(schema bigquery.Schema) []lsp.FieldSchema

BuildFieldSchema converts a BigQuery schema into the client-facing FieldSchema tree, used to render nested RECORD/REPEATED values and table schemas without exposing the BigQuery SDK types to LSP clients.

Types

type Diagnostics added in v0.8.0

type Diagnostics struct {
	// Src is the text that was analyzed. Positions below are byte offsets
	// into it, so convert them with Src rather than the current text, which
	// may have been edited since.
	Src    string
	Errors []file.Error
	// ErrorFixes holds quick fixes for Errors, keyed by index into Errors.
	ErrorFixes map[int][]lint.SuggestedFix
	Lint       []lint.Diagnostic
}

Diagnostics may be shared with other callers through the cache, so callers must treat its slices and maps as read-only.

type File

type File struct {
	RawText string
	Version int
}

type Project

type Project struct {
	// contains filtered or unexported fields
}

func NewProject

func NewProject(ctx context.Context, rootPath string, bqClient bigquery.Client, logger *logrus.Logger) *Project

func NewProjectWithBQClient

func NewProjectWithBQClient(rootPath string, bqClient bigquery.Client, logger *logrus.Logger) *Project

func (*Project) Close

func (p *Project) Close() error

func (*Project) Complete

func (p *Project) Complete(ctx context.Context, uri lsp.DocumentURI, position lsp.Position) ([]completion.CompletionItem, error)

func (*Project) DeleteFile

func (p *Project) DeleteFile(uri lsp.DocumentURI)

func (*Project) Diagnose added in v0.8.0

func (p *Project) Diagnose(ctx context.Context, uri lsp.DocumentURI, cfg lint.Config) (Diagnostics, bool)

Diagnose analyzes uri once and derives both analysis errors and lint diagnostics from that single parse. It returns false when uri is not open. Results are reused until the text, cfg, or the dry-run result for the text changes, because code actions request them on every cursor move. The last successful Dryrun is passed to lint only while the text is unchanged since, as its estimate says nothing about other text.

func (*Project) Dryrun

func (p *Project) Dryrun(ctx context.Context, uri lsp.DocumentURI) (*bq.JobStatus, error)

func (*Project) GetFile

func (p *Project) GetFile(uri lsp.DocumentURI) (string, bool)

func (*Project) GetJobDetails added in v0.7.0

func (p *Project) GetJobDetails(ctx context.Context, projectID, jobID, location string) ([]lsp.MarkedString, func(context.Context) (*bq.RowIterator, error), error)

GetJobDetails polls until the job is done, then returns its details markdown. The returned closure reads the query result rows lazily, reusing the already-fetched (and already-polled-to-completion) job.

func (*Project) GetJobInfo

func (p *Project) GetJobInfo(ctx context.Context, projectID, jobID, location string) ([]lsp.MarkedString, *bq.RowIterator, error)

func (*Project) GetTableDetails added in v0.7.0

func (p *Project) GetTableDetails(ctx context.Context, projectID, datasetID, tableID string) ([]lsp.MarkedString, []lsp.FieldSchema, func(context.Context) (*bq.RowIterator, error), error)

GetTableDetails fetches table metadata and its details markdown without fetching preview rows. The returned closure fetches the preview rows lazily, reusing the already-fetched metadata instead of calling GetTableMetadata again. GetTableDetails fetches table metadata and its details markdown without fetching preview rows. It also returns the schema as structured FieldSchema data (in addition to the Markdown summary in markedStrings) so callers like the Details webview tab can render a collapsible tree instead of a flat Markdown table. The returned closure fetches the preview rows lazily, reusing the already-fetched metadata instead of calling GetTableMetadata again.

func (*Project) GetTableInfo

func (p *Project) GetTableInfo(ctx context.Context, projectID, datasetID, tableID string) ([]lsp.MarkedString, *bq.RowIterator, error)

func (*Project) InvalidateDiagnostics added in v0.8.0

func (p *Project) InvalidateDiagnostics(uri lsp.DocumentURI)

InvalidateDiagnostics drops the cached Diagnose result for uri. Table metadata fetch failures are cached with the result, so callers use this when the user asks for a fresh check without editing, e.g. on save.

func (*Project) LookupIdent

func (p *Project) LookupIdent(ctx context.Context, uri lsp.DocumentURI, position lsp.Position) ([]lsp.Location, error)

LookupIdent takes and returns positions in UTF-16 units, the LSP default.

func (*Project) OpenFiles added in v0.8.0

func (p *Project) OpenFiles() []lsp.DocumentURI

func (*Project) ResolveCompletionItem

func (p *Project) ResolveCompletionItem(ctx context.Context, item lsp.CompletionItem) (lsp.CompletionItem, error)

func (*Project) Run

func (*Project) TermDocument

func (p *Project) TermDocument(ctx context.Context, uri lsp.DocumentURI, position lsp.Position) ([]lsp.MarkedString, error)

func (*Project) UpdateFile

func (p *Project) UpdateFile(uri lsp.DocumentURI, text string, version int) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL