File tree 2 files changed +3
-15
lines changed
src/Lean/Server/Completion
2 files changed +3
-15
lines changed Original file line number Diff line number Diff line change @@ -209,18 +209,6 @@ section IdCompletionUtils
209
209
(Name.mkStr p (s.extract 0 ⟨newLen - optDot - len⟩), newLen)
210
210
(go id).1
211
211
212
- def matchNamespace (ns : Name) (nsFragment : Name) (danglingDot : Bool) : Bool :=
213
- if danglingDot then
214
- if nsFragment != ns && nsFragment.isPrefixOf ns then
215
- true
216
- else
217
- false
218
- else
219
- match ns, nsFragment with
220
- | .str p₁ s₁, .str p₂ s₂ =>
221
- if p₁ == p₂ then s₂.charactersIn s₁ else false
222
- | _, _ => false
223
-
224
212
def bestLabelForDecl? (ctx : ContextInfo) (declName : Name) (id : Name) (danglingDot : Bool) :
225
213
M (Option Name) := Prod.snd <$> StateT.run (s := none) do
226
214
let matchUsingNamespace (ns : Name) : StateT (Option Name) M Unit := do
@@ -270,7 +258,7 @@ section DotCompletionUtils
270
258
| _ => false
271
259
if isConstOf then
272
260
return true
273
- let some e ← unfoldeDefinitionGuarded ? e | return false
261
+ let some e ← unfoldDefinitionGuarded ? e | return false
274
262
isDefEqToAppOf e declName
275
263
276
264
private def isDotCompletionMethod (typeName : Name) (info : ConstantInfo) : MetaM Bool :=
Original file line number Diff line number Diff line change 66
66
else
67
67
shortenIn id contextNamespace.getPrefix
68
68
69
- def unfoldeDefinitionGuarded ? (e : Expr) : MetaM (Option Expr) :=
69
+ def unfoldDefinitionGuarded ? (e : Expr) : MetaM (Option Expr) :=
70
70
try Lean.Meta.unfoldDefinition? e catch _ => pure none
71
71
72
72
partial def getDotCompletionTypeNames (type : Expr) : MetaM (Array Name) :=
78
78
if isStructure (← getEnv) typeName then
79
79
for parentName in (← getAllParentStructures typeName) do
80
80
modify fun s => s.push parentName
81
- let some type ← unfoldeDefinitionGuarded ? type | return ()
81
+ let some type ← unfoldDefinitionGuarded ? type | return ()
82
82
visit type
83
83
84
84
end Lean.Server.Completion
You can’t perform that action at this time.
0 commit comments