Files

9.1 KiB

\LspAPI

All URIs are relative to https://api.hanzo.ai

Method HTTP request Description
PostLspComplete Post /v1/lsp/complete Offers the candidates a language server has at a position, typed and resolved through the repository's dependencies rather than guessed from text.
PostLspDiagnostics Post /v1/lsp/diagnostics Reports every problem the language server finds in one file — compile errors, type errors and lints, each with its span and its severity (1 error, 2 warning, 3 information, 4 hint).
PostLspHover Post /v1/lsp/hover Renders the type and documentation of the symbol at a position, as the language server itself renders it.
PostLspLocate Post /v1/lsp/locate Finds where a symbol lives: its definition, its references, its type or its implementations, chosen by relation (definition, reference, type, implementation — empty means definition).
PostLspSymbols Post /v1/lsp/symbols Outlines one file: every declaration in it, with its kind and its span.

PostLspComplete

LspAnswer PostLspComplete(ctx).LspQuery(lspQuery).Execute()

Offers the candidates a language server has at a position, typed and resolved through the repository's dependencies rather than guessed from text.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	lspQuery := *openapiclient.NewLspQuery() // LspQuery | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.LspAPI.PostLspComplete(context.Background()).LspQuery(lspQuery).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `LspAPI.PostLspComplete``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `PostLspComplete`: LspAnswer
	fmt.Fprintf(os.Stdout, "Response from `LspAPI.PostLspComplete`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiPostLspCompleteRequest struct via the builder pattern

Name Type Description Notes
lspQuery LspQuery

Return type

LspAnswer

Authorization

bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PostLspDiagnostics

LspAnswer PostLspDiagnostics(ctx).LspQuery(lspQuery).Execute()

Reports every problem the language server finds in one file — compile errors, type errors and lints, each with its span and its severity (1 error, 2 warning, 3 information, 4 hint).

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	lspQuery := *openapiclient.NewLspQuery() // LspQuery | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.LspAPI.PostLspDiagnostics(context.Background()).LspQuery(lspQuery).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `LspAPI.PostLspDiagnostics``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `PostLspDiagnostics`: LspAnswer
	fmt.Fprintf(os.Stdout, "Response from `LspAPI.PostLspDiagnostics`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiPostLspDiagnosticsRequest struct via the builder pattern

Name Type Description Notes
lspQuery LspQuery

Return type

LspAnswer

Authorization

bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PostLspHover

LspAnswer PostLspHover(ctx).LspQuery(lspQuery).Execute()

Renders the type and documentation of the symbol at a position, as the language server itself renders it.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	lspQuery := *openapiclient.NewLspQuery() // LspQuery | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.LspAPI.PostLspHover(context.Background()).LspQuery(lspQuery).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `LspAPI.PostLspHover``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `PostLspHover`: LspAnswer
	fmt.Fprintf(os.Stdout, "Response from `LspAPI.PostLspHover`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiPostLspHoverRequest struct via the builder pattern

Name Type Description Notes
lspQuery LspQuery

Return type

LspAnswer

Authorization

bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PostLspLocate

LspAnswer PostLspLocate(ctx).LspQuery(lspQuery).Execute()

Finds where a symbol lives: its definition, its references, its type or its implementations, chosen by relation (definition, reference, type, implementation — empty means definition).

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	lspQuery := *openapiclient.NewLspQuery() // LspQuery | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.LspAPI.PostLspLocate(context.Background()).LspQuery(lspQuery).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `LspAPI.PostLspLocate``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `PostLspLocate`: LspAnswer
	fmt.Fprintf(os.Stdout, "Response from `LspAPI.PostLspLocate`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiPostLspLocateRequest struct via the builder pattern

Name Type Description Notes
lspQuery LspQuery

Return type

LspAnswer

Authorization

bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PostLspSymbols

LspAnswer PostLspSymbols(ctx).LspQuery(lspQuery).Execute()

Outlines one file: every declaration in it, with its kind and its span.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	lspQuery := *openapiclient.NewLspQuery() // LspQuery | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.LspAPI.PostLspSymbols(context.Background()).LspQuery(lspQuery).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `LspAPI.PostLspSymbols``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `PostLspSymbols`: LspAnswer
	fmt.Fprintf(os.Stdout, "Response from `LspAPI.PostLspSymbols`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiPostLspSymbolsRequest struct via the builder pattern

Name Type Description Notes
lspQuery LspQuery

Return type

LspAnswer

Authorization

bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]