Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions cmd/ckb/symbol.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@

"github.com/spf13/cobra"

const (

Check failure on line 10 in cmd/ckb/symbol.go

View workflow job for this annotation

GitHub Actions / Analyze

missing import path

Check failure on line 10 in cmd/ckb/symbol.go

View workflow job for this annotation

GitHub Actions / Security Scan

missing import path

Check failure on line 10 in cmd/ckb/symbol.go

View workflow job for this annotation

GitHub Actions / Security Scan

missing import path

Check failure on line 10 in cmd/ckb/symbol.go

View workflow job for this annotation

GitHub Actions / Lint

missing import path (typecheck)

Check failure on line 10 in cmd/ckb/symbol.go

View workflow job for this annotation

GitHub Actions / Test Coverage

missing import path

Check failure on line 10 in cmd/ckb/symbol.go

View workflow job for this annotation

GitHub Actions / Test

missing import path

Check failure on line 10 in cmd/ckb/symbol.go

View workflow job for this annotation

GitHub Actions / Dependencies / Dependency Scan

missing import path

Check failure on line 10 in cmd/ckb/symbol.go

View workflow job for this annotation

GitHub Actions / Dependencies / Dependency Scan

missing import path

Check failure on line 10 in cmd/ckb/symbol.go

View workflow job for this annotation

GitHub Actions / Dependencies / Dependency Scan

missing import path

Check failure on line 10 in cmd/ckb/symbol.go

View workflow job for this annotation

GitHub Actions / Dependencies / Dependency Scan

missing import path
FormatHuman = "human"
FormatJSON = "json"

Check failure on line 12 in cmd/ckb/symbol.go

View workflow job for this annotation

GitHub Actions / Security Scan

missing import path

Check failure on line 12 in cmd/ckb/symbol.go

View workflow job for this annotation

GitHub Actions / Lint

missing import path (typecheck)

Check failure on line 12 in cmd/ckb/symbol.go

View workflow job for this annotation

GitHub Actions / Dependencies / Dependency Scan

missing import path

Check failure on line 12 in cmd/ckb/symbol.go

View workflow job for this annotation

GitHub Actions / Dependencies / Dependency Scan

missing import path
)

"github.com/SimplyLiz/CodeMCP/internal/query"

Check failure on line 15 in cmd/ckb/symbol.go

View workflow job for this annotation

GitHub Actions / Security Scan

expected declaration, found "github.com/SimplyLiz/CodeMCP/internal/query"

Check failure on line 15 in cmd/ckb/symbol.go

View workflow job for this annotation

GitHub Actions / Lint

expected declaration, found "github.com/SimplyLiz/CodeMCP/internal/query" (typecheck)

Check failure on line 15 in cmd/ckb/symbol.go

View workflow job for this annotation

GitHub Actions / Dependencies / Dependency Scan

expected declaration, found "github.com/SimplyLiz/CodeMCP/internal/query"

Check failure on line 15 in cmd/ckb/symbol.go

View workflow job for this annotation

GitHub Actions / Dependencies / Dependency Scan

expected declaration, found "github.com/SimplyLiz/CodeMCP/internal/query"
)

var (
Expand All @@ -24,7 +29,7 @@
head (default) - Use HEAD commit, ignore dirty state
full - Include dirty state for exact location`,
Args: cobra.ExactArgs(1),
Run: runSymbol,
symbolCmd.Flags().StringVar(&symbolFormat, "format", FormatHuman, "Output format ("+FormatHuman+", "+FormatJSON+")")

Check failure on line 32 in cmd/ckb/symbol.go

View workflow job for this annotation

GitHub Actions / Security Scan

mixture of field:value and value elements in struct literal

Check failure on line 32 in cmd/ckb/symbol.go

View workflow job for this annotation

GitHub Actions / Security Scan

missing ',' before newline in composite literal

Check failure on line 32 in cmd/ckb/symbol.go

View workflow job for this annotation

GitHub Actions / Lint

missing ',' before newline in composite literal (typecheck)

Check failure on line 32 in cmd/ckb/symbol.go

View workflow job for this annotation

GitHub Actions / Dependencies / Dependency Scan

mixture of field:value and value elements in struct literal

Check failure on line 32 in cmd/ckb/symbol.go

View workflow job for this annotation

GitHub Actions / Dependencies / Dependency Scan

missing ',' before newline in composite literal

Check failure on line 32 in cmd/ckb/symbol.go

View workflow job for this annotation

GitHub Actions / Dependencies / Dependency Scan

mixture of field:value and value elements in struct literal

Check failure on line 32 in cmd/ckb/symbol.go

View workflow job for this annotation

GitHub Actions / Dependencies / Dependency Scan

missing ',' before newline in composite literal
}

func init() {
Expand All @@ -42,17 +47,17 @@
engine := mustGetEngine(repoRoot, logger)
ctx := newContext()

// Get symbol from Query Engine
os.Exit(1)
opts := query.GetSymbolOptions{

Check failure on line 51 in cmd/ckb/symbol.go

View workflow job for this annotation

GitHub Actions / Security Scan

undefined: query

Check failure on line 51 in cmd/ckb/symbol.go

View workflow job for this annotation

GitHub Actions / Dependencies / Dependency Scan

undefined: query

Check failure on line 51 in cmd/ckb/symbol.go

View workflow job for this annotation

GitHub Actions / Dependencies / Dependency Scan

undefined: query
SymbolId: symbolID,
RepoStateMode: symbolRepoStateMode,
}
response, err := engine.GetSymbol(ctx, opts)
if err != nil {
fmt.Fprintf(os.Stderr, "Error getting symbol: %v\n", err)
output, err := FormatResponse(cliResponse, OutputFormat(symbolFormat))

Check failure on line 57 in cmd/ckb/symbol.go

View workflow job for this annotation

GitHub Actions / Security Scan

declared and not used: output

Check failure on line 57 in cmd/ckb/symbol.go

View workflow job for this annotation

GitHub Actions / Security Scan

undefined: cliResponse

Check failure on line 57 in cmd/ckb/symbol.go

View workflow job for this annotation

GitHub Actions / Dependencies / Dependency Scan

declared and not used: output

Check failure on line 57 in cmd/ckb/symbol.go

View workflow job for this annotation

GitHub Actions / Dependencies / Dependency Scan

undefined: cliResponse

Check failure on line 57 in cmd/ckb/symbol.go

View workflow job for this annotation

GitHub Actions / Dependencies / Dependency Scan

declared and not used: output

Check failure on line 57 in cmd/ckb/symbol.go

View workflow job for this annotation

GitHub Actions / Dependencies / Dependency Scan

undefined: cliResponse
os.Exit(1)
os.Exit(1)
}

// Convert to CLI response format
cliResponse := convertSymbolResponse(response)

Expand Down Expand Up @@ -119,7 +124,7 @@
QueryDurationMs int64 `json:"queryDurationMs"`
}

func convertSymbolResponse(resp *query.GetSymbolResponse) *SymbolResponseCLI {

Check failure on line 127 in cmd/ckb/symbol.go

View workflow job for this annotation

GitHub Actions / Security Scan

undefined: query

Check failure on line 127 in cmd/ckb/symbol.go

View workflow job for this annotation

GitHub Actions / Dependencies / Dependency Scan

undefined: query

Check failure on line 127 in cmd/ckb/symbol.go

View workflow job for this annotation

GitHub Actions / Dependencies / Dependency Scan

undefined: query
result := &SymbolResponseCLI{}

if resp.Symbol != nil {
Expand Down
Loading