From d6b65a8d1649fb64ab5050a459273ce1a8f7ecb1 Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Wed, 12 Dec 2018 22:43:04 +0100 Subject: [PATCH] Fix bound scope sometimes losing static variables defined in json --- UpsilonLanguageServer/UpsilonLanguageServer/BoundTypeParser.cs | 3 +++ .../UpsilonLanguageServer/DiagnosticsProvider.cs | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/UpsilonLanguageServer/UpsilonLanguageServer/BoundTypeParser.cs b/UpsilonLanguageServer/UpsilonLanguageServer/BoundTypeParser.cs index fc1b739..a3ac5ad 100644 --- a/UpsilonLanguageServer/UpsilonLanguageServer/BoundTypeParser.cs +++ b/UpsilonLanguageServer/UpsilonLanguageServer/BoundTypeParser.cs @@ -85,6 +85,9 @@ namespace UpsilonLanguageServer public static void LoadStaticVariables(string fileContent) { + // We call the evaluation scope so that it initializes, and won't overwrite the bound scope later on + // DONT REMOVE + var _ = StaticScope.Scope; StaticScope.BoundScope = StaticScope.CreateStandardLibrary().Item2; var json = JObject.Parse(fileContent); foreach (var property in json.Properties()) diff --git a/UpsilonLanguageServer/UpsilonLanguageServer/DiagnosticsProvider.cs b/UpsilonLanguageServer/UpsilonLanguageServer/DiagnosticsProvider.cs index 5496d60..dfe004c 100644 --- a/UpsilonLanguageServer/UpsilonLanguageServer/DiagnosticsProvider.cs +++ b/UpsilonLanguageServer/UpsilonLanguageServer/DiagnosticsProvider.cs @@ -40,7 +40,6 @@ namespace UpsilonLanguageServer { ThrowExceptionOnError = false, SaveDataComments = true, - }; private static async Task RealLint(TextDocument document, int maxNumberOfProblems, SessionDocument session,