on main help sign in
chore: make getContextFromPaths config independent
commitf491a6d8c38a65392e241aab6b3bc8c37b7cdfce authorKujtim Hoxha <kujtimii.h@gmail.com> dateSat 5 Jul 2025, 17:34 (1 year ago) parent5936ae8
2 files changed+3−5
internal/llm/prompt/coder.go+1−1 internal/llm/prompt/prompt.go+2−4
internal/llm/prompt/coder.go+1−1
@@ -28,7 +28,7 @@ func CoderPrompt(p string, contextFiles ...string) string {
2828
2929 basePrompt = fmt.Sprintf("%s\n\n%s\n%s", basePrompt, envInfo, lspInformation())
3030
31− contextContent := getContextFromPaths(contextFiles)
31+ contextContent := getContextFromPaths(config.Get().WorkingDir(), contextFiles)
3232 slog.Debug("Context content", "Context", contextContent)
3333 if contextContent != "" {
3434 return fmt.Sprintf("%s\n\n# Project-Specific Context\n Make sure to follow the instructions in the context below\n%s", basePrompt, contextContent)
internal/llm/prompt/prompt.go+2−4
@@ -5,8 +5,6 @@ import (
55 "path/filepath"
66 "strings"
77 "sync"
8−
9− "github.com/charmbracelet/crush/internal/config"
108)
119
1210type PromptID string
@@ -36,8 +34,8 @@ func GetPrompt(promptID PromptID, provider string, contextPaths ...string) strin
3634 return basePrompt
3735}
3836
39−func getContextFromPaths(contextPaths []string) string {
40− return processContextPaths(config.Get().WorkingDir(), contextPaths)
37+func getContextFromPaths(workingDir string, contextPaths []string) string {
38+ return processContextPaths(workingDir, contextPaths)
4139}
4240
4341func processContextPaths(workDir string, paths []string) string {