on master help sign in
language: feature: initial implementation of a 'migrate' command (#1707)
d0ab8cbRobin Krom
src/Development/IDE/State/Rules.hs+5
@@ -20,6 +20,7 @@ module Development.IDE.State.Rules(
20 getDefinition,
20 getDefinition,
21 getDependencies,
21 getDependencies,
22 getDalfDependencies,
22 getDalfDependencies,
23+ getParsedModule,
23 fileFromParsedModule
24 fileFromParsedModule
24 ) where
25 ) where
25
26
@@ -120,6 +121,10 @@ getDefinition :: NormalizedFilePath -> Position -> Action (Maybe Location)
120getDefinition file pos = do
121getDefinition file pos = do
121 fmap (either (const Nothing) id) . runExceptT $ getDefinitionForFile file pos
122 fmap (either (const Nothing) id) . runExceptT $ getDefinitionForFile file pos
122
123
124+-- | Parse the contents of a daml file.
125+getParsedModule :: NormalizedFilePath -> Action (Maybe ParsedModule)
126+getParsedModule file =
127+ eitherToMaybe <$> (runExceptT $ useE GetParsedModule file)
123
128
124------------------------------------------------------------
129------------------------------------------------------------
125-- Internal Actions
130-- Internal Actions