on master help sign in
language: feature: initial implementation of a 'migrate' command (#1707)

* language: feature: initial implementation of a 'migrate' command We add a 'migrate' command to daml assistant that generates a project that allows to migrate contract instances from package1 to package2. This first version reads both package1 and package2 from source. As a next step we read only the dalfs from package1, because it might have been created with a different compiler.

commitd0ab8cb29010b124f12ef90ebd6640e911812d50 authorRobin Krom <robin@digitalasset.com> dateMon 17 Jun 2019, 16:40 (7 years ago) parent62270e0
1 file changed+5
src/Development/IDE/State/Rules.hs+5
src/Development/IDE/State/Rules.hs+5
@@ -20,6 +20,7 @@ module Development.IDE.State.Rules(
2020 getDefinition,
2121 getDependencies,
2222 getDalfDependencies,
23+ getParsedModule,
2324 fileFromParsedModule
2425 ) where
2526
@@ -120,6 +121,10 @@ getDefinition :: NormalizedFilePath -> Position -> Action (Maybe Location)
120121getDefinition file pos = do
121122 fmap (either (const Nothing) id) . runExceptT $ getDefinitionForFile file pos
122123
124+-- | Parse the contents of a daml file.
125+getParsedModule :: NormalizedFilePath -> Action (Maybe ParsedModule)
126+getParsedModule file =
127+ eitherToMaybe <$> (runExceptT $ useE GetParsedModule file)
123128
124129------------------------------------------------------------
125130-- Internal Actions