From bb6fcbd9ebbd8d47636feee1bb52fedd13660821 Mon Sep 17 00:00:00 2001 From: Tamir Bahar Date: Sat, 21 Feb 2026 15:45:01 +0200 Subject: [PATCH 1/3] Update readme --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index d90e638e..e8b6758f 100644 --- a/README.md +++ b/README.md @@ -68,3 +68,5 @@ Additionally, the view will automatically pan to the highlighted node when it ch - [Python](https://tmr232.github.io/function-graph-overview/?language=python) - [TypesScript](https://tmr232.github.io/function-graph-overview/?language=typescript) & [TSX]((https://tmr232.github.io/function-graph-overview/?language=tsx)) - [JavaScript](https://tmr232.github.io/function-graph-overview/?language=typescript) & [JSX]((https://tmr232.github.io/function-graph-overview/?language=tsx)) +- [C#](https://tmr232.github.io/function-graph-overview/?language=csharp) +- [Java](https://tmr232.github.io/function-graph-overview/?language=java) \ No newline at end of file From 879e826589b207670bb92396fc46e962f6d14ff8 Mon Sep 17 00:00:00 2001 From: Tamir Bahar Date: Wed, 18 Feb 2026 22:37:19 +0200 Subject: [PATCH 2/3] Initial support for Visual Studio --- src/webview/src/App.svelte | 54 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/src/webview/src/App.svelte b/src/webview/src/App.svelte index afd8ae87..04a3f375 100644 --- a/src/webview/src/App.svelte +++ b/src/webview/src/App.svelte @@ -27,6 +27,23 @@ declare global { setHighlight: (highlight: boolean) => void; }; }; + VisualStudio?: { + /** + * Functions the VS extension can use to call into the WebView + */ + ToWebview?: { + setColors: (colors: string, isDark:boolean, backgroundColor:string, foregroundColor:string) => void; + setCode: (code: string, offset: number, language: string) => void; + setSimplify: (simplify: boolean) => void; + setFlatSwitch: (flatSwitch: boolean) => void; + setHighlight: (highlight: boolean) => void; + }; + }; + chrome?: { + webview?: { + postMessage: (message: string) => void; + }; + }; } } @@ -195,9 +212,46 @@ declare global { }); } + function initVisualStudio(stateHandler: StateHandler): void { + function setColors(colors: string, isDark:boolean, backgroundColor:string, foregroundColor:string) { + try { + colorList = deserializeColorList(colors); + document.body.style.backgroundColor = colorList.find( + ({ name }) => name === "graph.background", + ).hex; + + document.documentElement.style.setProperty("--jetbrains-editor-background", backgroundColor); + document.documentElement.style.setProperty("--jetbrains-editor-foreground", foregroundColor); + document.documentElement.style.setProperty("--jetbrains-color-scheme", isDark?"dark":"light"); + } catch (error) { + console.trace(error); + return; + } + } + + window.VisualStudio ??= {}; + window.VisualStudio.ToWebview = { + setSimplify: (flag: boolean) => + stateHandler.update({ config: { simplify: flag } }), + setFlatSwitch: (flag: boolean) => + stateHandler.update({ config: { flatSwitch: flag } }), + setHighlight: (flag: boolean) => + stateHandler.update({ config: { highlight: flag } }), + setCode, + setColors, + }; + + stateHandler.onNavigateTo((offset: number) => { + window.chrome?.webview?.postMessage( + JSON.stringify({ tag: "navigateTo", offset }), + ); + }); + } + const stateHandler = new StateHandler(); initVSCode(stateHandler); initJetBrains(stateHandler); + initVisualStudio(stateHandler); function navigateTo( e: CustomEvent<{ node: string; offset: number | null }>, From e119dd1b72d32e64bf3499ec5d1f8ab2d743aac4 Mon Sep 17 00:00:00 2001 From: Tamir Bahar Date: Sat, 21 Feb 2026 17:18:52 +0200 Subject: [PATCH 3/3] Fix formatting --- src/webview/src/App.svelte | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/webview/src/App.svelte b/src/webview/src/App.svelte index 04a3f375..46507692 100644 --- a/src/webview/src/App.svelte +++ b/src/webview/src/App.svelte @@ -32,7 +32,12 @@ declare global { * Functions the VS extension can use to call into the WebView */ ToWebview?: { - setColors: (colors: string, isDark:boolean, backgroundColor:string, foregroundColor:string) => void; + setColors: ( + colors: string, + isDark: boolean, + backgroundColor: string, + foregroundColor: string, + ) => void; setCode: (code: string, offset: number, language: string) => void; setSimplify: (simplify: boolean) => void; setFlatSwitch: (flatSwitch: boolean) => void;