Skip to content

Commit 1f464da

Browse files
committed
wip
1 parent 694b21b commit 1f464da

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

Diff for: src/Language/PureScript/Make/IdeCache.hs

+11-4
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,11 @@ sqliteExtern outputDir m docs extern = liftIO $ do
9191

9292
for_ (declChildren d) $ \ch -> do
9393
withRetry $ SQLite.executeNamed conn
94-
("insert into declarations (module_name, name, span, docs, declaration) " <>
95-
"values (:module_name, :name, :span, :docs, :declaration)")
94+
("insert into declarations (module_name, name, namespace, span, docs, declaration) " <>
95+
"values (:module_name, :name, :namespace, :span, :docs, :declaration)")
9696
[ ":module_name" := runModuleName (efModuleName extern)
9797
, ":name" := Docs.cdeclTitle ch
98+
, ":namespace" := childDeclInfoNamespaceIde (Docs.cdeclInfo ch)
9899
, ":span" := Aeson.encode (Docs.declSourceSpan d)
99100
, ":docs" := Docs.cdeclComments ch
100101
, ":declaration" := show d
@@ -181,11 +182,11 @@ sqliteInit outputDir = liftIO $ do
181182
, " module_name text references modules(module_name) on delete cascade,"
182183
, " name text not null,"
183184
, " namespace text,"
184-
, " rexported_from text,"
185-
, " span text,"
186185
, " declaration_type text,"
186+
, " rexported_from text,"
187187
, " type text,"
188188
, " docs text,"
189+
, " span text,"
189190
, " declaration text not null"
190191
, ")"
191192
]
@@ -203,8 +204,14 @@ toDeclarationType (Docs.Declaration _ _ _ _ (Docs.ValueDeclaration _) _) = Value
203204
toDeclarationType (Docs.Declaration _ _ _ _ (Docs.DataDeclaration _ _ _) _) = Type
204205
toDeclarationType (Docs.Declaration _ _ _ _ _ _ ) = Value
205206

207+
toIdeN :: Docs.Namespace -> IdeNamespace
208+
toIdeN Docs.ValueLevel = IdeNSValue
209+
toIdeN Docs.TypeLevel = IdeNSType
206210

207211
toIdeNamespace :: Declaration -> IdeNamespace
208212
toIdeNamespace (Docs.Declaration _ _ _ _ declInfo _) = case Docs.declInfoNamespace declInfo of
209213
Docs.ValueLevel -> IdeNSValue
210214
Docs.TypeLevel -> IdeNSType
215+
216+
childDeclInfoNamespaceIde :: Docs.ChildDeclarationInfo -> IdeNamespace
217+
childDeclInfoNamespaceIde = toIdeN . Docs.childDeclInfoNamespace

0 commit comments

Comments
 (0)