dark
dark copied to clipboard
Show source code for builtin function in the UI
It's useful to users to expose the definition of built-in functions.
If we add a filename and line number to the definition of builtin functions (hopefully using builtin F# features), we could link directly to the code in question (we also have the server's build-hash).
If we also added an ending line number, we could pull in the source code directly from the GitHub raw file.
Phases:
- add filename, starting line number, and ending line number to all stdlib definition
- send these to the client
- use the client to build a link to the function
- parse the github webpage to read the source code
- add a syntax highlighting library.
Or is it simpler to pre-process the dark F# codebase to produce a JSON file of F# code, that we can then put in a CDN?
Copied from duplicate, now-closed #3704:
We should provide users with whatever info they need, and this is sometimes useful information. It also helps users become familiar with our GitHub and the fact that they could contribute.
Rather than encoding this within our F# backend, this could encourage a GitHub API package, with which we:
- fetch all files of pattern
Lib*.fs - extract the fn defs from there, and use that data to support this feature
May be a non-traditional or roundabout approach, but one that we could support wholly from within Dark.
merged into #5237
