@@ -184,40 +184,28 @@ type internal FSharpAddOpenCodeFixProvider
184184match symbolwith
185185| Some symbol->
186186let pos = Pos.fromZ textLinePos.Line textLinePos.Character
187- match ParsedInput.getEntityKind parsedInput poswith
187+ let isAttribute = ParsedInput.getEntityKind parsedInput pos= Some EntityKind.Attribute
188+ let entities =
189+ assemblyContentProvider.GetAllEntitiesInProjectAndReferencedAssemblies checkFileResults
190+ |> List.map( fun e ->
191+ [ yield e.TopRequireQualifiedAccessParent, e.AutoOpenParent, e.Namespace, e.CleanedIdents
192+ if isAttributethen
193+ let lastIdent = e.CleanedIdents.[ e.CleanedIdents.Length- 1 ]
194+ if e.Kind= EntityKind.Attribute&& lastIdent.EndsWith" Attribute" then
195+ yield
196+ e.TopRequireQualifiedAccessParent,
197+ e.AutoOpenParent,
198+ e.Namespace,
199+ e.CleanedIdents
200+ |> Array.replace( e.CleanedIdents.Length- 1 ) ( lastIdent.Substring( 0 , lastIdent.Length- 9 )) ])
201+ |> List.concat
202+
203+ let idents = ParsedInput.getLongIdentAt parsedInput( Range.mkPos pos.Line symbol.RightColumn)
204+ match identswith
205+ | Some idents->
206+ let createEntity = ParsedInput.tryFindInsertionContext pos.Line parsedInput idents
207+ return entities|> Seq.map createEntity|> Seq.concat|> Seq.toList|> getSuggestions context
188208| None-> ()
189- | Some entityKind->
190- let isAttribute = entityKind= EntityKind.Attribute
191- let entities =
192- assemblyContentProvider.GetAllEntitiesInProjectAndReferencedAssemblies checkFileResults
193- |> List.filter( fun e ->
194- match entityKind, e.Kindwith
195- | EntityKind.Attribute, EntityKind.Attribute
196- | EntityKind.Type, ( EntityKind.Type| EntityKind.Attribute)
197- | EntityKind.FunctionOrValue_, _ -> true
198- | EntityKind.Attribute, _
199- | _, EntityKind.Module_
200- | EntityKind.Module_, _
201- | EntityKind.Type, _ -> false )
202- |> List.map( fun e ->
203- [ yield e.TopRequireQualifiedAccessParent, e.AutoOpenParent, e.Namespace, e.CleanedIdents
204- if isAttributethen
205- let lastIdent = e.CleanedIdents.[ e.CleanedIdents.Length- 1 ]
206- if e.Kind= EntityKind.Attribute&& lastIdent.EndsWith" Attribute" then
207- yield
208- e.TopRequireQualifiedAccessParent,
209- e.AutoOpenParent,
210- e.Namespace,
211- e.CleanedIdents
212- |> Array.replace( e.CleanedIdents.Length- 1 ) ( lastIdent.Substring( 0 , lastIdent.Length- 9 )) ])
213- |> List.concat
214-
215- let idents = ParsedInput.getLongIdentAt parsedInput( Range.mkPos pos.Line symbol.RightColumn)
216- match identswith
217- | Some idents->
218- let createEntity = ParsedInput.tryFindInsertionContext pos.Line parsedInput idents
219- return entities|> Seq.map createEntity|> Seq.concat|> Seq.toList|> getSuggestions context
220- | None-> ()
221209| None-> ()
222210| None-> ()
223211} |> CommonRoslynHelpers.StartAsyncUnitAsTask( context.CancellationToken)