File tree Expand file tree Collapse file tree 2 files changed +12
-10
lines changed
Expand file tree Collapse file tree 2 files changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -85,6 +85,16 @@ envBindingNames = concatMap select . envBindings
8585 select (Binder _ (XObj (Mod m) _ _)) = envBindingNames m
8686 select (Binder _ obj) = [getName obj]
8787
88+ envPublicBindingNames :: Env -> [String ]
89+ envPublicBindingNames = concatMap select . envBindings
90+ where
91+ select :: Binder -> [String ]
92+ select (Binder _ (XObj (Mod m) _ _)) = envPublicBindingNames m
93+ select (Binder meta obj) =
94+ if metaIsTrue meta " private" || metaIsTrue meta " hidden"
95+ then []
96+ else [getName obj]
97+
8898-- | Recursively look through all environments for (def ...) forms.
8999findAllGlobalVariables :: Env -> [Binder ]
90100findAllGlobalVariables env =
Original file line number Diff line number Diff line change @@ -27,23 +27,15 @@ import System.Exit (exitSuccess)
2727
2828completeKeywordsAnd :: Context -> String -> [Completion ]
2929completeKeywordsAnd context word =
30- findKeywords word (envBindingNames (contextGlobalEnv context) ++ keywords) []
30+ findKeywords word (envPublicBindingNames (contextGlobalEnv context) ++ keywords) []
3131 where
3232 findKeywords _ [] res = res
3333 findKeywords match (x : xs) res =
3434 if match `isPrefixOf` x
3535 then findKeywords match xs (res ++ [simpleCompletion x])
3636 else findKeywords match xs res
3737 keywords =
38- [ " Int" , -- we should probably have a list of those somewhere
39- " Float" ,
40- " Double" ,
41- " Bool" ,
42- " String" ,
43- " Char" ,
44- " Array" ,
45- " Fn" ,
46- " def" ,
38+ [ " def" ,
4739 " defn" ,
4840 " let" ,
4941 " do" ,
You can’t perform that action at this time.
0 commit comments