diff --git a/core/indexing/refreshIndex.ts b/core/indexing/refreshIndex.ts index d05865ac5..cce0bf62e 100644 --- a/core/indexing/refreshIndex.ts +++ b/core/indexing/refreshIndex.ts @@ -271,7 +271,7 @@ export async function getComputeDeleteAddRemove( removeTag.push({ path, cacheKey }); } else { if (existingTags.length === 0) { - console.warn("Existing tags should not be empty when trying to remove"); + // console.warn("Existing tags should not be empty when trying to remove"); } del.push({ path, cacheKey }); diff --git a/extensions/vscode/src/activation/proxy.ts b/extensions/vscode/src/activation/proxy.ts index 9929985a8..02f853e58 100644 --- a/extensions/vscode/src/activation/proxy.ts +++ b/extensions/vscode/src/activation/proxy.ts @@ -67,6 +67,6 @@ export function startProxy() { console.log(`Proxy server is running on port ${PROXY_PORT}`); }); server.on("error", (e) => { - console.log("Proxy server already running on port 65433"); + // console.log("Proxy server already running on port 65433"); }); } diff --git a/gui/src/App.tsx b/gui/src/App.tsx index 49a2bb398..e5ea45b32 100644 --- a/gui/src/App.tsx +++ b/gui/src/App.tsx @@ -1,4 +1,4 @@ -import { createContext, useEffect, useState } from "react"; +import { createContext, useState } from "react"; import { useDispatch } from "react-redux"; import { RouterProvider, createMemoryRouter } from "react-router-dom"; import Layout from "./components/Layout"; @@ -83,6 +83,22 @@ export const FoldersSearchContext = createContext< [MiniSearch, MiniSearchResult[]] >([foldersMiniSearch, []]); +(async () => { + const files = await new ExtensionIde().listWorkspaceContents(); + const results = files.map((filepath) => { + return { id: filepath, basename: getBasename(filepath) }; + }); + filesMiniSearch.addAll(results); +})(); + +(async () => { + const folders = await new ExtensionIde().listFolders(); + const results = folders.map((path) => { + return { id: path, basename: getBasename(path) }; + }); + foldersMiniSearch.addAll(results); +})(); + export interface MiniSearchResult { id: string; basename: string; @@ -93,39 +109,19 @@ function App() { useSetup(dispatch); - const [filesFirstResults, setFilesFirstResults] = useState< + const [filesFirstResultsState, setFilesFirstResults] = useState< MiniSearchResult[] >([]); - const [foldersFirstResults, setFoldersFirstResults] = useState< + const [foldersFirstResultsState, setFoldersFirstResults] = useState< MiniSearchResult[] >([]); - useEffect(() => { - (async () => { - const files = await new ExtensionIde().listWorkspaceContents(); - const results = files.map((filepath) => { - return { id: filepath, basename: getBasename(filepath) }; - }); - filesMiniSearch.addAll(results); - setFilesFirstResults(results); - })(); - }, []); - - useEffect(() => { - (async () => { - const folders = await new ExtensionIde().listFolders(); - const results = folders.map((path) => { - return { id: path, basename: getBasename(path) }; - }); - foldersMiniSearch.addAll(results); - setFoldersFirstResults(results); - })(); - }, []); - return ( - + diff --git a/gui/src/components/mainInput/getSuggestion.ts b/gui/src/components/mainInput/getSuggestion.ts index 87d97a296..c0068bcb8 100644 --- a/gui/src/components/mainInput/getSuggestion.ts +++ b/gui/src/components/mainInput/getSuggestion.ts @@ -126,7 +126,7 @@ function getFileItems( ): ComboBoxItem[] { let res: any[] = miniSearch.search(query.trim() === "" ? "/" : query, { prefix: true, - fuzzy: 5, + fuzzy: 4, }); if (res.length === 0) { return openFiles.length > 0 ? openFiles : firstResults;