Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,11 @@
},
"files.associations": {
"*.css": "tailwindcss"
},
"go.lintTool": "staticcheck",
"gopls": {
"analyses": {
"QF1003": false
}
Comment on lines +59 to +62
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Confirm whether gopls recognizes the QF1003 analysis key

I’m not certain gopls.analyses.QF1003 is a supported key (staticcheck uses QF1003, but gopls analyses are typically names like unusedparams, nilness, etc.). If unsupported, gopls will ignore it silently.

Please run this quick web check to confirm support and the recommended way to suppress QF1003 in VS Code:


🌐 Web query:

Does gopls support an analyses key named "QF1003" in settings.json? What’s the recommended way to disable Staticcheck rule QF1003 in VS Code (golang.go + staticcheck)?

💡 Result:

Short answer: Yes — gopls exposes a QF1003 analyzer name and you can disable it. The recommended way in VS Code (with the official Go extension / gopls) is to turn that analyzer off in your gopls settings (settings.json). (tip.golang.org, github.com)

How to do it (recommended)

  • In VS Code open Settings → Open Settings (JSON) and add a gopls UI diagnostic analyses entry to disable QF1003. For example (user or workspace settings.json):

    {
    "gopls": {
    "ui": {
    "diagnostic": {
    "analyses": {
    "QF1003": false
    },
    "staticcheck": true
    }
    }
    }
    }

This tells gopls to stop reporting the QF1003 quickfix. After changing the setting reload VS Code / restart the language server. (github.com, go.dev)

Other options (if they apply)

  • If you run staticcheck separately (CLI, CI, or via golangci-lint), disable QF1003 in staticcheck’s config by adding a minus entry to the checks list in staticcheck.conf (TOML). Example staticcheck.conf:

    checks = ["all", "-QF1003"]

Staticcheck also supports project-wide config and will ignore checks configured in staticcheck.conf. (staticcheck.dev)

  • Per-line or per-file: you can silence a specific occurrence with staticcheck linter directives in the source:
    • Line: //lint:ignore QF1003 reason
    • File: //lint:file-ignore QF1003 reason
      These are useful for individual exceptions. (staticcheck.dev)

Notes / caveats

  • gopls ships its own set of analyzers (including the QF quickfixes). The analyses map (and the vscode-go UI.diagnostic.analyses mapping) is the preferred way to tune what gopls reports in the editor. If you also enable staticcheck as a separate tool or via golangci-lint, disable the check there too (or use the staticcheck.conf) to keep behavior consistent. (tip.golang.org, staticcheck.dev)

If you want, tell me whether you want the setting applied globally or only for the workspace and I can produce the exact JSON snippet to paste into your settings.json (or the TOML for staticcheck.conf).

Citations:


Update gopls settings to disable QF1003 in the correct section

The QF1003 analyzer is valid, but gopls expects it under gopls.ui.diagnostic.analyses, not directly under gopls.analyses. As written, your setting will be ignored.

Please adjust your VS Code settings.json to something like:

 .vscode/settings.json
@@
-   "gopls": {
-       "analyses": {
-           "QF1003": false
-       }
-   }
+   "gopls": {
+     "ui": {
+       "diagnostic": {
+         "analyses": {
+           "QF1003": false
+         },
+         "staticcheck": true
+       }
+     }
+   }

• After updating, reload VS Code or restart gopls to apply.
• If you also run staticcheck standalone, remember to disable QF1003 there (e.g. in staticcheck.conf: checks = ["all", "-QF1003"]). 1

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"gopls": {
"analyses": {
"QF1003": false
}
"gopls": {
"ui": {
"diagnostic": {
"analyses": {
"QF1003": false
},
"staticcheck": true
}
}
}
🤖 Prompt for AI Agents
.vscode/settings.json around lines 60-63: the QF1003 analyzer is currently
placed under "gopls.analyses" which gopls ignores; move the setting into
"gopls.ui.diagnostic.analyses" as "QF1003": false so gopls will apply it, save
the file and reload VS Code or restart gopls to take effect, and if you run
staticcheck separately also disable QF1003 there (e.g. in staticcheck.conf use
checks = ["all", "-QF1003"]).

}
}
4 changes: 2 additions & 2 deletions docs/docs/config.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ id: "config"
title: "Configuration"
---

import { Kbd } from "@site/src/components/kbd.tsx";
import { PlatformProvider, PlatformSelectorButton } from "@site/src/components/platformcontext.tsx";
import { Kbd } from "@site/src/components/kbd";
import { PlatformProvider, PlatformSelectorButton } from "@site/src/components/platformcontext";

<PlatformProvider>

Expand Down
2 changes: 1 addition & 1 deletion docs/src/components/platformcontext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const PlatformProviderInternal = ({ children }: { children: ReactNode }) => {
);
};

