diff --git a/.vscode/settings.json b/.vscode/settings.json index adfcd21e..8074b168 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,17 +1,4 @@ { - "omnisharp.enableRoslynAnalyzers": true, - "yaml.schemas": { - "samples/generators/angular/topmodel.config.schema.json": "samples/generators/angular/topmodel.config", - "samples/generators/csharp/topmodel.config.schema.json": "samples/generators/csharp/topmodel.config", - "samples/generators/database/topmodel.config.schema.json": "samples/generators/database/topmodel.config", - "samples/generators/focus/topmodel.config.schema.json": "samples/generators/focus/topmodel.config", - "samples/generators/jpa/topmodel.config.schema.json": "samples/generators/jpa/topmodel.config", - "samples/generators/open-api/topmodel.config.schema.json": "samples/generators/open-api/topmodel.config", - "samples/generators/pg/topmodel.config.schema.json": "samples/generators/pg/topmodel.config", - "samples/generators/php/topmodel.config.schema.json": "samples/generators/php/topmodel.config", - "samples/generators/ssdt/topmodel.config.schema.json": "samples/generators/ssdt/topmodel.config", - "samples/generators/translation/topmodel.config.schema.json": "samples/generators/translation/topmodel.config" - }, "dotnet.defaultSolution": "TopModel.sln", "java.configuration.updateBuildConfiguration": "automatic", "java.compile.nullAnalysis.mode": "disabled" diff --git a/TopModel.Utils/TopModelLock.cs b/TopModel.Utils/TopModelLock.cs index b77f6cdd..ccd4321c 100644 --- a/TopModel.Utils/TopModelLock.cs +++ b/TopModel.Utils/TopModelLock.cs @@ -27,6 +27,8 @@ public void Init(ILogger logger) public void Update(string modelRoot, string lockFileName, ILogger logger, IEnumerable generatedFiles) { + GeneratedFiles ??= new(); + var generatedFilesList = generatedFiles .Select(f => f.ToRelative(modelRoot)) .Distinct() @@ -53,10 +55,13 @@ public void Update(string modelRoot, string lockFileName, ILogger logger, IEnume }; fw.WriteLine($"version: {Version}"); - fw.WriteLine("generatedFiles:"); - foreach (var genFile in GeneratedFiles) + if (GeneratedFiles.Count > 0) { - fw.WriteLine($" - {genFile}"); + fw.WriteLine("generatedFiles:"); + foreach (var genFile in GeneratedFiles) + { + fw.WriteLine($" - {genFile}"); + } } } } \ No newline at end of file diff --git a/samples/generators/angular/topmodel.config b/samples/generators/angular/topmodel.config index 1b30e949..3be2794d 100644 --- a/samples/generators/angular/topmodel.config +++ b/samples/generators/angular/topmodel.config @@ -1,3 +1,4 @@ +# yaml-language-server: $schema=./topmodel.config.schema.json --- app: Angular modelRoot: ../../model diff --git a/samples/generators/csharp/topmodel.config b/samples/generators/csharp/topmodel.config index 54d06fce..58bc1979 100644 --- a/samples/generators/csharp/topmodel.config +++ b/samples/generators/csharp/topmodel.config @@ -1,3 +1,4 @@ +# yaml-language-server: $schema=./topmodel.config.schema.json --- app: CSharp modelRoot: ../../model diff --git a/samples/generators/database/topmodel.config b/samples/generators/database/topmodel.config index 5b5f1e75..993b0b06 100644 --- a/samples/generators/database/topmodel.config +++ b/samples/generators/database/topmodel.config @@ -1,3 +1,4 @@ +# yaml-language-server: $schema=./topmodel.config.schema.json --- app: Database modelRoot: ./model diff --git a/samples/generators/focus/topmodel.config b/samples/generators/focus/topmodel.config index a89e9073..1aad248e 100644 --- a/samples/generators/focus/topmodel.config +++ b/samples/generators/focus/topmodel.config @@ -1,3 +1,4 @@ +# yaml-language-server: $schema=./topmodel.config.schema.json --- app: Focus modelRoot: ../../model diff --git a/samples/generators/jpa/topmodel.config b/samples/generators/jpa/topmodel.config index b3471365..cab41384 100644 --- a/samples/generators/jpa/topmodel.config +++ b/samples/generators/jpa/topmodel.config @@ -1,3 +1,4 @@ +# yaml-language-server: $schema=./topmodel.config.schema.json --- app: topmodel.jpa.sample.demo modelRoot: ../../model diff --git a/samples/generators/open-api/topmodel.config b/samples/generators/open-api/topmodel.config index 3338f7be..1624ee19 100644 --- a/samples/generators/open-api/topmodel.config +++ b/samples/generators/open-api/topmodel.config @@ -1,3 +1,4 @@ +# yaml-language-server: $schema=./topmodel.config.schema.json --- app: Petstore lockFileName: petstore.topmodel.lock diff --git a/samples/generators/pg/topmodel.config b/samples/generators/pg/topmodel.config index b103358e..b087fd5f 100644 --- a/samples/generators/pg/topmodel.config +++ b/samples/generators/pg/topmodel.config @@ -1,3 +1,4 @@ +# yaml-language-server: $schema=./topmodel.config.schema.json --- app: pg modelRoot: ../../model diff --git a/samples/generators/php/topmodel.config b/samples/generators/php/topmodel.config index 6312ee62..0dad0f15 100644 --- a/samples/generators/php/topmodel.config +++ b/samples/generators/php/topmodel.config @@ -1,3 +1,4 @@ +# yaml-language-server: $schema=./topmodel.config.schema.json --- app: topmodel.php.sample.demo modelRoot: ../../model diff --git a/samples/generators/ssdt/topmodel.config b/samples/generators/ssdt/topmodel.config index 5b87e35d..923b9384 100644 --- a/samples/generators/ssdt/topmodel.config +++ b/samples/generators/ssdt/topmodel.config @@ -1,3 +1,4 @@ +# yaml-language-server: $schema=./topmodel.config.schema.json --- app: ssdt modelRoot: ../../model diff --git a/samples/generators/translation/topmodel.config b/samples/generators/translation/topmodel.config index 8a1dc6a7..b2ad8209 100644 --- a/samples/generators/translation/topmodel.config +++ b/samples/generators/translation/topmodel.config @@ -1,3 +1,4 @@ +# yaml-language-server: $schema=./topmodel.config.schema.json --- app: Translation modelRoot: ../../model