Skip to content

Commit 01690e3

Browse files
Fix Reference CodeLenses (ionide#1731)
1 parent 1738c15 commit 01690e3

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/Components/CodeLensHelpers.fs

+7-4
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,15 @@ open Fable.Import.VSCode.Vscode
77

88
module CodeLensHelpers =
99

10-
let showReferences (args: string) (args2: obj) (args3: obj[]) =
11-
let uri = vscode.Uri.parse args
10+
type CustomIExports =
11+
abstract registerCommand: command: string * callback: (obj -> obj -> obj -> obj option) * ?thisArg: obj -> Disposable
12+
13+
let showReferences (args: obj) (args2: obj) (args3: obj) =
14+
let uri = vscode.Uri.parse !!args
1215
let pos = vscode.Position.Create(!!args2?Line, !!args2?Character)
1316

1417
let locs =
15-
args3
18+
!!args3
1619
|> Seq.map (fun f ->
1720
let uri = vscode.Uri.parse !!f?Uri
1821

@@ -30,5 +33,5 @@ module CodeLensHelpers =
3033
commands.executeCommand ("editor.action.showReferences", Some(box uri), Some(box pos), Some(box locs))
3134

3235
let activate (context: ExtensionContext) =
33-
commands.registerCommand ("fsharp.showReferences", showReferences |> objfy4)
36+
(unbox<CustomIExports>commands).registerCommand ("fsharp.showReferences", unbox<(obj -> obj -> obj -> obj option)>(showReferences))
3437
|> context.Subscribe

0 commit comments

Comments
 (0)