Skip to content

Commit ce69cec

Browse files
authored
fix: #968 (#1164)
1 parent e42922e commit ce69cec

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

src/Env.hs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff 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.
8999
findAllGlobalVariables :: Env -> [Binder]
90100
findAllGlobalVariables env =

src/Repl.hs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,23 +27,15 @@ import System.Exit (exitSuccess)
2727

2828
completeKeywordsAnd :: Context -> String -> [Completion]
2929
completeKeywordsAnd 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",

0 commit comments

Comments
 (0)