Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit01068dd

Browse files
dsymeKevinRansom
authored andcommitted
fix 3076: remove duplicated completion items (#3226)
* remove duplicated completion items* remove duplicated completion items (2)
1 parente6d12f8 commit01068dd

File tree

3 files changed

+17
-18
lines changed

3 files changed

+17
-18
lines changed

‎src/fsharp/symbols/SymbolHelpers.fs‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -719,6 +719,10 @@ module internal SymbolHelpers =
719719
letequalTypes(ty1,ty2)=
720720
if isAppTy g ty1&& isAppTy g ty2then tyconRefEq g(tcrefOfAppTy g ty1)(tcrefOfAppTy g ty2)
721721
else typeEquiv g ty1 ty2
722+
723+
ItemsAreEffectivelyEqual g item1 item2||
724+
725+
// Much of this logic is already covered by 'ItemsAreEffectivelyEqual'
722726
match item1,item2with
723727
| Item.DelegateCtor(ty1), Item.DelegateCtor(ty2)-> equalTypes(ty1, ty2)
724728
| Item.Types(dn1,[ty1]), Item.Types(dn2,[ty2])->
@@ -740,15 +744,18 @@ module internal SymbolHelpers =
740744
| Item.MethodGroup(_, meths1,_), Item.MethodGroup(_, meths2,_)->
741745
Seq.zip meths1 meths2|> Seq.forall(fun(minfo1,minfo2)->
742746
MethInfo.MethInfosUseIdenticalDefinitions minfo1 minfo2)
743-
|(Item.Value vref1| Item.CustomBuilder(_,vref1)),(Item.Value vref2| Item.CustomBuilder(_,vref2))-> valRefEq g vref1 vref2
747+
|(Item.Value vref1| Item.CustomBuilder(_,vref1)),(Item.Value vref2| Item.CustomBuilder(_,vref2))->
748+
valRefEq g vref1 vref2
744749
| Item.ActivePatternCase(APElemRef(_apinfo1, vref1, idx1)), Item.ActivePatternCase(APElemRef(_apinfo2, vref2, idx2))->
745750
idx1= idx2&& valRefEq g vref1 vref2
746-
| Item.UnionCase(UnionCaseInfo(_, ur1),_), Item.UnionCase(UnionCaseInfo(_, ur2),_)-> g.unionCaseRefEq ur1 ur2
751+
| Item.UnionCase(UnionCaseInfo(_, ur1),_), Item.UnionCase(UnionCaseInfo(_, ur2),_)->
752+
g.unionCaseRefEq ur1 ur2
747753
| Item.RecdField(RecdFieldInfo(_, RFRef(tcref1, n1))), Item.RecdField(RecdFieldInfo(_, RFRef(tcref2, n2)))->
748754
(tyconRefEq g tcref1 tcref2)&&(n1= n2)// there is no direct function as in the previous case
749755
| Item.Property(_, pi1s), Item.Property(_, pi2s)->
750756
List.zip pi1s pi2s|> List.forall(fun(pi1,pi2)-> PropInfo.PropInfosUseIdenticalDefinitions pi1 pi2)
751-
| Item.Event(evt1), Item.Event(evt2)-> EventInfo.EventInfosUseIdenticalDefintions evt1 evt2
757+
| Item.Event(evt1), Item.Event(evt2)->
758+
EventInfo.EventInfosUseIdenticalDefintions evt1 evt2
752759
| Item.CtorGroup(_, meths1), Item.CtorGroup(_, meths2)->
753760
List.zip meths1 meths2
754761
|> List.forall(fun(minfo1,minfo2)-> MethInfo.MethInfosUseIdenticalDefinitions minfo1 minfo2)

‎src/fsharp/vs/service.fs‎

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -735,7 +735,7 @@ type TypeCheckInfo
735735
letglobalResult=
736736
match origLongIdentOptwith
737737
| None| Some[]->
738-
letallItems=
738+
letglobalItems=
739739
allSymbols()
740740
|> List.filter(fun x->not x.Symbol.IsExplicitlySuppressed)
741741
|> List.filter(fun x->
@@ -745,13 +745,11 @@ type TypeCheckInfo
745745

746746
letgetItem(x:AssemblySymbol)= x.Symbol.Item
747747

748-
match allItems, denv, mwith
749-
| FilterRelevantItems getItem exactMatchResidueOpt(entities, denv, m)whennot(isNil entities)->
750-
// lookup based on name and environment successful
751-
Some(
752-
entities
753-
|> List.map(fun entity->
754-
CompletionItem(getType())(Some entity)(ItemWithNoInst entity.Symbol.Item)), denv, m)
748+
match globalItems, denv, mwith
749+
| FilterRelevantItems getItem exactMatchResidueOpt(globalItemsFiltered, denv, m)whennot(isNil globalItemsFiltered)->
750+
globalItemsFiltered
751+
|> List.map(fun globalItem-> CompletionItem(getType())(Some globalItem)(ItemWithNoInst globalItem.Symbol.Item))
752+
|>fun r-> Some(r, denv, m)
755753
|_-> None
756754
|_-> None// do not return unresolved items after dot
757755

‎vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs‎

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,6 @@ type internal FSharpCompletionProvider
105105
letgetAllSymbols()=
106106
getAllSymbols()|> List.filter(fun entity-> entity.FullName.Contains"."&&not(PrettyNaming.IsOperatorName entity.Symbol.DisplayName))
107107

108-
//#if DEBUG
109-
//let kprintfEntity = allEntities |> List.filter (fun x -> x.FullName.EndsWith "foo")
110-
//Logging.Logging.logInfof "%+A" kprintfEntity
111-
//let _x = kprintfEntity
112-
//#endif
113-
114108
let!declarations=
115109
checkFileResults.GetDeclarationListInfo(Some(parseResults), fcsCaretLineNumber, caretLineColumn, caretLine.ToString(), qualifyingNames, partialName, getAllSymbols, userOpName=userOpName)|> liftAsync
116110

@@ -146,7 +140,7 @@ type internal FSharpCompletionProvider
146140
match declItem.NamespaceToOpenwith
147141
| Some namespaceToOpen-> sprintf"%s (open%s)" declItem.Name namespaceToOpen
148142
|_-> declItem.Name
149-
143+
150144
letfilterText=
151145
match declItem.NamespaceToOpen, declItem.Name.Split'.'with
152146
// There is no namespace to open and the item name does not contain dots, so we don't need to pass special FilterText to Roslyn.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp