René's URL Explorer Experiment


Title: Autogenerated documentation: using LSP make call hierarchy graphs · Issue #71 · function61/turbobob · GitHub

Open Graph Title: Autogenerated documentation: using LSP make call hierarchy graphs · Issue #71 · function61/turbobob

X Title: Autogenerated documentation: using LSP make call hierarchy graphs · Issue #71 · function61/turbobob

Description: Motivation Automatically extract important use case call graphs from code to explain high-level flow of the program, perhaps bake that into autogenerated documentation. Implementation Options: Build on top of LSP Pro: lots of languages h...

Open Graph Description: Motivation Automatically extract important use case call graphs from code to explain high-level flow of the program, perhaps bake that into autogenerated documentation. Implementation Options: Buil...

X Description: Motivation Automatically extract important use case call graphs from code to explain high-level flow of the program, perhaps bake that into autogenerated documentation. Implementation Options: Buil...

Opengraph URL: https://github.com/function61/turbobob/issues/71

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Autogenerated documentation: using LSP make call hierarchy graphs","articleBody":"## Motivation\n\nAutomatically extract important use case call graphs from code to explain high-level flow of the program, perhaps bake that into autogenerated documentation.\n\n## Implementation\n\nOptions:\n\n### Build on top of LSP\n\nPro: lots of languages have LSP so we can build on top of giants.\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"log\"\n\t\"log/slog\"\n\t\"os/exec\"\n\n\t\"github.com/sourcegraph/jsonrpc2\"\n\tlsp \"github.com/toitware/go-lsp\"\n\t\"github.com/toitware/go-lsp/lspext\"\n)\n\n// https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/\n\ntype CallHierarchyItem struct {\n\tName           string          `json:\"name\"`\n\tKind           int             `json:\"kind\"`\n\tTags           []int           `json:\"tags,omitempty\"`\n\tDetail         string          `json:\"detail,omitempty\"`\n\tURI            lsp.DocumentURI `json:\"uri\"`\n\tRange          lsp.Range       `json:\"range\"`\n\tSelectionRange lsp.Range       `json:\"selectionRange\"`\n\tData           interface{}     `json:\"data,omitempty\"`\n}\n\ntype CallHierarchyPrepareParams struct {\n\tlsp.TextDocumentPositionParams\n\n\tWorkDoneToken interface{} `json:\"workDoneToken,omitempty\"`\n}\n\ntype CallHierarchyIncomingCall struct {\n\tFrom       CallHierarchyItem `json:\"from\"`\n\tFromRanges []lsp.Range       `json:\"fromRanges\"`\n}\n\ntype CallHierarchyOutgoingCall struct {\n\tTo         CallHierarchyItem `json:\"to\"`\n\tFromRanges []lsp.Range       `json:\"fromRanges\"`\n}\n\n// Minimal stream wrapper for jsonrpc2\ntype stdioStream struct {\n\tio.Reader\n\tio.Writer\n\tio.Closer\n}\n\nvar _ interface {\n\tio.Reader\n\tio.Writer\n\tio.Closer\n} = (*stdioStream)(nil)\n\nfunc hailait() {\n\tctx := context.Background()\n\n\t// Start gopls in stdio mode\n\tcmd := exec.Command(\"bob\", \"tools\", \"langserver\")\n\tstdin, _ := cmd.StdinPipe()\n\tstdout, _ := cmd.StdoutPipe()\n\tcmd.Stderr = cmd.Stdout\n\n\tif err := cmd.Start(); err != nil {\n\t\tlog.Fatal(\"failed to start gopls:\", err)\n\t}\n\n\tstream := jsonrpc2.NewBufferedStream(\u0026stdioStream{stdout, stdin, stdin}, jsonrpc2.VSCodeObjectCodec{})\n\tconn := jsonrpc2.NewConn(ctx, stream, jsonrpc2.HandlerWithError(func(ctx context.Context, c *jsonrpc2.Conn, r *jsonrpc2.Request) (result interface{}, err error) {\n\t\tswitch r.Method {\n\t\tcase \"window/showMessage\":\n\t\t\tlogMessageParams := struct {\n\t\t\t\tMessage string `json:\"message\"`\n\t\t\t\tType    int    `json:\"type\"`\n\t\t\t}{}\n\t\t\tif err := json.Unmarshal(*r.Params, \u0026logMessageParams); err != nil {\n\t\t\t\tpanic(err)\n\t\t\t}\n\t\t\tslog.Info(\"LSP server\", \"kind\", \"show\", \"msg\", logMessageParams.Message, \"type\", logMessageParams.Type)\n\t\t\treturn nil, nil\n\t\tcase \"window/logMessage\":\n\t\t\tlogMessageParams := struct {\n\t\t\t\tMessage string `json:\"message\"`\n\t\t\t\tType    int    `json:\"type\"`\n\t\t\t}{}\n\t\t\tif err := json.Unmarshal(*r.Params, \u0026logMessageParams); err != nil {\n\t\t\t\tpanic(err)\n\t\t\t}\n\t\t\tslog.Info(\"LSP server\", \"kind\", \"log\", \"msg\", logMessageParams.Message, \"type\", logMessageParams.Type)\n\t\t\treturn nil, nil\n\t\tdefault:\n\t\t\tslog.Warn(\"returning error\", \"request\", r.Method, \"params\", string(*r.Params))\n\t\t\treturn nil, errors.New(\"requests not implemented\")\n\t\t}\n\t}))\n\tdefer stream.Close()\n\n\t// ---- Initialize ----\n\tinitReq := lsp.InitializeParams{\n\t\tRootURI: \"file:///workspace\",\n\t}\n\n\tvar initResp lsp.InitializeResult\n\tif err := conn.Call(ctx, \"initialize\", initReq, \u0026initResp); err != nil {\n\t\tlog.Fatal(\"initialize error:\", err)\n\t}\n\n\t// Tell server we're ready\n\t_ = conn.Notify(ctx, \"initialized\", struct{}{})\n\n\t// --- Prepare call hierarchy ---\n\tparams := CallHierarchyPrepareParams{\n\t\tTextDocumentPositionParams: lsp.TextDocumentPositionParams{\n\t\t\tTextDocument: lsp.TextDocumentIdentifier{\n\t\t\t\tURI: initReq.RootURI + \"/pkg/mypkg/example.go\",\n\t\t\t},\n\t\t\tPosition: lsp.Position{ // -1 because positions are 0-based\n\t\t\t\tLine:      114 - 1,\n\t\t\t\tCharacter: 6 - 1,\n\t\t\t},\n\t\t},\n\t}\n\n\tvar items []CallHierarchyItem\n\tif err := conn.Call(ctx, \"textDocument/prepareCallHierarchy\", params, \u0026items); err != nil {\n\t\tlog.Fatal(\"prepareCallHierarchy:\", err)\n\t}\n\n\tif len(items) == 0 {\n\t\tlog.Println(\"No call hierarchy items found at location\")\n\t\treturn\n\t}\n\n\titem := items[0]\n\tfmt.Println(\"Item:\", item.Name)\n\n\t_ = lspext.CacheSetParams{}\n\t// --- Incoming calls ---\n\tvar incoming []CallHierarchyIncomingCall\n\tif err := conn.Call(ctx, \"callHierarchy/incomingCalls\", struct {\n\t\tItem CallHierarchyItem `json:\"item\"`\n\t}{item}, \u0026incoming); err != nil {\n\t\tlog.Fatal(\"incomingCalls: \", err)\n\t}\n\n\tfmt.Println(\"\\nIncoming calls:\")\n\tfor _, c := range incoming {\n\t\tfmt.Println(\"   from:\", c.From.Name)\n\t}\n\n\t// --- Outgoing calls ---\n\t// var outgoing []CallHierarchyOutgoingCall\n\t// if err := conn.Call(ctx, \"callHierarchy/outgoingCalls\", item, \u0026outgoing); err != nil {\n\t// \tlog.Fatal(\"outgoingCalls:\", err)\n\t// }\n\n\t// fmt.Println(\"\\nOutgoing calls:\")\n\t// for _, c := range outgoing {\n\t// \tfmt.Println(\"   to:\", c.To.Name)\n\t// }\n}\n```\n\n`go.mod`:\n\n```\n\tgithub.com/sourcegraph/jsonrpc2 v0.2.1 // indirect\n\tgithub.com/toitware/go-lsp v0.0.0-20240220075859-6b0ca01316f0 // indirect\n```\n\n### SCIP\n\nNot popular implementation, backed by one company with unclear investment on it: https://sourcegraph.com/blog/the-future-of-scip","author":{"url":"https://github.com/joonas-fi","@type":"Person","name":"joonas-fi"},"datePublished":"2025-11-18T10:13:38.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/71/turbobob/issues/71"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:8c63475e-1d0c-5b0d-5b43-ed57034b24ae
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id9394:299B2C:B75C72:FE895E:6A4BDC8F
html-safe-nonce94e1ed1b97fb27c6abd1f8de06f26632bdc8123e59caf15d614b4667deb43d1b
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5Mzk0OjI5OUIyQzpCNzVDNzI6RkU4OTVFOjZBNEJEQzhGIiwidmlzaXRvcl9pZCI6IjQ1ODIzOTY0NDM0OTEwMzIyMDciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac7a6f240aa4e43e4ca5ea0cc7f7450826e0657b86d82411f7cecad561dfddf53e
hovercard-subject-tagissue:3637281918
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/function61/turbobob/71/issue_layout
twitter:imagehttps://opengraph.githubassets.com/724b4399dff6941c50e6876ee87782d14ee31dbbeaf7c19f1a203abfd01ef6fc/function61/turbobob/issues/71
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/724b4399dff6941c50e6876ee87782d14ee31dbbeaf7c19f1a203abfd01ef6fc/function61/turbobob/issues/71
og:image:altMotivation Automatically extract important use case call graphs from code to explain high-level flow of the program, perhaps bake that into autogenerated documentation. Implementation Options: Buil...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamejoonas-fi
hostnamegithub.com
expected-hostnamegithub.com
None9df996be9551ac02247d09a2f7f64ece66c35ca28885d346e98fdfda9cdaa37b
turbo-cache-controlno-preview
go-importgithub.com/function61/turbobob git https://github.com/function61/turbobob.git
octolytics-dimension-user_id22049800
octolytics-dimension-user_loginfunction61
octolytics-dimension-repository_id146426259
octolytics-dimension-repository_nwofunction61/turbobob
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id146426259
octolytics-dimension-repository_network_root_nwofunction61/turbobob
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release7242837c61fe4c8b774b83b9ee05b1881ba589f8
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/function61/turbobob/issues/71#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ffunction61%2Fturbobob%2Fissues%2F71
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ffunction61%2Fturbobob%2Fissues%2F71
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=function61%2Fturbobob
Reloadhttps://github.com/function61/turbobob/issues/71
Reloadhttps://github.com/function61/turbobob/issues/71
Reloadhttps://github.com/function61/turbobob/issues/71
Please reload this pagehttps://github.com/function61/turbobob/issues/71
function61 https://github.com/function61
turbobobhttps://github.com/function61/turbobob
Notifications https://github.com/login?return_to=%2Ffunction61%2Fturbobob
Fork 0 https://github.com/login?return_to=%2Ffunction61%2Fturbobob
Star 8 https://github.com/login?return_to=%2Ffunction61%2Fturbobob
Code https://github.com/function61/turbobob
Issues 32 https://github.com/function61/turbobob/issues
Pull requests 2 https://github.com/function61/turbobob/pulls
Actions https://github.com/function61/turbobob/actions
Security and quality 0 https://github.com/function61/turbobob/security
Insights https://github.com/function61/turbobob/pulse
Code https://github.com/function61/turbobob
Issues https://github.com/function61/turbobob/issues
Pull requests https://github.com/function61/turbobob/pulls
Actions https://github.com/function61/turbobob/actions
Security and quality https://github.com/function61/turbobob/security
Insights https://github.com/function61/turbobob/pulse
Autogenerated documentation: using LSP make call hierarchy graphshttps://github.com/function61/turbobob/issues/71#top
enhancementNew feature or requesthttps://github.com/function61/turbobob/issues?q=state%3Aopen%20label%3A%22enhancement%22
https://github.com/joonas-fi
joonas-fihttps://github.com/joonas-fi
on Nov 18, 2025https://github.com/function61/turbobob/issues/71#issue-3637281918
https://sourcegraph.com/blog/the-future-of-sciphttps://sourcegraph.com/blog/the-future-of-scip
enhancementNew feature or requesthttps://github.com/function61/turbobob/issues?q=state%3Aopen%20label%3A%22enhancement%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.