Skip to content

Commit

Permalink
Add symbol creation for an operator with a constraint (#6307)
Browse files Browse the repository at this point in the history
This addresses a situaltion where if you request a tooltip for an operator with a constraint no symbol is returned due to:

Item.ImplicitOp(_, { contents = Some(TraitConstraintSln.FSMethSln(_, vref, _)) })
Being turned into a vanilla FSharpSymbol which has no real information about the symbol that the IDE can use.

An corresponding issue was logged for ionide here: ionide/ionide-vscode-fsharp#1025

Corresponding PR at FCS: fsharp#896
  • Loading branch information
7sharp9 authored and baronfel committed Mar 22, 2019
1 parent 5d44ce1 commit 24b5c2c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/fsharp/symbols/Symbols.fs
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,9 @@ type FSharpSymbol(cenv: SymbolEnv, item: (unit -> Item), access: (FSharpSymbol -
| Item.ArgName(id, ty, _) ->
FSharpParameter(cenv, ty, {Attribs=[]; Name=Some id}, Some id.idRange, isParamArrayArg=false, isInArg=false, isOutArg=false, isOptionalArg=false) :> _

| Item.ImplicitOp(_, { contents = Some(TraitConstraintSln.FSMethSln(_, vref, _)) }) ->
FSharpMemberOrFunctionOrValue(cenv, V vref, item) :> _

// TODO: the following don't currently return any interesting subtype
| Item.ImplicitOp _
| Item.ILField _
Expand Down

0 comments on commit 24b5c2c

Please sign in to comment.