diff --git a/Client/server/Upsilon.dll b/Client/server/Upsilon.dll
index 388e02b..e3322f6 100644
Binary files a/Client/server/Upsilon.dll and b/Client/server/Upsilon.dll differ
diff --git a/Client/server/Upsilon.pdb b/Client/server/Upsilon.pdb
index fe0c504..55dcd59 100644
Binary files a/Client/server/Upsilon.pdb and b/Client/server/Upsilon.pdb differ
diff --git a/Client/server/UpsilonLanguageServer.dll b/Client/server/UpsilonLanguageServer.dll
index c620088..0bc6f9e 100644
Binary files a/Client/server/UpsilonLanguageServer.dll and b/Client/server/UpsilonLanguageServer.dll differ
diff --git a/Client/server/UpsilonLanguageServer.pdb b/Client/server/UpsilonLanguageServer.pdb
index ea53913..1461d3b 100644
Binary files a/Client/server/UpsilonLanguageServer.pdb and b/Client/server/UpsilonLanguageServer.pdb differ
diff --git a/Client/upsilon-language-extension-1.0.0.vsix b/Client/upsilon-language-extension-1.0.0.vsix
index c9012ba..1fe4eca 100644
Binary files a/Client/upsilon-language-extension-1.0.0.vsix and b/Client/upsilon-language-extension-1.0.0.vsix differ
diff --git a/UpsilonLanguageServer/.idea/.idea.UpsilonLanguageServer/.idea/workspace.xml b/UpsilonLanguageServer/.idea/.idea.UpsilonLanguageServer/.idea/workspace.xml
index dcd54fa..f2419f3 100644
--- a/UpsilonLanguageServer/.idea/.idea.UpsilonLanguageServer/.idea/workspace.xml
+++ b/UpsilonLanguageServer/.idea/.idea.UpsilonLanguageServer/.idea/workspace.xml
@@ -23,35 +23,29 @@
-
-
-
-
-
-
-
+
+
+
-
-
+
+
+
+
-
-
+
+
-
+
+
-
-
-
-
-
@@ -66,38 +60,112 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -207,30 +1469,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -371,10 +1609,10 @@
-
+
@@ -523,7 +1761,7 @@
-
+
1543180742884
@@ -770,11 +2008,18 @@
1550145109290
-
+
+ 1550513532453
+
+
+
+ 1550513532454
+
+
-
+
@@ -825,9 +2070,34 @@
+
+
+
-
@@ -852,7 +2122,8 @@
-
+
+
@@ -906,32 +2177,45 @@
-
- file://$PROJECT_DIR$/UpsilonLanguageServer/Services/TextDocumentServer.cs
- 169
-
-
-
-
-
-
-
-
-
-
file://$PROJECT_DIR$/UpsilonLanguageServer/ReferenceHandler/LoadReferenceLibraries.cs
- 115
+ 126
-
+
-
+
+
+ file://$PROJECT_DIR$/UpsilonLanguageServer/Services/TextDocumentServer.cs
+ 241
+
+
+
+
+
+
+
+
+
+
+
+ file://$PROJECT_DIR$/UpsilonLanguageServer/Services/TextDocumentServer.cs
+ 285
+
+
+
+
+
+
+
+
+
+
@@ -1064,13 +2348,6 @@
-
-
-
-
-
-
-
@@ -1186,13 +2463,6 @@
-
-
-
-
-
-
-
@@ -1285,13 +2555,6 @@
-
-
-
-
-
-
-
@@ -1299,11 +2562,1259 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
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-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/UpsilonLanguageServer/Lib/Upsilon.dll b/UpsilonLanguageServer/Lib/Upsilon.dll
index 388e02b..e3322f6 100644
Binary files a/UpsilonLanguageServer/Lib/Upsilon.dll and b/UpsilonLanguageServer/Lib/Upsilon.dll differ
diff --git a/UpsilonLanguageServer/Lib/Upsilon.pdb b/UpsilonLanguageServer/Lib/Upsilon.pdb
index fe0c504..55dcd59 100644
Binary files a/UpsilonLanguageServer/Lib/Upsilon.pdb and b/UpsilonLanguageServer/Lib/Upsilon.pdb differ
diff --git a/UpsilonLanguageServer/UpsilonLanguageServer/ReferenceHandler/LoadReferenceLibraries.cs b/UpsilonLanguageServer/UpsilonLanguageServer/ReferenceHandler/LoadReferenceLibraries.cs
index 6e75d00..a41ac52 100644
--- a/UpsilonLanguageServer/UpsilonLanguageServer/ReferenceHandler/LoadReferenceLibraries.cs
+++ b/UpsilonLanguageServer/UpsilonLanguageServer/ReferenceHandler/LoadReferenceLibraries.cs
@@ -6,7 +6,11 @@ using Mono.Cecil;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Upsilon.BaseTypes.UserData;
+using Upsilon.Binder;
+using Upsilon.Binder.VariableSymbols;
using Upsilon.BoundTypes;
+using Upsilon.StandardLibraries;
+using Type = Upsilon.BaseTypes.Type;
namespace UpsilonLanguageServer.ReferenceHandler
{
@@ -42,7 +46,7 @@ namespace UpsilonLanguageServer.ReferenceHandler
private static Dictionary _translatedType;
- private static void LoadAssemblies(List locations)
+ private static void LoadAssemblies(IReadOnlyCollection locations)
{
var resolver = new DefaultAssemblyResolver();
foreach (var location in locations)
@@ -52,19 +56,23 @@ namespace UpsilonLanguageServer.ReferenceHandler
}
_translatedType = new Dictionary();
- var dictionary = locations.Select(x =>
- ModuleDefinition.ReadModule(x, new ReaderParameters() {AssemblyResolver = resolver}))
- .SelectMany(file => file.Types, (file, type) => GetDefinitions(type))
- .SelectMany(definitions => definitions)
- .ToDictionary(definition => definition.Item1, definition => definition.Item2);
+ var types = locations.Select(x =>
+ ModuleDefinition.ReadModule(x, new ReaderParameters() {AssemblyResolver = resolver}))
+ .SelectMany(y => y.Types)
+ .ToArray();
- foreach (var definition in dictionary)
+ var requiredUserDataAttribute = typeof(UpsilonUserDataAttribute).FullName;
+ var userDataTypes = types
+ .SelectMany(x => GetDefinitions(x, requiredUserDataAttribute))
+ .ToDictionary(x => x.Item1, x => x.Item2);
+
+ foreach (var definition in userDataTypes)
{
_translatedType.Add(definition.Value.FullName, definition.Key);
}
var result = new Dictionary();
- foreach (var definition in dictionary)
+ foreach (var definition in userDataTypes)
{
var name = definition.Key;
var type = definition.Value;
@@ -100,7 +108,10 @@ namespace UpsilonLanguageServer.ReferenceHandler
ActualType = y.Value.Type,
IsOptional = y.Value.IsOptional
}).ToArray(), false);
- }).ToList()));
+ }).ToList())
+ {
+ Type = Type.Function
+ });
}
else
{
@@ -116,37 +127,44 @@ namespace UpsilonLanguageServer.ReferenceHandler
BoundTypeHandler.LoadUserDataTypeDefinition(new UserDataBoundTypeDefinition(name, dic));
}
}
- }
- private static Type GetMonoType(this TypeReference type)
- {
- return Type.GetType(type.GetReflectionName(), true);
- }
+ var requiredStaticAttribute = typeof(UpsilonCreateStaticAttribute).FullName;
+ var staticUserDataTypes = types
+ .SelectMany(x => GetDefinitions(x, requiredStaticAttribute))
+ .ToDictionary(x => x.Item1, x => x.Item2);
- private static string GetReflectionName(this TypeReference type)
- {
- if (type.IsGenericInstance)
+ foreach (var staticUserDataType in staticUserDataTypes)
{
- var genericInstance = (GenericInstanceType)type;
- return
- $"{genericInstance.Namespace}.{type.Name}[{string.Join(",", genericInstance.GenericArguments.Select(p => p.GetReflectionName()).ToArray())}]";
+ var variableSymbol = CreateVariableSymbol(staticUserDataType.Key, staticUserDataType.Value);
+ StaticScope.BoundScope.AssignToNearest(variableSymbol);
}
- return type.FullName;
}
- private static List<(string, TypeDefinition)> GetDefinitions(TypeDefinition typeDefinition)
+ private static VariableSymbol CreateVariableSymbol(string name, TypeDefinition def)
+ {
+ var type = BoundTypeParser.ParseType(name);
+ if (type == Type.UserData)
+ {
+ var boundTypeName = _translatedType[def.FullName];
+ var boundType = BoundTypeHandler.GetTypeDefinition(boundTypeName);
+ return new UserDataVariableSymbol(name, boundType, true);
+ }
+ return new VariableSymbol(name, type, true);
+ }
+
+ private static List<(string, TypeDefinition)> GetDefinitions(TypeDefinition typeDefinition,
+ string requiredAttribute)
{
var ls = new List<(string, TypeDefinition)>();
foreach (var nestedType in typeDefinition.NestedTypes)
{
- var definitions = GetDefinitions(nestedType);
+ var definitions = GetDefinitions(nestedType, requiredAttribute);
if (definitions.Count > 0)
{
ls.AddRange(definitions);
}
}
- var requiredAttribute = typeof(UpsilonUserDataAttribute).FullName;
if (!typeDefinition.HasCustomAttributes) return ls;
foreach (var customAttribute in typeDefinition.CustomAttributes)
{
diff --git a/UpsilonLanguageServer/UpsilonLanguageServer/Services/InitializationService.cs b/UpsilonLanguageServer/UpsilonLanguageServer/Services/InitializationService.cs
index 0cb4c84..7db79c4 100644
--- a/UpsilonLanguageServer/UpsilonLanguageServer/Services/InitializationService.cs
+++ b/UpsilonLanguageServer/UpsilonLanguageServer/Services/InitializationService.cs
@@ -7,6 +7,8 @@ using JsonRpc.Standard.Contracts;
using JsonRpc.Standard.Server;
using LanguageServer.VsCode.Contracts;
using Newtonsoft.Json.Linq;
+using UpsilonLanguageServer.ReferenceHandler;
+
// ReSharper disable UnusedMember.Global
namespace UpsilonLanguageServer.Services
@@ -38,6 +40,13 @@ namespace UpsilonLanguageServer.Services
Session.Settings.ModuleDirectory =
new DirectoryInfo(Path.Combine(rootUri.AbsolutePath, Session.Settings.ModuleDirectory))
.FullName;
+
+ var referenceConfigFile = configPath + "/references.json";
+ if (File.Exists(referenceConfigFile))
+ {
+ LoadReferenceLibraries.ReloadReferences(WorkspaceService.RootUri,
+ File.ReadAllText(referenceConfigFile));
+ }
}
}
catch (Exception e)
diff --git a/UpsilonLanguageServer/UpsilonLanguageServer/Services/WorkspaceService.cs b/UpsilonLanguageServer/UpsilonLanguageServer/Services/WorkspaceService.cs
index f53d072..65c4eb5 100644
--- a/UpsilonLanguageServer/UpsilonLanguageServer/Services/WorkspaceService.cs
+++ b/UpsilonLanguageServer/UpsilonLanguageServer/Services/WorkspaceService.cs
@@ -113,6 +113,12 @@ namespace UpsilonLanguageServer.Services
try
{
LoadReferenceLibraries.ReloadReferences(RootUri, File.ReadAllText(localPath));
+ foreach (var doc in Session.Documents.Values)
+ {
+ var diag = await DiagnosticProvider.LintDocument(doc.Document, doc,
+ Session.Settings.MaxNumberOfProblems, Session.Settings.ModuleDirectory);
+ await Client.Document.PublishDiagnostics(doc.Document.Uri, diag);
+ }
}
catch (Exception e)
{
diff --git a/UpsilonLanguageServer/UpsilonLanguageServer/bin/Debug/netcoreapp2.1/Upsilon.dll b/UpsilonLanguageServer/UpsilonLanguageServer/bin/Debug/netcoreapp2.1/Upsilon.dll
index 388e02b..e3322f6 100644
Binary files a/UpsilonLanguageServer/UpsilonLanguageServer/bin/Debug/netcoreapp2.1/Upsilon.dll and b/UpsilonLanguageServer/UpsilonLanguageServer/bin/Debug/netcoreapp2.1/Upsilon.dll differ
diff --git a/UpsilonLanguageServer/UpsilonLanguageServer/bin/Debug/netcoreapp2.1/Upsilon.pdb b/UpsilonLanguageServer/UpsilonLanguageServer/bin/Debug/netcoreapp2.1/Upsilon.pdb
index fe0c504..55dcd59 100644
Binary files a/UpsilonLanguageServer/UpsilonLanguageServer/bin/Debug/netcoreapp2.1/Upsilon.pdb and b/UpsilonLanguageServer/UpsilonLanguageServer/bin/Debug/netcoreapp2.1/Upsilon.pdb differ
diff --git a/UpsilonLanguageServer/UpsilonLanguageServer/bin/Debug/netcoreapp2.1/UpsilonLanguageServer.dll b/UpsilonLanguageServer/UpsilonLanguageServer/bin/Debug/netcoreapp2.1/UpsilonLanguageServer.dll
index c620088..0bc6f9e 100644
Binary files a/UpsilonLanguageServer/UpsilonLanguageServer/bin/Debug/netcoreapp2.1/UpsilonLanguageServer.dll and b/UpsilonLanguageServer/UpsilonLanguageServer/bin/Debug/netcoreapp2.1/UpsilonLanguageServer.dll differ
diff --git a/UpsilonLanguageServer/UpsilonLanguageServer/bin/Debug/netcoreapp2.1/UpsilonLanguageServer.pdb b/UpsilonLanguageServer/UpsilonLanguageServer/bin/Debug/netcoreapp2.1/UpsilonLanguageServer.pdb
index ea53913..1461d3b 100644
Binary files a/UpsilonLanguageServer/UpsilonLanguageServer/bin/Debug/netcoreapp2.1/UpsilonLanguageServer.pdb and b/UpsilonLanguageServer/UpsilonLanguageServer/bin/Debug/netcoreapp2.1/UpsilonLanguageServer.pdb differ
diff --git a/UpsilonLanguageServer/UpsilonLanguageServer/bin/Debug/netcoreapp2.1/publish/Upsilon.dll b/UpsilonLanguageServer/UpsilonLanguageServer/bin/Debug/netcoreapp2.1/publish/Upsilon.dll
index 388e02b..e3322f6 100644
Binary files a/UpsilonLanguageServer/UpsilonLanguageServer/bin/Debug/netcoreapp2.1/publish/Upsilon.dll and b/UpsilonLanguageServer/UpsilonLanguageServer/bin/Debug/netcoreapp2.1/publish/Upsilon.dll differ
diff --git a/UpsilonLanguageServer/UpsilonLanguageServer/bin/Debug/netcoreapp2.1/publish/Upsilon.pdb b/UpsilonLanguageServer/UpsilonLanguageServer/bin/Debug/netcoreapp2.1/publish/Upsilon.pdb
index fe0c504..55dcd59 100644
Binary files a/UpsilonLanguageServer/UpsilonLanguageServer/bin/Debug/netcoreapp2.1/publish/Upsilon.pdb and b/UpsilonLanguageServer/UpsilonLanguageServer/bin/Debug/netcoreapp2.1/publish/Upsilon.pdb differ
diff --git a/UpsilonLanguageServer/UpsilonLanguageServer/bin/Debug/netcoreapp2.1/publish/UpsilonLanguageServer.dll b/UpsilonLanguageServer/UpsilonLanguageServer/bin/Debug/netcoreapp2.1/publish/UpsilonLanguageServer.dll
index c620088..0bc6f9e 100644
Binary files a/UpsilonLanguageServer/UpsilonLanguageServer/bin/Debug/netcoreapp2.1/publish/UpsilonLanguageServer.dll and b/UpsilonLanguageServer/UpsilonLanguageServer/bin/Debug/netcoreapp2.1/publish/UpsilonLanguageServer.dll differ
diff --git a/UpsilonLanguageServer/UpsilonLanguageServer/bin/Debug/netcoreapp2.1/publish/UpsilonLanguageServer.pdb b/UpsilonLanguageServer/UpsilonLanguageServer/bin/Debug/netcoreapp2.1/publish/UpsilonLanguageServer.pdb
index ea53913..1461d3b 100644
Binary files a/UpsilonLanguageServer/UpsilonLanguageServer/bin/Debug/netcoreapp2.1/publish/UpsilonLanguageServer.pdb and b/UpsilonLanguageServer/UpsilonLanguageServer/bin/Debug/netcoreapp2.1/publish/UpsilonLanguageServer.pdb differ
diff --git a/UpsilonLanguageServer/UpsilonLanguageServer/obj/Debug/netcoreapp2.1/UpsilonLanguageServer.csprojAssemblyReference.cache b/UpsilonLanguageServer/UpsilonLanguageServer/obj/Debug/netcoreapp2.1/UpsilonLanguageServer.csprojAssemblyReference.cache
index 9ea9060..8ba31b8 100644
Binary files a/UpsilonLanguageServer/UpsilonLanguageServer/obj/Debug/netcoreapp2.1/UpsilonLanguageServer.csprojAssemblyReference.cache and b/UpsilonLanguageServer/UpsilonLanguageServer/obj/Debug/netcoreapp2.1/UpsilonLanguageServer.csprojAssemblyReference.cache differ
diff --git a/UpsilonLanguageServer/UpsilonLanguageServer/obj/Debug/netcoreapp2.1/UpsilonLanguageServer.dll b/UpsilonLanguageServer/UpsilonLanguageServer/obj/Debug/netcoreapp2.1/UpsilonLanguageServer.dll
index c620088..0bc6f9e 100644
Binary files a/UpsilonLanguageServer/UpsilonLanguageServer/obj/Debug/netcoreapp2.1/UpsilonLanguageServer.dll and b/UpsilonLanguageServer/UpsilonLanguageServer/obj/Debug/netcoreapp2.1/UpsilonLanguageServer.dll differ
diff --git a/UpsilonLanguageServer/UpsilonLanguageServer/obj/Debug/netcoreapp2.1/UpsilonLanguageServer.pdb b/UpsilonLanguageServer/UpsilonLanguageServer/obj/Debug/netcoreapp2.1/UpsilonLanguageServer.pdb
index ea53913..1461d3b 100644
Binary files a/UpsilonLanguageServer/UpsilonLanguageServer/obj/Debug/netcoreapp2.1/UpsilonLanguageServer.pdb and b/UpsilonLanguageServer/UpsilonLanguageServer/obj/Debug/netcoreapp2.1/UpsilonLanguageServer.pdb differ