New codelens support (2.6) for functions is awesome. Having this also for non-function values would be great as well though. Perhaps having this optional via some setting would be needed though as it might not be for everyone.
There are some problems on FSAC / FCS side of things with it (current method of getting symbols in file used by CodeLens and Ctrl + Shfit + O doesn't return value bindings. ) which makes adding this more complex than expected. It's something I'd want, but not super high priority.
This also applies to vals that are functions.

Sweet feature. Issue also applies to pattern matching function

Worth noticing that if value is uppercase it will work.
I think it's actually FCS bug, probably somewhere in https://github.com/fsharp/FSharp.Compiler.Service/blob/master/src/fsharp/vs/ServiceNavigation.fs#L82-L259
afaik ServiceNavigation was never put into production so its a just one of its limitations. The good news is you can get all the info you want from the symbol api. If theres bugs in that then its my fault as I added it some of it. :-)
I think this function misses SynModuleDecl.Let case: https://github.com/fsharp/FSharp.Compiler.Service/blob/8ecb153f1a0a9809e6283cd4531f4322c63ebd08/src/fsharp/vs/ServiceNavigation.fs#L214
We collect navigable symbols ourselves in VFPT, the relevant function is https://github.com/fsprojects/VisualFSharpPowerTools/blob/master/src/FSharp.Editing/Navigation/NavigableItemsCollector.fs#L192, specifically https://github.com/fsprojects/VisualFSharpPowerTools/blob/master/src/FSharp.Editing/Navigation/NavigableItemsCollector.fs#L198
If nobody is working on fixing this bug, I can try to do it later today.
OK, I've added SynPat.Named to navigable items here https://github.com/vasily-kirichenko/FSharp.Compiler.Service/blob/add-module-values-to-navigable-items/src/fsharp/vs/ServiceNavigation.fs#L136-L137
Now for
module Test1
let foo x = x
let intVal = 1
let stringVal = "foo"
[<EntryPoint>]
let main argv =
printfn "%A" argv
0
declarations returns the following:
[
{
"Declaration": {
"UniqueName": "Test1_1_of_1",
"Name": "Test1",
"Glyph": "Module",
"GlyphChar": "N",
"IsTopLevel": true,
"Range": {
"StartColumn": 1,
"StartLine": 1,
"EndColumn": 6,
"EndLine": 12
},
"BodyRange": {
"StartColumn": 13,
"StartLine": 1,
"EndColumn": 6,
"EndLine": 12
},
"File": "e:\\github\\Test1\\Test1\\Test1.fs"
},
"Nested": [
{
"UniqueName": "Test1_1_of_1",
"Name": "foo",
"Glyph": "Field",
"GlyphChar": "F",
"IsTopLevel": false,
"Range": {
"StartColumn": 5,
"StartLine": 3,
"EndColumn": 14,
"EndLine": 3
},
"BodyRange": {
"StartColumn": 5,
"StartLine": 3,
"EndColumn": 14,
"EndLine": 3
},
"File": "e:\\github\\Test1\\Test1\\Test1.fs"
},
{
"UniqueName": "Test1_1_of_1",
"Name": "intVal",
"Glyph": "Field",
"GlyphChar": "F",
"IsTopLevel": false,
"Range": {
"StartColumn": 5,
"StartLine": 5,
"EndColumn": 11,
"EndLine": 5
},
"BodyRange": {
"StartColumn": 5,
"StartLine": 5,
"EndColumn": 11,
"EndLine": 5
},
"File": "e:\\github\\Test1\\Test1\\Test1.fs"
},
{
"UniqueName": "Test1_1_of_1",
"Name": "main",
"Glyph": "Field",
"GlyphChar": "F",
"IsTopLevel": false,
"Range": {
"StartColumn": 5,
"StartLine": 10,
"EndColumn": 6,
"EndLine": 12
},
"BodyRange": {
"StartColumn": 5,
"StartLine": 10,
"EndColumn": 6,
"EndLine": 12
},
"File": "e:\\github\\Test1\\Test1\\Test1.fs"
},
{
"UniqueName": "Test1_1_of_1",
"Name": "stringVal",
"Glyph": "Field",
"GlyphChar": "F",
"IsTopLevel": false,
"Range": {
"StartColumn": 5,
"StartLine": 7,
"EndColumn": 14,
"EndLine": 7
},
"BodyRange": {
"StartColumn": 5,
"StartLine": 7,
"EndColumn": 14,
"EndLine": 7
},
"File": "e:\\github\\Test1\\Test1\\Test1.fs"
}
]
}
]
result:

I think there are no code lens because F nested declarations are filtered out here https://github.com/ionide/ionide-vscode-fsharp/blob/master/src/Components/CodeLens.fs#L25
I cannot run experimental Code instance, so I cannot fix / test the ionide part.
OK, now it looks like this:

So we have class's internal let binding code lensed, too. Is it OK?
Why not? At least I like it!
:) @sergey-tihon what do you think about not showing code lens on interface members as it duplicates signature 1:1?
Interesting idea... but i think that it probably should work on virtual methods...
type IPrintable =
abstract Print : unit -> unit // do not show here
default __.Print () = () // but show here
in this case you can visually check that they are equal.
Current status:

I've no idea why it does not show signatures for default method implementations.
aha, it seems to relate to tooltip parsing on Code side:

Implemented via https://github.com/ionide/ionide-vscode-fsharp/pull/203
Released in 2.6.10
Most helpful comment
OK, now it looks like this:
So we have class's internal
letbinding code lensed, too. Is it OK?