Skip to content

Commit

Permalink
LSP: Make C++ line adjustment more comprehensive.
Browse files Browse the repository at this point in the history
  • Loading branch information
petervdonovan committed Jan 12, 2022
1 parent e8c4f9c commit 909e433
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions org.lflang/src/org/lflang/generator/cpp/CppGenerator.kt
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,10 @@ class CppGenerator(
if (!r.isGeneric)
cppSources.add(sourceFile)
codeMaps[fileConfig.srcGenPath.resolve(sourceFile)] = reactorCodeMap
val headerCodeMap = CodeMap.fromGeneratedCode(generator.generateHeader())
codeMaps[fileConfig.srcGenPath.resolve(headerFile)] = headerCodeMap

fsa.generateFile(relSrcGenPath.resolve(headerFile).toString(), generator.generateHeader())
fsa.generateFile(relSrcGenPath.resolve(headerFile).toString(), headerCodeMap.generatedCode)
fsa.generateFile(relSrcGenPath.resolve(sourceFile).toString(), reactorCodeMap.generatedCode)
}

Expand All @@ -140,8 +142,10 @@ class CppGenerator(
val preambleCodeMap = CodeMap.fromGeneratedCode(generator.generateSource())
cppSources.add(sourceFile)
codeMaps[fileConfig.srcGenPath.resolve(sourceFile)] = preambleCodeMap
val headerCodeMap = CodeMap.fromGeneratedCode(generator.generateHeader())
codeMaps[fileConfig.srcGenPath.resolve(headerFile)] = headerCodeMap

fsa.generateFile(relSrcGenPath.resolve(headerFile).toString(), generator.generateHeader())
fsa.generateFile(relSrcGenPath.resolve(headerFile).toString(), headerCodeMap.generatedCode)
fsa.generateFile(relSrcGenPath.resolve(sourceFile).toString(), preambleCodeMap.generatedCode)
}

Expand Down

0 comments on commit 909e433

Please sign in to comment.