Documentation
¶
Index ¶
- func BuildFieldSchema(schema bigquery.Schema) []lsp.FieldSchema
- type File
- type Project
- func (p *Project) Close() error
- func (p *Project) Complete(ctx context.Context, uri lsp.DocumentURI, position lsp.Position) ([]completion.CompletionItem, error)
- func (p *Project) DeleteFile(uri lsp.DocumentURI)
- func (p *Project) Dryrun(ctx context.Context, uri lsp.DocumentURI) (*bq.JobStatus, error)
- func (p *Project) GetErrors(uri lsp.DocumentURI) map[lsp.DocumentURI][]file.Error
- func (p *Project) GetFile(uri lsp.DocumentURI) (string, bool)
- func (p *Project) GetJobDetails(ctx context.Context, projectID, jobID, location string) ([]lsp.MarkedString, func(context.Context) (*bq.RowIterator, error), error)
- func (p *Project) GetJobInfo(ctx context.Context, projectID, jobID, location string) ([]lsp.MarkedString, *bq.RowIterator, error)
- func (p *Project) GetTableDetails(ctx context.Context, projectID, datasetID, tableID string) ([]lsp.MarkedString, []lsp.FieldSchema, ...)
- func (p *Project) GetTableInfo(ctx context.Context, projectID, datasetID, tableID string) ([]lsp.MarkedString, *bq.RowIterator, error)
- func (p *Project) LookupIdent(ctx context.Context, uri lsp.DocumentURI, position lsp.Position) ([]lsp.Location, error)
- func (p *Project) ResolveCompletionItem(ctx context.Context, item lsp.CompletionItem) (lsp.CompletionItem, error)
- func (p *Project) Run(ctx context.Context, uri lsp.DocumentURI) (bigquery.BigqueryJob, error)
- func (p *Project) TermDocument(ctx context.Context, uri lsp.DocumentURI, position lsp.Position) ([]lsp.MarkedString, error)
- func (p *Project) UpdateFile(uri lsp.DocumentURI, text string, version int) error
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 Project ¶
type Project struct {
// contains filtered or unexported fields
}
func NewProject ¶
func NewProjectWithBQClient ¶
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) GetErrors ¶
func (p *Project) GetErrors(uri lsp.DocumentURI) map[lsp.DocumentURI][]file.Error
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) LookupIdent ¶
func (*Project) ResolveCompletionItem ¶
func (p *Project) ResolveCompletionItem(ctx context.Context, item lsp.CompletionItem) (lsp.CompletionItem, error)
func (*Project) Run ¶
func (p *Project) Run(ctx context.Context, uri lsp.DocumentURI) (bigquery.BigqueryJob, error)
func (*Project) TermDocument ¶
func (p *Project) TermDocument(ctx context.Context, uri lsp.DocumentURI, position lsp.Position) ([]lsp.MarkedString, error)