mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-19 16:40:48 +00:00
fix(core): fix file references in workspaces (#28209)
This commit is contained in:
parent
88681d389b
commit
ff9d7cab5c
2 changed files with 6 additions and 0 deletions
|
|
@ -1,12 +1,14 @@
|
|||
import { createMemo, createResource } from "solid-js"
|
||||
import { DialogSelect } from "@tui/ui/dialog-select"
|
||||
import { useDialog } from "@tui/ui/dialog"
|
||||
import { useProject } from "@tui/context/project"
|
||||
import { useSDK } from "@tui/context/sdk"
|
||||
import { createStore } from "solid-js/store"
|
||||
|
||||
export function DialogTag(props: { onSelect?: (value: string) => void }) {
|
||||
const sdk = useSDK()
|
||||
const dialog = useDialog()
|
||||
const project = useProject()
|
||||
|
||||
const [store] = createStore({
|
||||
filter: "",
|
||||
|
|
@ -17,6 +19,7 @@ export function DialogTag(props: { onSelect?: (value: string) => void }) {
|
|||
async () => {
|
||||
const result = await sdk.client.find.files({
|
||||
query: store.filter,
|
||||
workspace: project.workspace.current(),
|
||||
})
|
||||
if (result.error) return []
|
||||
const sliced = (result.data ?? []).slice(0, 5)
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import { firstBy } from "remeda"
|
|||
import { createMemo, createResource, createEffect, onMount, onCleanup, Index, Show, createSignal } from "solid-js"
|
||||
import { createStore } from "solid-js/store"
|
||||
import { useEditorContext } from "@tui/context/editor"
|
||||
import { useProject } from "@tui/context/project"
|
||||
import { useSDK } from "@tui/context/sdk"
|
||||
import { useSync } from "@tui/context/sync"
|
||||
import { getScrollAcceleration } from "../../util/scroll"
|
||||
|
|
@ -85,6 +86,7 @@ export function Autocomplete(props: {
|
|||
const editor = useEditorContext()
|
||||
const sdk = useSDK()
|
||||
const sync = useSync()
|
||||
const project = useProject()
|
||||
const command = useCommandPalette()
|
||||
const { theme } = useTheme()
|
||||
const dimensions = useTerminalDimensions()
|
||||
|
|
@ -382,6 +384,7 @@ export function Autocomplete(props: {
|
|||
// Get files from SDK
|
||||
const result = await sdk.client.find.files({
|
||||
query: baseQuery,
|
||||
workspace: project.workspace.current(),
|
||||
})
|
||||
|
||||
const options: AutocompleteOption[] = []
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue