diff --git a/.github/scripts/ubuntu-22.04/setup_build.sh b/.github/scripts/ubuntu-22.04/setup_build.sh
index 99627a015..33aa55739 100755
--- a/.github/scripts/ubuntu-22.04/setup_build.sh
+++ b/.github/scripts/ubuntu-22.04/setup_build.sh
@@ -1,8 +1,10 @@
#!/bin/bash
# Install required packages for CodeCompass build
-sudo apt install git cmake make g++ libboost-all-dev \
+sudo apt-get install --yes \
+ git cmake make g++ libboost-all-dev \
llvm-15-dev clang-15 libclang-15-dev \
gcc-11-plugin-dev thrift-compiler libthrift-dev \
default-jdk libssl-dev libgraphviz-dev libmagic-dev libgit2-dev exuberant-ctags doxygen \
- libldap2-dev libgtest-dev
\ No newline at end of file
+ libldap2-dev libgtest-dev \
+ dotnet-sdk-8.0
diff --git a/.gitignore b/.gitignore
index 66ec4b2d1..b3a52364a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,10 +9,8 @@ nbproject/
# Vim
*.swp
-
## Build folders
build/
build_*/
install/
install_*/
-
diff --git a/FindThrift.cmake b/FindThrift.cmake
index 0a44c0fde..6e654d5d9 100644
--- a/FindThrift.cmake
+++ b/FindThrift.cmake
@@ -15,7 +15,7 @@ find_path(libthrift_INCLUDE_DIR
find_library(libthrift_LIBRARY
NAMES thrift libthrift
HINTS
- ${THIRFT_LIBRARY_PATH}
+ ${THRIFT_LIBRARY_PATH}
${PC_LIBTHIRFT_LIBRARY_DIRS})
find_program(thrift_BIN
diff --git a/docker/dev/Dockerfile b/docker/dev/Dockerfile
index 1619c9bd5..3adcf5d51 100644
--- a/docker/dev/Dockerfile
+++ b/docker/dev/Dockerfile
@@ -8,6 +8,7 @@ ARG DEBIAN_FRONTEND=noninteractive
# CodeCompass development dependencies.
RUN set -x && apt-get update -qq \
&& apt-get -y install --no-install-recommends \
+ wget \
cmake make \
default-jdk \
universal-ctags \
@@ -27,6 +28,7 @@ RUN set -x && apt-get update -qq \
libsqlite3-dev \
libssl-dev \
llvm-15 clang-15 llvm-15-dev libclang-15-dev \
+ dotnet-sdk-8.0 \
thrift-compiler libthrift-dev \
postgresql-server-dev-14 \
postgresql-14 && \
diff --git a/docker/runtime/Dockerfile b/docker/runtime/Dockerfile
index 49b87eb29..6d455a443 100644
--- a/docker/runtime/Dockerfile
+++ b/docker/runtime/Dockerfile
@@ -56,6 +56,7 @@ RUN set -x && apt-get update -qq && \
curl ca-certificates gnupg \
wget \
llvm-15 \
+ dotnet-sdk-8.0 \
libboost-filesystem-dev libboost-log-dev libboost-program-options-dev \
default-jre \
libgit2-dev \
diff --git a/docker/web/Dockerfile b/docker/web/Dockerfile
index 4780bb7ec..c9ade42aa 100644
--- a/docker/web/Dockerfile
+++ b/docker/web/Dockerfile
@@ -17,7 +17,9 @@ ARG DEBIAN_FRONTEND=noninteractive
RUN set -x && apt-get update -qq \
&& apt-get install -qqy --no-install-recommends \
+ wget \
llvm-15 \
+ dotnet-sdk-8.0 \
libboost-filesystem-dev libboost-log-dev libboost-program-options-dev \
libsqlite3-dev \
postgresql-server-dev-14 \
diff --git a/plugins/csharp/.gitignore b/plugins/csharp/.gitignore
new file mode 100644
index 000000000..239ae2c95
--- /dev/null
+++ b/plugins/csharp/.gitignore
@@ -0,0 +1,5 @@
+# C#
+bin/
+obj/
+*.out
+*.bak
\ No newline at end of file
diff --git a/plugins/csharp/CMakeLists.txt b/plugins/csharp/CMakeLists.txt
new file mode 100644
index 000000000..121a8d43f
--- /dev/null
+++ b/plugins/csharp/CMakeLists.txt
@@ -0,0 +1,11 @@
+# Set .NET build configuration based on CMAKE_BUILD_TYPE
+if(CMAKE_BUILD_TYPE STREQUAL "Debug")
+ set(DOTNET_CONFIG "Debug")
+else()
+ set(DOTNET_CONFIG "Release")
+endif()
+
+add_subdirectory(parser)
+add_subdirectory(service)
+
+install_webplugin(webgui)
\ No newline at end of file
diff --git a/plugins/csharp/migrations/20220518134047_Initial.Designer.cs b/plugins/csharp/migrations/20220518134047_Initial.Designer.cs
new file mode 100644
index 000000000..0a7707b34
--- /dev/null
+++ b/plugins/csharp/migrations/20220518134047_Initial.Designer.cs
@@ -0,0 +1,545 @@
+//
+using System;
+using CSharpParser.model;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
+
+namespace CSharpParser.Migrations
+{
+ [DbContext(typeof(CsharpDbContext))]
+ [Migration("20220518134047_Initial")]
+ partial class Initial
+ {
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("Relational:MaxIdentifierLength", 63)
+ .HasAnnotation("ProductVersion", "5.0.10")
+ .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
+
+ modelBuilder.Entity("CSharpParser.model.CsharpAstNode", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("numeric(20,0)");
+
+ b.Property("Accessibility")
+ .HasColumnType("integer");
+
+ b.Property("AstSymbolType")
+ .HasColumnType("integer");
+
+ b.Property("AstType")
+ .HasColumnType("integer");
+
+ b.Property("AstValue")
+ .HasColumnType("text");
+
+ b.Property("EntityHash")
+ .HasColumnType("bigint");
+
+ b.Property("Location_range_end_column")
+ .HasColumnType("bigint");
+
+ b.Property("Location_range_end_line")
+ .HasColumnType("bigint");
+
+ b.Property("Location_range_start_column")
+ .HasColumnType("bigint");
+
+ b.Property("Location_range_start_line")
+ .HasColumnType("bigint");
+
+ b.Property("Path")
+ .HasColumnType("text");
+
+ b.Property("RawKind")
+ .HasColumnType("integer");
+
+ b.HasKey("Id");
+
+ b.ToTable("CsharpAstNodes");
+ });
+
+ modelBuilder.Entity("CSharpParser.model.CsharpClass", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint")
+ .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
+
+ b.Property("AstNodeId")
+ .HasColumnType("numeric(20,0)");
+
+ b.Property("ClassType")
+ .HasColumnType("integer");
+
+ b.Property("CsharpNamespaceId")
+ .HasColumnType("bigint");
+
+ b.Property("DocumentationCommentXML")
+ .HasColumnType("text");
+
+ b.Property("EntityHash")
+ .HasColumnType("bigint");
+
+ b.Property("Name")
+ .HasColumnType("text");
+
+ b.Property("ParentNodeId")
+ .HasColumnType("numeric(20,0)");
+
+ b.Property("QualifiedName")
+ .HasColumnType("text");
+
+ b.HasKey("Id");
+
+ b.HasIndex("AstNodeId");
+
+ b.HasIndex("CsharpNamespaceId");
+
+ b.HasIndex("ParentNodeId");
+
+ b.ToTable("CsharpClasses");
+ });
+
+ modelBuilder.Entity("CSharpParser.model.CsharpEnum", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint")
+ .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
+
+ b.Property("AstNodeId")
+ .HasColumnType("numeric(20,0)");
+
+ b.Property("CsharpNamespaceId")
+ .HasColumnType("bigint");
+
+ b.Property("DocumentationCommentXML")
+ .HasColumnType("text");
+
+ b.Property("EntityHash")
+ .HasColumnType("bigint");
+
+ b.Property("Name")
+ .HasColumnType("text");
+
+ b.Property("ParentNodeId")
+ .HasColumnType("numeric(20,0)");
+
+ b.Property("QualifiedName")
+ .HasColumnType("text");
+
+ b.HasKey("Id");
+
+ b.HasIndex("AstNodeId");
+
+ b.HasIndex("CsharpNamespaceId");
+
+ b.HasIndex("ParentNodeId");
+
+ b.ToTable("CsharpEnums");
+ });
+
+ modelBuilder.Entity("CSharpParser.model.CsharpEnumMember", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint")
+ .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
+
+ b.Property("AstNodeId")
+ .HasColumnType("numeric(20,0)");
+
+ b.Property("CsharpEnumId")
+ .HasColumnType("bigint");
+
+ b.Property("DocumentationCommentXML")
+ .HasColumnType("text");
+
+ b.Property("EntityHash")
+ .HasColumnType("bigint");
+
+ b.Property("EqualsValue")
+ .HasColumnType("integer");
+
+ b.Property("Name")
+ .HasColumnType("text");
+
+ b.Property("ParentNodeId")
+ .HasColumnType("numeric(20,0)");
+
+ b.Property("QualifiedName")
+ .HasColumnType("text");
+
+ b.HasKey("Id");
+
+ b.HasIndex("AstNodeId");
+
+ b.HasIndex("CsharpEnumId");
+
+ b.HasIndex("ParentNodeId");
+
+ b.ToTable("CsharpEnumMembers");
+ });
+
+ modelBuilder.Entity("CSharpParser.model.CsharpEtcEntity", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint")
+ .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
+
+ b.Property("AstNodeId")
+ .HasColumnType("numeric(20,0)");
+
+ b.Property("DeclaratorNodeId")
+ .HasColumnType("numeric(20,0)");
+
+ b.Property("DocumentationCommentXML")
+ .HasColumnType("text");
+
+ b.Property("EntityHash")
+ .HasColumnType("bigint");
+
+ b.Property("EtcEntityType")
+ .HasColumnType("integer");
+
+ b.Property("Name")
+ .HasColumnType("text");
+
+ b.Property("ParentNodeId")
+ .HasColumnType("numeric(20,0)");
+
+ b.Property("QualifiedName")
+ .HasColumnType("text");
+
+ b.Property("QualifiedType")
+ .HasColumnType("text");
+
+ b.Property("TypeHash")
+ .HasColumnType("bigint");
+
+ b.HasKey("Id");
+
+ b.HasIndex("AstNodeId");
+
+ b.HasIndex("ParentNodeId");
+
+ b.ToTable("CsharpEtcEntitys");
+ });
+
+ modelBuilder.Entity("CSharpParser.model.CsharpMethod", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint")
+ .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
+
+ b.Property("AstNodeId")
+ .HasColumnType("numeric(20,0)");
+
+ b.Property("DocumentationCommentXML")
+ .HasColumnType("text");
+
+ b.Property("EntityHash")
+ .HasColumnType("bigint");
+
+ b.Property("MethodType")
+ .HasColumnType("integer");
+
+ b.Property("Name")
+ .HasColumnType("text");
+
+ b.Property("ParentNodeId")
+ .HasColumnType("numeric(20,0)");
+
+ b.Property("QualifiedName")
+ .HasColumnType("text");
+
+ b.Property("QualifiedType")
+ .HasColumnType("text");
+
+ b.Property("TypeHash")
+ .HasColumnType("bigint");
+
+ b.HasKey("Id");
+
+ b.HasIndex("AstNodeId");
+
+ b.HasIndex("ParentNodeId");
+
+ b.ToTable("CsharpMethods");
+ });
+
+ modelBuilder.Entity("CSharpParser.model.CsharpNamespace", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint")
+ .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
+
+ b.Property("AstNodeId")
+ .HasColumnType("numeric(20,0)");
+
+ b.Property("DocumentationCommentXML")
+ .HasColumnType("text");
+
+ b.Property("EntityHash")
+ .HasColumnType("bigint");
+
+ b.Property("Name")
+ .HasColumnType("text");
+
+ b.Property("ParentNodeId")
+ .HasColumnType("numeric(20,0)");
+
+ b.Property("QualifiedName")
+ .HasColumnType("text");
+
+ b.HasKey("Id");
+
+ b.HasIndex("AstNodeId");
+
+ b.HasIndex("ParentNodeId");
+
+ b.ToTable("CsharpNamespaces");
+ });
+
+ modelBuilder.Entity("CSharpParser.model.CsharpStruct", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint")
+ .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
+
+ b.Property("AstNodeId")
+ .HasColumnType("numeric(20,0)");
+
+ b.Property("CsharpNamespaceId")
+ .HasColumnType("bigint");
+
+ b.Property("DocumentationCommentXML")
+ .HasColumnType("text");
+
+ b.Property("EntityHash")
+ .HasColumnType("bigint");
+
+ b.Property("Name")
+ .HasColumnType("text");
+
+ b.Property("ParentNodeId")
+ .HasColumnType("numeric(20,0)");
+
+ b.Property("QualifiedName")
+ .HasColumnType("text");
+
+ b.HasKey("Id");
+
+ b.HasIndex("AstNodeId");
+
+ b.HasIndex("CsharpNamespaceId");
+
+ b.HasIndex("ParentNodeId");
+
+ b.ToTable("CsharpStructs");
+ });
+
+ modelBuilder.Entity("CSharpParser.model.CsharpVariable", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint")
+ .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
+
+ b.Property("AstNodeId")
+ .HasColumnType("numeric(20,0)");
+
+ b.Property("DocumentationCommentXML")
+ .HasColumnType("text");
+
+ b.Property("EntityHash")
+ .HasColumnType("bigint");
+
+ b.Property("Name")
+ .HasColumnType("text");
+
+ b.Property("ParentNodeId")
+ .HasColumnType("numeric(20,0)");
+
+ b.Property("QualifiedName")
+ .HasColumnType("text");
+
+ b.Property("QualifiedType")
+ .HasColumnType("text");
+
+ b.Property("TypeHash")
+ .HasColumnType("bigint");
+
+ b.Property("VariableType")
+ .HasColumnType("integer");
+
+ b.HasKey("Id");
+
+ b.HasIndex("AstNodeId");
+
+ b.HasIndex("ParentNodeId");
+
+ b.ToTable("CsharpVariables");
+ });
+
+ modelBuilder.Entity("CSharpParser.model.CsharpClass", b =>
+ {
+ b.HasOne("CSharpParser.model.CsharpAstNode", "AstNode")
+ .WithMany()
+ .HasForeignKey("AstNodeId");
+
+ b.HasOne("CSharpParser.model.CsharpNamespace", "CsharpNamespace")
+ .WithMany()
+ .HasForeignKey("CsharpNamespaceId");
+
+ b.HasOne("CSharpParser.model.CsharpAstNode", "ParentNode")
+ .WithMany()
+ .HasForeignKey("ParentNodeId");
+
+ b.Navigation("AstNode");
+
+ b.Navigation("CsharpNamespace");
+
+ b.Navigation("ParentNode");
+ });
+
+ modelBuilder.Entity("CSharpParser.model.CsharpEnum", b =>
+ {
+ b.HasOne("CSharpParser.model.CsharpAstNode", "AstNode")
+ .WithMany()
+ .HasForeignKey("AstNodeId");
+
+ b.HasOne("CSharpParser.model.CsharpNamespace", "CsharpNamespace")
+ .WithMany()
+ .HasForeignKey("CsharpNamespaceId");
+
+ b.HasOne("CSharpParser.model.CsharpAstNode", "ParentNode")
+ .WithMany()
+ .HasForeignKey("ParentNodeId");
+
+ b.Navigation("AstNode");
+
+ b.Navigation("CsharpNamespace");
+
+ b.Navigation("ParentNode");
+ });
+
+ modelBuilder.Entity("CSharpParser.model.CsharpEnumMember", b =>
+ {
+ b.HasOne("CSharpParser.model.CsharpAstNode", "AstNode")
+ .WithMany()
+ .HasForeignKey("AstNodeId");
+
+ b.HasOne("CSharpParser.model.CsharpEnum", null)
+ .WithMany("CsharpEnumMembers")
+ .HasForeignKey("CsharpEnumId");
+
+ b.HasOne("CSharpParser.model.CsharpAstNode", "ParentNode")
+ .WithMany()
+ .HasForeignKey("ParentNodeId");
+
+ b.Navigation("AstNode");
+
+ b.Navigation("ParentNode");
+ });
+
+ modelBuilder.Entity("CSharpParser.model.CsharpEtcEntity", b =>
+ {
+ b.HasOne("CSharpParser.model.CsharpAstNode", "AstNode")
+ .WithMany()
+ .HasForeignKey("AstNodeId");
+
+ b.HasOne("CSharpParser.model.CsharpAstNode", "ParentNode")
+ .WithMany()
+ .HasForeignKey("ParentNodeId");
+
+ b.Navigation("AstNode");
+
+ b.Navigation("ParentNode");
+ });
+
+ modelBuilder.Entity("CSharpParser.model.CsharpMethod", b =>
+ {
+ b.HasOne("CSharpParser.model.CsharpAstNode", "AstNode")
+ .WithMany()
+ .HasForeignKey("AstNodeId");
+
+ b.HasOne("CSharpParser.model.CsharpAstNode", "ParentNode")
+ .WithMany()
+ .HasForeignKey("ParentNodeId");
+
+ b.Navigation("AstNode");
+
+ b.Navigation("ParentNode");
+ });
+
+ modelBuilder.Entity("CSharpParser.model.CsharpNamespace", b =>
+ {
+ b.HasOne("CSharpParser.model.CsharpAstNode", "AstNode")
+ .WithMany()
+ .HasForeignKey("AstNodeId");
+
+ b.HasOne("CSharpParser.model.CsharpAstNode", "ParentNode")
+ .WithMany()
+ .HasForeignKey("ParentNodeId");
+
+ b.Navigation("AstNode");
+
+ b.Navigation("ParentNode");
+ });
+
+ modelBuilder.Entity("CSharpParser.model.CsharpStruct", b =>
+ {
+ b.HasOne("CSharpParser.model.CsharpAstNode", "AstNode")
+ .WithMany()
+ .HasForeignKey("AstNodeId");
+
+ b.HasOne("CSharpParser.model.CsharpNamespace", "CsharpNamespace")
+ .WithMany()
+ .HasForeignKey("CsharpNamespaceId");
+
+ b.HasOne("CSharpParser.model.CsharpAstNode", "ParentNode")
+ .WithMany()
+ .HasForeignKey("ParentNodeId");
+
+ b.Navigation("AstNode");
+
+ b.Navigation("CsharpNamespace");
+
+ b.Navigation("ParentNode");
+ });
+
+ modelBuilder.Entity("CSharpParser.model.CsharpVariable", b =>
+ {
+ b.HasOne("CSharpParser.model.CsharpAstNode", "AstNode")
+ .WithMany()
+ .HasForeignKey("AstNodeId");
+
+ b.HasOne("CSharpParser.model.CsharpAstNode", "ParentNode")
+ .WithMany()
+ .HasForeignKey("ParentNodeId");
+
+ b.Navigation("AstNode");
+
+ b.Navigation("ParentNode");
+ });
+
+ modelBuilder.Entity("CSharpParser.model.CsharpEnum", b =>
+ {
+ b.Navigation("CsharpEnumMembers");
+ });
+#pragma warning restore 612, 618
+ }
+ }
+}
diff --git a/plugins/csharp/migrations/20220518134047_Initial.cs b/plugins/csharp/migrations/20220518134047_Initial.cs
new file mode 100644
index 000000000..e643a7a6a
--- /dev/null
+++ b/plugins/csharp/migrations/20220518134047_Initial.cs
@@ -0,0 +1,443 @@
+using Microsoft.EntityFrameworkCore.Migrations;
+using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
+
+namespace CSharpParser.Migrations
+{
+ public partial class Initial : Migration
+ {
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.CreateTable(
+ name: "CsharpAstNodes",
+ columns: table => new
+ {
+ Id = table.Column(type: "numeric(20,0)", nullable: false),
+ AstValue = table.Column(type: "text", nullable: true),
+ AstSymbolType = table.Column(type: "integer", nullable: false),
+ AstType = table.Column(type: "integer", nullable: false),
+ Accessibility = table.Column(type: "integer", nullable: false),
+ Location_range_start_line = table.Column(type: "bigint", nullable: false),
+ Location_range_start_column = table.Column(type: "bigint", nullable: false),
+ Location_range_end_line = table.Column(type: "bigint", nullable: false),
+ Location_range_end_column = table.Column(type: "bigint", nullable: false),
+ Path = table.Column(type: "text", nullable: true),
+ EntityHash = table.Column(type: "bigint", nullable: false),
+ RawKind = table.Column(type: "integer", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_CsharpAstNodes", x => x.Id);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "CsharpEtcEntitys",
+ columns: table => new
+ {
+ Id = table.Column(type: "bigint", nullable: false)
+ .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
+ EtcEntityType = table.Column(type: "integer", nullable: false),
+ DeclaratorNodeId = table.Column(type: "numeric(20,0)", nullable: false),
+ AstNodeId = table.Column(type: "numeric(20,0)", nullable: true),
+ ParentNodeId = table.Column(type: "numeric(20,0)", nullable: true),
+ EntityHash = table.Column(type: "bigint", nullable: false),
+ Name = table.Column(type: "text", nullable: true),
+ QualifiedName = table.Column(type: "text", nullable: true),
+ DocumentationCommentXML = table.Column(type: "text", nullable: true),
+ TypeHash = table.Column(type: "bigint", nullable: false),
+ QualifiedType = table.Column(type: "text", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_CsharpEtcEntitys", x => x.Id);
+ table.ForeignKey(
+ name: "FK_CsharpEtcEntitys_CsharpAstNodes_AstNodeId",
+ column: x => x.AstNodeId,
+ principalTable: "CsharpAstNodes",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Restrict);
+ table.ForeignKey(
+ name: "FK_CsharpEtcEntitys_CsharpAstNodes_ParentNodeId",
+ column: x => x.ParentNodeId,
+ principalTable: "CsharpAstNodes",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Restrict);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "CsharpMethods",
+ columns: table => new
+ {
+ Id = table.Column(type: "bigint", nullable: false)
+ .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
+ MethodType = table.Column(type: "integer", nullable: false),
+ AstNodeId = table.Column(type: "numeric(20,0)", nullable: true),
+ ParentNodeId = table.Column(type: "numeric(20,0)", nullable: true),
+ EntityHash = table.Column(type: "bigint", nullable: false),
+ Name = table.Column(type: "text", nullable: true),
+ QualifiedName = table.Column(type: "text", nullable: true),
+ DocumentationCommentXML = table.Column(type: "text", nullable: true),
+ TypeHash = table.Column(type: "bigint", nullable: false),
+ QualifiedType = table.Column(type: "text", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_CsharpMethods", x => x.Id);
+ table.ForeignKey(
+ name: "FK_CsharpMethods_CsharpAstNodes_AstNodeId",
+ column: x => x.AstNodeId,
+ principalTable: "CsharpAstNodes",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Restrict);
+ table.ForeignKey(
+ name: "FK_CsharpMethods_CsharpAstNodes_ParentNodeId",
+ column: x => x.ParentNodeId,
+ principalTable: "CsharpAstNodes",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Restrict);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "CsharpNamespaces",
+ columns: table => new
+ {
+ Id = table.Column(type: "bigint", nullable: false)
+ .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
+ AstNodeId = table.Column(type: "numeric(20,0)", nullable: true),
+ ParentNodeId = table.Column(type: "numeric(20,0)", nullable: true),
+ EntityHash = table.Column(type: "bigint", nullable: false),
+ Name = table.Column(type: "text", nullable: true),
+ QualifiedName = table.Column(type: "text", nullable: true),
+ DocumentationCommentXML = table.Column(type: "text", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_CsharpNamespaces", x => x.Id);
+ table.ForeignKey(
+ name: "FK_CsharpNamespaces_CsharpAstNodes_AstNodeId",
+ column: x => x.AstNodeId,
+ principalTable: "CsharpAstNodes",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Restrict);
+ table.ForeignKey(
+ name: "FK_CsharpNamespaces_CsharpAstNodes_ParentNodeId",
+ column: x => x.ParentNodeId,
+ principalTable: "CsharpAstNodes",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Restrict);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "CsharpVariables",
+ columns: table => new
+ {
+ Id = table.Column(type: "bigint", nullable: false)
+ .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
+ VariableType = table.Column(type: "integer", nullable: false),
+ AstNodeId = table.Column(type: "numeric(20,0)", nullable: true),
+ ParentNodeId = table.Column(type: "numeric(20,0)", nullable: true),
+ EntityHash = table.Column(type: "bigint", nullable: false),
+ Name = table.Column(type: "text", nullable: true),
+ QualifiedName = table.Column(type: "text", nullable: true),
+ DocumentationCommentXML = table.Column(type: "text", nullable: true),
+ TypeHash = table.Column(type: "bigint", nullable: false),
+ QualifiedType = table.Column(type: "text", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_CsharpVariables", x => x.Id);
+ table.ForeignKey(
+ name: "FK_CsharpVariables_CsharpAstNodes_AstNodeId",
+ column: x => x.AstNodeId,
+ principalTable: "CsharpAstNodes",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Restrict);
+ table.ForeignKey(
+ name: "FK_CsharpVariables_CsharpAstNodes_ParentNodeId",
+ column: x => x.ParentNodeId,
+ principalTable: "CsharpAstNodes",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Restrict);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "CsharpClasses",
+ columns: table => new
+ {
+ Id = table.Column(type: "bigint", nullable: false)
+ .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
+ ClassType = table.Column(type: "integer", nullable: false),
+ CsharpNamespaceId = table.Column(type: "bigint", nullable: true),
+ AstNodeId = table.Column(type: "numeric(20,0)", nullable: true),
+ ParentNodeId = table.Column(type: "numeric(20,0)", nullable: true),
+ EntityHash = table.Column(type: "bigint", nullable: false),
+ Name = table.Column(type: "text", nullable: true),
+ QualifiedName = table.Column(type: "text", nullable: true),
+ DocumentationCommentXML = table.Column(type: "text", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_CsharpClasses", x => x.Id);
+ table.ForeignKey(
+ name: "FK_CsharpClasses_CsharpAstNodes_AstNodeId",
+ column: x => x.AstNodeId,
+ principalTable: "CsharpAstNodes",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Restrict);
+ table.ForeignKey(
+ name: "FK_CsharpClasses_CsharpAstNodes_ParentNodeId",
+ column: x => x.ParentNodeId,
+ principalTable: "CsharpAstNodes",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Restrict);
+ table.ForeignKey(
+ name: "FK_CsharpClasses_CsharpNamespaces_CsharpNamespaceId",
+ column: x => x.CsharpNamespaceId,
+ principalTable: "CsharpNamespaces",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Restrict);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "CsharpEnums",
+ columns: table => new
+ {
+ Id = table.Column(type: "bigint", nullable: false)
+ .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
+ CsharpNamespaceId = table.Column(type: "bigint", nullable: true),
+ AstNodeId = table.Column(type: "numeric(20,0)", nullable: true),
+ ParentNodeId = table.Column(type: "numeric(20,0)", nullable: true),
+ EntityHash = table.Column(type: "bigint", nullable: false),
+ Name = table.Column(type: "text", nullable: true),
+ QualifiedName = table.Column(type: "text", nullable: true),
+ DocumentationCommentXML = table.Column(type: "text", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_CsharpEnums", x => x.Id);
+ table.ForeignKey(
+ name: "FK_CsharpEnums_CsharpAstNodes_AstNodeId",
+ column: x => x.AstNodeId,
+ principalTable: "CsharpAstNodes",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Restrict);
+ table.ForeignKey(
+ name: "FK_CsharpEnums_CsharpAstNodes_ParentNodeId",
+ column: x => x.ParentNodeId,
+ principalTable: "CsharpAstNodes",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Restrict);
+ table.ForeignKey(
+ name: "FK_CsharpEnums_CsharpNamespaces_CsharpNamespaceId",
+ column: x => x.CsharpNamespaceId,
+ principalTable: "CsharpNamespaces",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Restrict);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "CsharpStructs",
+ columns: table => new
+ {
+ Id = table.Column(type: "bigint", nullable: false)
+ .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
+ CsharpNamespaceId = table.Column(type: "bigint", nullable: true),
+ AstNodeId = table.Column(type: "numeric(20,0)", nullable: true),
+ ParentNodeId = table.Column(type: "numeric(20,0)", nullable: true),
+ EntityHash = table.Column(type: "bigint", nullable: false),
+ Name = table.Column(type: "text", nullable: true),
+ QualifiedName = table.Column(type: "text", nullable: true),
+ DocumentationCommentXML = table.Column(type: "text", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_CsharpStructs", x => x.Id);
+ table.ForeignKey(
+ name: "FK_CsharpStructs_CsharpAstNodes_AstNodeId",
+ column: x => x.AstNodeId,
+ principalTable: "CsharpAstNodes",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Restrict);
+ table.ForeignKey(
+ name: "FK_CsharpStructs_CsharpAstNodes_ParentNodeId",
+ column: x => x.ParentNodeId,
+ principalTable: "CsharpAstNodes",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Restrict);
+ table.ForeignKey(
+ name: "FK_CsharpStructs_CsharpNamespaces_CsharpNamespaceId",
+ column: x => x.CsharpNamespaceId,
+ principalTable: "CsharpNamespaces",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Restrict);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "CsharpEnumMembers",
+ columns: table => new
+ {
+ Id = table.Column(type: "bigint", nullable: false)
+ .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
+ EqualsValue = table.Column(type: "integer", nullable: false),
+ CsharpEnumId = table.Column(type: "bigint", nullable: true),
+ AstNodeId = table.Column(type: "numeric(20,0)", nullable: true),
+ ParentNodeId = table.Column(type: "numeric(20,0)", nullable: true),
+ EntityHash = table.Column(type: "bigint", nullable: false),
+ Name = table.Column(type: "text", nullable: true),
+ QualifiedName = table.Column(type: "text", nullable: true),
+ DocumentationCommentXML = table.Column(type: "text", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_CsharpEnumMembers", x => x.Id);
+ table.ForeignKey(
+ name: "FK_CsharpEnumMembers_CsharpAstNodes_AstNodeId",
+ column: x => x.AstNodeId,
+ principalTable: "CsharpAstNodes",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Restrict);
+ table.ForeignKey(
+ name: "FK_CsharpEnumMembers_CsharpAstNodes_ParentNodeId",
+ column: x => x.ParentNodeId,
+ principalTable: "CsharpAstNodes",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Restrict);
+ table.ForeignKey(
+ name: "FK_CsharpEnumMembers_CsharpEnums_CsharpEnumId",
+ column: x => x.CsharpEnumId,
+ principalTable: "CsharpEnums",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Restrict);
+ });
+
+ migrationBuilder.CreateIndex(
+ name: "IX_CsharpClasses_AstNodeId",
+ table: "CsharpClasses",
+ column: "AstNodeId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_CsharpClasses_CsharpNamespaceId",
+ table: "CsharpClasses",
+ column: "CsharpNamespaceId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_CsharpClasses_ParentNodeId",
+ table: "CsharpClasses",
+ column: "ParentNodeId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_CsharpEnumMembers_AstNodeId",
+ table: "CsharpEnumMembers",
+ column: "AstNodeId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_CsharpEnumMembers_CsharpEnumId",
+ table: "CsharpEnumMembers",
+ column: "CsharpEnumId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_CsharpEnumMembers_ParentNodeId",
+ table: "CsharpEnumMembers",
+ column: "ParentNodeId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_CsharpEnums_AstNodeId",
+ table: "CsharpEnums",
+ column: "AstNodeId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_CsharpEnums_CsharpNamespaceId",
+ table: "CsharpEnums",
+ column: "CsharpNamespaceId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_CsharpEnums_ParentNodeId",
+ table: "CsharpEnums",
+ column: "ParentNodeId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_CsharpEtcEntitys_AstNodeId",
+ table: "CsharpEtcEntitys",
+ column: "AstNodeId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_CsharpEtcEntitys_ParentNodeId",
+ table: "CsharpEtcEntitys",
+ column: "ParentNodeId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_CsharpMethods_AstNodeId",
+ table: "CsharpMethods",
+ column: "AstNodeId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_CsharpMethods_ParentNodeId",
+ table: "CsharpMethods",
+ column: "ParentNodeId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_CsharpNamespaces_AstNodeId",
+ table: "CsharpNamespaces",
+ column: "AstNodeId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_CsharpNamespaces_ParentNodeId",
+ table: "CsharpNamespaces",
+ column: "ParentNodeId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_CsharpStructs_AstNodeId",
+ table: "CsharpStructs",
+ column: "AstNodeId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_CsharpStructs_CsharpNamespaceId",
+ table: "CsharpStructs",
+ column: "CsharpNamespaceId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_CsharpStructs_ParentNodeId",
+ table: "CsharpStructs",
+ column: "ParentNodeId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_CsharpVariables_AstNodeId",
+ table: "CsharpVariables",
+ column: "AstNodeId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_CsharpVariables_ParentNodeId",
+ table: "CsharpVariables",
+ column: "ParentNodeId");
+ }
+
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.DropTable(
+ name: "CsharpClasses");
+
+ migrationBuilder.DropTable(
+ name: "CsharpEnumMembers");
+
+ migrationBuilder.DropTable(
+ name: "CsharpEtcEntitys");
+
+ migrationBuilder.DropTable(
+ name: "CsharpMethods");
+
+ migrationBuilder.DropTable(
+ name: "CsharpStructs");
+
+ migrationBuilder.DropTable(
+ name: "CsharpVariables");
+
+ migrationBuilder.DropTable(
+ name: "CsharpEnums");
+
+ migrationBuilder.DropTable(
+ name: "CsharpNamespaces");
+
+ migrationBuilder.DropTable(
+ name: "CsharpAstNodes");
+ }
+ }
+}
diff --git a/plugins/csharp/migrations/CsharpDbContextModelSnapshot.cs b/plugins/csharp/migrations/CsharpDbContextModelSnapshot.cs
new file mode 100644
index 000000000..20ebbc516
--- /dev/null
+++ b/plugins/csharp/migrations/CsharpDbContextModelSnapshot.cs
@@ -0,0 +1,543 @@
+//
+using System;
+using CSharpParser.model;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
+
+namespace CSharpParser.Migrations
+{
+ [DbContext(typeof(CsharpDbContext))]
+ partial class CsharpDbContextModelSnapshot : ModelSnapshot
+ {
+ protected override void BuildModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("Relational:MaxIdentifierLength", 63)
+ .HasAnnotation("ProductVersion", "5.0.10")
+ .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
+
+ modelBuilder.Entity("CSharpParser.model.CsharpAstNode", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("numeric(20,0)");
+
+ b.Property("Accessibility")
+ .HasColumnType("integer");
+
+ b.Property("AstSymbolType")
+ .HasColumnType("integer");
+
+ b.Property("AstType")
+ .HasColumnType("integer");
+
+ b.Property("AstValue")
+ .HasColumnType("text");
+
+ b.Property("EntityHash")
+ .HasColumnType("bigint");
+
+ b.Property("Location_range_end_column")
+ .HasColumnType("bigint");
+
+ b.Property("Location_range_end_line")
+ .HasColumnType("bigint");
+
+ b.Property("Location_range_start_column")
+ .HasColumnType("bigint");
+
+ b.Property("Location_range_start_line")
+ .HasColumnType("bigint");
+
+ b.Property("Path")
+ .HasColumnType("text");
+
+ b.Property("RawKind")
+ .HasColumnType("integer");
+
+ b.HasKey("Id");
+
+ b.ToTable("CsharpAstNodes");
+ });
+
+ modelBuilder.Entity("CSharpParser.model.CsharpClass", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint")
+ .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
+
+ b.Property("AstNodeId")
+ .HasColumnType("numeric(20,0)");
+
+ b.Property("ClassType")
+ .HasColumnType("integer");
+
+ b.Property("CsharpNamespaceId")
+ .HasColumnType("bigint");
+
+ b.Property("DocumentationCommentXML")
+ .HasColumnType("text");
+
+ b.Property("EntityHash")
+ .HasColumnType("bigint");
+
+ b.Property("Name")
+ .HasColumnType("text");
+
+ b.Property("ParentNodeId")
+ .HasColumnType("numeric(20,0)");
+
+ b.Property("QualifiedName")
+ .HasColumnType("text");
+
+ b.HasKey("Id");
+
+ b.HasIndex("AstNodeId");
+
+ b.HasIndex("CsharpNamespaceId");
+
+ b.HasIndex("ParentNodeId");
+
+ b.ToTable("CsharpClasses");
+ });
+
+ modelBuilder.Entity("CSharpParser.model.CsharpEnum", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint")
+ .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
+
+ b.Property("AstNodeId")
+ .HasColumnType("numeric(20,0)");
+
+ b.Property("CsharpNamespaceId")
+ .HasColumnType("bigint");
+
+ b.Property("DocumentationCommentXML")
+ .HasColumnType("text");
+
+ b.Property("EntityHash")
+ .HasColumnType("bigint");
+
+ b.Property("Name")
+ .HasColumnType("text");
+
+ b.Property("ParentNodeId")
+ .HasColumnType("numeric(20,0)");
+
+ b.Property("QualifiedName")
+ .HasColumnType("text");
+
+ b.HasKey("Id");
+
+ b.HasIndex("AstNodeId");
+
+ b.HasIndex("CsharpNamespaceId");
+
+ b.HasIndex("ParentNodeId");
+
+ b.ToTable("CsharpEnums");
+ });
+
+ modelBuilder.Entity("CSharpParser.model.CsharpEnumMember", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint")
+ .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
+
+ b.Property("AstNodeId")
+ .HasColumnType("numeric(20,0)");
+
+ b.Property("CsharpEnumId")
+ .HasColumnType("bigint");
+
+ b.Property("DocumentationCommentXML")
+ .HasColumnType("text");
+
+ b.Property("EntityHash")
+ .HasColumnType("bigint");
+
+ b.Property("EqualsValue")
+ .HasColumnType("integer");
+
+ b.Property("Name")
+ .HasColumnType("text");
+
+ b.Property("ParentNodeId")
+ .HasColumnType("numeric(20,0)");
+
+ b.Property("QualifiedName")
+ .HasColumnType("text");
+
+ b.HasKey("Id");
+
+ b.HasIndex("AstNodeId");
+
+ b.HasIndex("CsharpEnumId");
+
+ b.HasIndex("ParentNodeId");
+
+ b.ToTable("CsharpEnumMembers");
+ });
+
+ modelBuilder.Entity("CSharpParser.model.CsharpEtcEntity", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint")
+ .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
+
+ b.Property("AstNodeId")
+ .HasColumnType("numeric(20,0)");
+
+ b.Property("DeclaratorNodeId")
+ .HasColumnType("numeric(20,0)");
+
+ b.Property("DocumentationCommentXML")
+ .HasColumnType("text");
+
+ b.Property("EntityHash")
+ .HasColumnType("bigint");
+
+ b.Property("EtcEntityType")
+ .HasColumnType("integer");
+
+ b.Property("Name")
+ .HasColumnType("text");
+
+ b.Property("ParentNodeId")
+ .HasColumnType("numeric(20,0)");
+
+ b.Property("QualifiedName")
+ .HasColumnType("text");
+
+ b.Property("QualifiedType")
+ .HasColumnType("text");
+
+ b.Property("TypeHash")
+ .HasColumnType("bigint");
+
+ b.HasKey("Id");
+
+ b.HasIndex("AstNodeId");
+
+ b.HasIndex("ParentNodeId");
+
+ b.ToTable("CsharpEtcEntitys");
+ });
+
+ modelBuilder.Entity("CSharpParser.model.CsharpMethod", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint")
+ .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
+
+ b.Property("AstNodeId")
+ .HasColumnType("numeric(20,0)");
+
+ b.Property("DocumentationCommentXML")
+ .HasColumnType("text");
+
+ b.Property("EntityHash")
+ .HasColumnType("bigint");
+
+ b.Property("MethodType")
+ .HasColumnType("integer");
+
+ b.Property("Name")
+ .HasColumnType("text");
+
+ b.Property("ParentNodeId")
+ .HasColumnType("numeric(20,0)");
+
+ b.Property("QualifiedName")
+ .HasColumnType("text");
+
+ b.Property("QualifiedType")
+ .HasColumnType("text");
+
+ b.Property("TypeHash")
+ .HasColumnType("bigint");
+
+ b.HasKey("Id");
+
+ b.HasIndex("AstNodeId");
+
+ b.HasIndex("ParentNodeId");
+
+ b.ToTable("CsharpMethods");
+ });
+
+ modelBuilder.Entity("CSharpParser.model.CsharpNamespace", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint")
+ .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
+
+ b.Property("AstNodeId")
+ .HasColumnType("numeric(20,0)");
+
+ b.Property("DocumentationCommentXML")
+ .HasColumnType("text");
+
+ b.Property("EntityHash")
+ .HasColumnType("bigint");
+
+ b.Property("Name")
+ .HasColumnType("text");
+
+ b.Property("ParentNodeId")
+ .HasColumnType("numeric(20,0)");
+
+ b.Property("QualifiedName")
+ .HasColumnType("text");
+
+ b.HasKey("Id");
+
+ b.HasIndex("AstNodeId");
+
+ b.HasIndex("ParentNodeId");
+
+ b.ToTable("CsharpNamespaces");
+ });
+
+ modelBuilder.Entity("CSharpParser.model.CsharpStruct", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint")
+ .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
+
+ b.Property("AstNodeId")
+ .HasColumnType("numeric(20,0)");
+
+ b.Property("CsharpNamespaceId")
+ .HasColumnType("bigint");
+
+ b.Property("DocumentationCommentXML")
+ .HasColumnType("text");
+
+ b.Property("EntityHash")
+ .HasColumnType("bigint");
+
+ b.Property("Name")
+ .HasColumnType("text");
+
+ b.Property("ParentNodeId")
+ .HasColumnType("numeric(20,0)");
+
+ b.Property("QualifiedName")
+ .HasColumnType("text");
+
+ b.HasKey("Id");
+
+ b.HasIndex("AstNodeId");
+
+ b.HasIndex("CsharpNamespaceId");
+
+ b.HasIndex("ParentNodeId");
+
+ b.ToTable("CsharpStructs");
+ });
+
+ modelBuilder.Entity("CSharpParser.model.CsharpVariable", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint")
+ .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
+
+ b.Property("AstNodeId")
+ .HasColumnType("numeric(20,0)");
+
+ b.Property("DocumentationCommentXML")
+ .HasColumnType("text");
+
+ b.Property("EntityHash")
+ .HasColumnType("bigint");
+
+ b.Property("Name")
+ .HasColumnType("text");
+
+ b.Property("ParentNodeId")
+ .HasColumnType("numeric(20,0)");
+
+ b.Property("QualifiedName")
+ .HasColumnType("text");
+
+ b.Property("QualifiedType")
+ .HasColumnType("text");
+
+ b.Property("TypeHash")
+ .HasColumnType("bigint");
+
+ b.Property("VariableType")
+ .HasColumnType("integer");
+
+ b.HasKey("Id");
+
+ b.HasIndex("AstNodeId");
+
+ b.HasIndex("ParentNodeId");
+
+ b.ToTable("CsharpVariables");
+ });
+
+ modelBuilder.Entity("CSharpParser.model.CsharpClass", b =>
+ {
+ b.HasOne("CSharpParser.model.CsharpAstNode", "AstNode")
+ .WithMany()
+ .HasForeignKey("AstNodeId");
+
+ b.HasOne("CSharpParser.model.CsharpNamespace", "CsharpNamespace")
+ .WithMany()
+ .HasForeignKey("CsharpNamespaceId");
+
+ b.HasOne("CSharpParser.model.CsharpAstNode", "ParentNode")
+ .WithMany()
+ .HasForeignKey("ParentNodeId");
+
+ b.Navigation("AstNode");
+
+ b.Navigation("CsharpNamespace");
+
+ b.Navigation("ParentNode");
+ });
+
+ modelBuilder.Entity("CSharpParser.model.CsharpEnum", b =>
+ {
+ b.HasOne("CSharpParser.model.CsharpAstNode", "AstNode")
+ .WithMany()
+ .HasForeignKey("AstNodeId");
+
+ b.HasOne("CSharpParser.model.CsharpNamespace", "CsharpNamespace")
+ .WithMany()
+ .HasForeignKey("CsharpNamespaceId");
+
+ b.HasOne("CSharpParser.model.CsharpAstNode", "ParentNode")
+ .WithMany()
+ .HasForeignKey("ParentNodeId");
+
+ b.Navigation("AstNode");
+
+ b.Navigation("CsharpNamespace");
+
+ b.Navigation("ParentNode");
+ });
+
+ modelBuilder.Entity("CSharpParser.model.CsharpEnumMember", b =>
+ {
+ b.HasOne("CSharpParser.model.CsharpAstNode", "AstNode")
+ .WithMany()
+ .HasForeignKey("AstNodeId");
+
+ b.HasOne("CSharpParser.model.CsharpEnum", null)
+ .WithMany("CsharpEnumMembers")
+ .HasForeignKey("CsharpEnumId");
+
+ b.HasOne("CSharpParser.model.CsharpAstNode", "ParentNode")
+ .WithMany()
+ .HasForeignKey("ParentNodeId");
+
+ b.Navigation("AstNode");
+
+ b.Navigation("ParentNode");
+ });
+
+ modelBuilder.Entity("CSharpParser.model.CsharpEtcEntity", b =>
+ {
+ b.HasOne("CSharpParser.model.CsharpAstNode", "AstNode")
+ .WithMany()
+ .HasForeignKey("AstNodeId");
+
+ b.HasOne("CSharpParser.model.CsharpAstNode", "ParentNode")
+ .WithMany()
+ .HasForeignKey("ParentNodeId");
+
+ b.Navigation("AstNode");
+
+ b.Navigation("ParentNode");
+ });
+
+ modelBuilder.Entity("CSharpParser.model.CsharpMethod", b =>
+ {
+ b.HasOne("CSharpParser.model.CsharpAstNode", "AstNode")
+ .WithMany()
+ .HasForeignKey("AstNodeId");
+
+ b.HasOne("CSharpParser.model.CsharpAstNode", "ParentNode")
+ .WithMany()
+ .HasForeignKey("ParentNodeId");
+
+ b.Navigation("AstNode");
+
+ b.Navigation("ParentNode");
+ });
+
+ modelBuilder.Entity("CSharpParser.model.CsharpNamespace", b =>
+ {
+ b.HasOne("CSharpParser.model.CsharpAstNode", "AstNode")
+ .WithMany()
+ .HasForeignKey("AstNodeId");
+
+ b.HasOne("CSharpParser.model.CsharpAstNode", "ParentNode")
+ .WithMany()
+ .HasForeignKey("ParentNodeId");
+
+ b.Navigation("AstNode");
+
+ b.Navigation("ParentNode");
+ });
+
+ modelBuilder.Entity("CSharpParser.model.CsharpStruct", b =>
+ {
+ b.HasOne("CSharpParser.model.CsharpAstNode", "AstNode")
+ .WithMany()
+ .HasForeignKey("AstNodeId");
+
+ b.HasOne("CSharpParser.model.CsharpNamespace", "CsharpNamespace")
+ .WithMany()
+ .HasForeignKey("CsharpNamespaceId");
+
+ b.HasOne("CSharpParser.model.CsharpAstNode", "ParentNode")
+ .WithMany()
+ .HasForeignKey("ParentNodeId");
+
+ b.Navigation("AstNode");
+
+ b.Navigation("CsharpNamespace");
+
+ b.Navigation("ParentNode");
+ });
+
+ modelBuilder.Entity("CSharpParser.model.CsharpVariable", b =>
+ {
+ b.HasOne("CSharpParser.model.CsharpAstNode", "AstNode")
+ .WithMany()
+ .HasForeignKey("AstNodeId");
+
+ b.HasOne("CSharpParser.model.CsharpAstNode", "ParentNode")
+ .WithMany()
+ .HasForeignKey("ParentNodeId");
+
+ b.Navigation("AstNode");
+
+ b.Navigation("ParentNode");
+ });
+
+ modelBuilder.Entity("CSharpParser.model.CsharpEnum", b =>
+ {
+ b.Navigation("CsharpEnumMembers");
+ });
+#pragma warning restore 612, 618
+ }
+ }
+}
diff --git a/plugins/csharp/model/CsharpAstNode.cs b/plugins/csharp/model/CsharpAstNode.cs
new file mode 100644
index 000000000..182a2160e
--- /dev/null
+++ b/plugins/csharp/model/CsharpAstNode.cs
@@ -0,0 +1,68 @@
+using System.ComponentModel.DataAnnotations.Schema;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace CSharpParser.model
+{
+ enum AstSymbolTypeEnum
+ {
+ Variable,
+ Method,
+ Class,
+ Struct,
+ Namespace,
+ Enum,
+ EnumMember,
+ EtcEntity
+
+ }
+
+ enum AstTypeEnum
+ {
+ Declaration,
+ Definition,
+ Usage,
+ Read,
+ Write,
+ Expression
+ }
+
+ class CsharpAstNode
+ {
+ public ulong Id { get; set; }
+ public string AstValue { get; set; }
+ public AstSymbolTypeEnum AstSymbolType { get; set; }
+ public AstTypeEnum AstType { get; set; }
+ public Accessibility Accessibility { get; set; }
+ public long Location_range_start_line { get; set; }
+ public long Location_range_start_column { get; set; }
+ public long Location_range_end_line { get; set; }
+ public long Location_range_end_column { get; set; }
+ public string Path { get; set; }
+ public long EntityHash { get; set; }
+ public SyntaxKind RawKind { get; set; } //SyntaxKind Enum
+ public void SetLocation(FileLinePositionSpan f)
+ {
+ Location_range_start_line = f.StartLinePosition.Line+1;
+ Location_range_start_column = f.StartLinePosition.Character+1;
+ Location_range_end_line = f.EndLinePosition.Line+1;
+ Location_range_end_column = f.EndLinePosition.Character+1;
+ Path = f.Path;
+ }
+ public bool isRangeSmaller(CsharpAstNode other){
+ if (Location_range_start_line == other.Location_range_start_line){
+ if (Location_range_end_line == other.Location_range_end_line){
+ return Location_range_end_column - Location_range_start_column <
+ other.Location_range_end_column - other.Location_range_start_column;
+ }
+ return Location_range_end_line < other.Location_range_end_line;
+ } else if (Location_range_end_line - Location_range_start_line ==
+ other.Location_range_end_line - other.Location_range_start_line){
+ return Location_range_end_column - Location_range_start_column <
+ other.Location_range_end_column - other.Location_range_start_column;
+ }
+ return Location_range_end_line - Location_range_start_line <
+ other.Location_range_end_line - other.Location_range_start_line;
+ }
+ }
+}
diff --git a/plugins/csharp/model/CsharpClass.cs b/plugins/csharp/model/CsharpClass.cs
new file mode 100644
index 000000000..fa6642923
--- /dev/null
+++ b/plugins/csharp/model/CsharpClass.cs
@@ -0,0 +1,22 @@
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations.Schema;
+
+namespace CSharpParser.model
+{
+ enum ClassTypeEnum
+ {
+ Class,
+ Interface,
+ Record
+ }
+ class CsharpClass : CsharpEntity
+ {
+ public ClassTypeEnum ClassType { get; set; }
+ public CsharpNamespace CsharpNamespace { get; set; }
+ }
+ //[Table("csharp_structs")]
+ class CsharpStruct : CsharpEntity
+ {
+ public CsharpNamespace CsharpNamespace { get; set; }
+ }
+}
diff --git a/plugins/csharp/model/CsharpDbContext.cs b/plugins/csharp/model/CsharpDbContext.cs
new file mode 100644
index 000000000..eaef779d1
--- /dev/null
+++ b/plugins/csharp/model/CsharpDbContext.cs
@@ -0,0 +1,23 @@
+using System.Text;
+using Microsoft.EntityFrameworkCore;
+
+namespace CSharpParser.model
+{
+ class CsharpDbContext : DbContext
+ {
+ public CsharpDbContext(DbContextOptions options) : base(options) { }
+
+ public DbSet CsharpAstNodes { get; set; }
+ public DbSet CsharpNamespaces { get; set; }
+ public DbSet