Fix bound scope sometimes losing static variables defined in json

This commit is contained in:
Deukhoofd 2018-12-12 22:43:04 +01:00
parent d1c0a61bd1
commit d6b65a8d16
No known key found for this signature in database
GPG Key ID: B4C087AC81641654
2 changed files with 3 additions and 1 deletions

View File

@ -85,6 +85,9 @@ namespace UpsilonLanguageServer
public static void LoadStaticVariables(string fileContent) 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; StaticScope.BoundScope = StaticScope.CreateStandardLibrary().Item2;
var json = JObject.Parse(fileContent); var json = JObject.Parse(fileContent);
foreach (var property in json.Properties()) foreach (var property in json.Properties())

View File

@ -40,7 +40,6 @@ namespace UpsilonLanguageServer
{ {
ThrowExceptionOnError = false, ThrowExceptionOnError = false,
SaveDataComments = true, SaveDataComments = true,
}; };
private static async Task RealLint(TextDocument document, int maxNumberOfProblems, SessionDocument session, private static async Task RealLint(TextDocument document, int maxNumberOfProblems, SessionDocument session,