export const PlatformProvider: React.FC = ({ children }: { children: ReactNode }) => {
export const PlatformProvider: React.FC<{ children: ReactNode }> = ({ children }) => {
return (
<BrowserOnly fallback={<div />}>
{() => <PlatformProviderInternal>{children}</PlatformProviderInternal>}
Expand Down
6 changes: 6 additions & 0 deletions electron.vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ export default defineConfig({
"@": "frontend",
},
},
server: {
open: false,
},
define: {
"process.env.WS_NO_BUFFER_UTIL": "true",
"process.env.WS_NO_UTF_8_VALIDATE": "true",
Expand All @@ -47,6 +50,9 @@ export default defineConfig({
},
outDir: "dist/preload",
},
server: {
open: false,
},
plugins: [tsconfigPaths(), flow()],
},
renderer: {
Expand Down
2 changes: 1 addition & 1 deletion emain/emain-tabview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export class WaveTabView extends WebContentsView {
});
wcIdToWaveTabMap.set(this.webContents.id, this);
if (isDevVite) {
this.webContents.loadURL(`${process.env.ELECTRON_RENDERER_URL}/index.html}`);
this.webContents.loadURL(`${process.env.ELECTRON_RENDERER_URL}/index.html`);
} else {
this.webContents.loadFile(path.join(getElectronAppBasePath(), "frontend", "index.html"));
}
Expand Down
4 changes: 3 additions & 1 deletion emain/emain-util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ export function handleCtrlShiftState(sender: Electron.WebContents, waveEvent: Wa
}

export function shNavHandler(event: Electron.Event<Electron.WebContentsWillNavigateEventParams>, url: string) {
if (url.startsWith("http://127.0.0.1:5173/index.html") || url.startsWith("http://localhost:5173/index.html")) {
const isDev = !electron.app.isPackaged;
if (isDev && (url.startsWith("http://127.0.0.1:5173/index.html") || url.startsWith("http://localhost:5173/index.html") ||
url.startsWith("http://127.0.0.1:5174/index.html") || url.startsWith("http://localhost:5174/index.html"))) {
// this is a dev-mode hot-reload, ignore it
console.log("allowing hot-reload of index.html");
return;
Expand Down
54 changes: 30 additions & 24 deletions frontend/app/view/preview/directorypreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -386,15 +386,15 @@ function DirectoryTable({
useLayoutEffect(() => {
const rows = table.getRowModel()?.flatRows;
let foundParentDir = false;

for (const row of rows) {
if (row.getValue("name") == "..") {
row.pin("top");
foundParentDir = true;
break;
}
}

// If we didn't find the ".." row, reset the pinning to avoid stale references
if (!foundParentDir) {
table.resetRowPinning();
Expand Down Expand Up @@ -520,34 +520,39 @@ function TableBody({
}: TableBodyProps) {
const dummyLineRef = useRef<HTMLDivElement>();
const warningBoxRef = useRef<HTMLDivElement>();
const rowRefs = useRef<HTMLDivElement[]>([]);
const conn = useAtomValue(model.connection);
const setErrorMsg = useSetAtom(model.errorMsgAtom);

useEffect(() => {
if (focusIndex !== null && rowRefs.current[focusIndex] && bodyRef.current && osRef) {
const viewport = osRef.osInstance().elements().viewport;
const viewportHeight = viewport.offsetHeight;
const rowElement = rowRefs.current[focusIndex];
const rowRect = rowElement.getBoundingClientRect();
const parentRect = viewport.getBoundingClientRect();
const viewportScrollTop = viewport.scrollTop;
const rowTopRelativeToViewport = rowRect.top - parentRect.top + viewport.scrollTop;
const rowBottomRelativeToViewport = rowRect.bottom - parentRect.top + viewport.scrollTop;
if (rowTopRelativeToViewport - 30 < viewportScrollTop) {
// Row is above the visible area
let topVal = rowTopRelativeToViewport - 30;
if (topVal < 0) {
topVal = 0;
}
viewport.scrollTo({ top: topVal });
} else if (rowBottomRelativeToViewport + 5 > viewportScrollTop + viewportHeight) {
// Row is below the visible area
const topVal = rowBottomRelativeToViewport - viewportHeight + 5;
viewport.scrollTo({ top: topVal });
if (focusIndex === null || !bodyRef.current || !osRef) {
return;
}

const rowElement = bodyRef.current.querySelector(`[data-rowindex="${focusIndex}"]`) as HTMLDivElement;
if (!rowElement) {
return;
}

const viewport = osRef.osInstance().elements().viewport;
const viewportHeight = viewport.offsetHeight;
const rowRect = rowElement.getBoundingClientRect();
const parentRect = viewport.getBoundingClientRect();
const viewportScrollTop = viewport.scrollTop;
const rowTopRelativeToViewport = rowRect.top - parentRect.top + viewport.scrollTop;
const rowBottomRelativeToViewport = rowRect.bottom - parentRect.top + viewport.scrollTop;

if (rowTopRelativeToViewport - 30 < viewportScrollTop) {
// Row is above the visible area
let topVal = rowTopRelativeToViewport - 30;
if (topVal < 0) {
topVal = 0;
}
viewport.scrollTo({ top: topVal });
} else if (rowBottomRelativeToViewport + 5 > viewportScrollTop + viewportHeight) {
// Row is below the visible area
const topVal = rowBottomRelativeToViewport - viewportHeight + 5;
viewport.scrollTo({ top: topVal });
}
// setIndexChangedFromClick(false);
}, [focusIndex]);

const handleFileContextMenu = useCallback(
Expand Down Expand Up @@ -730,6 +735,7 @@ const TableRow = React.forwardRef(function ({
return (
<div
className={clsx("dir-table-body-row", { focused: focusIndex === idx })}
data-rowindex={idx}
onDoubleClick={() => {
const newFileName = row.getValue("path") as string;
model.goHistory(newFileName);
Expand Down
2 changes: 2 additions & 0 deletions staticcheck.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
checks = ["all", "-ST1005", "-QF1003", "-ST1000", "-ST1003"]

Loading