diff --git a/src/Features/Lsif/Generator/Generator.cs b/src/Features/Lsif/Generator/Generator.cs index f3404e1cc6baecba7d173d74a0e2fb36f7904538..d8cea83d7df07cb160e1d2787f8efc4f4b1bc0b7 100644 --- a/src/Features/Lsif/Generator/Generator.cs +++ b/src/Features/Lsif/Generator/Generator.cs @@ -28,11 +28,11 @@ public Generator(ILsifJsonWriter lsifJsonWriter) public void GenerateForCompilation(Compilation compilation, string projectPath, HostLanguageServices languageServices) { - var projectVertex = new Graph.Project(kind: GetLanguageKind(compilation.Language), new Uri(projectPath), _idFactory); + var projectVertex = new Graph.LsifProject(kind: GetLanguageKind(compilation.Language), new Uri(projectPath), _idFactory); _lsifJsonWriter.Write(projectVertex); _lsifJsonWriter.Write(new Event(Event.EventKind.Begin, projectVertex.GetId(), _idFactory)); - var documentIds = new ConcurrentBag>(); + var documentIds = new ConcurrentBag>(); // We create a ResultSetTracker to track all top-level symbols in the project. We don't want all writes to immediately go to // the JSON file -- we support parallel processing, so we'll accumulate them and then apply at once to avoid a lot @@ -74,7 +74,7 @@ public void GenerateForCompilation(Compilation compilation, string projectPath, /// lets us link symbols across files, and will only talk about "top level" symbols that aren't things like locals that can't /// leak outside a file. /// - private static Id GenerateForDocument( + private static Id GenerateForDocument( SemanticModel semanticModel, HostLanguageServices languageServices, IResultSetTracker topLevelSymbolsResultSetTracker, @@ -86,7 +86,7 @@ public void GenerateForCompilation(Compilation compilation, string projectPath, var syntaxFactsService = languageServices.GetRequiredService(); var semanticFactsService = languageServices.GetRequiredService(); - var documentVertex = new Graph.Document(new Uri(syntaxTree.FilePath), GetLanguageKind(semanticModel.Language), idFactory); + var documentVertex = new Graph.LsifDocument(new Uri(syntaxTree.FilePath), GetLanguageKind(semanticModel.Language), idFactory); lsifJsonWriter.Write(documentVertex); lsifJsonWriter.Write(new Event(Event.EventKind.Begin, documentVertex.GetId(), idFactory)); diff --git a/src/Features/Lsif/Generator/Graph/Event.cs b/src/Features/Lsif/Generator/Graph/Event.cs index abc31348558717336db70654a80ca24fe5675896..afff1c0c61c4b542938d27415274b0cb4d317f74 100644 --- a/src/Features/Lsif/Generator/Graph/Event.cs +++ b/src/Features/Lsif/Generator/Graph/Event.cs @@ -23,13 +23,13 @@ private Event(EventKind kind, string scope, Id data, IdFactory idFactor this.Data = data; } - public Event(EventKind kind, Id data, IdFactory idFactory) - : this(kind, "project", data.As(), idFactory) + public Event(EventKind kind, Id data, IdFactory idFactory) + : this(kind, "project", data.As(), idFactory) { } - public Event(EventKind kind, Id data, IdFactory idFactory) - : this(kind, "document", data.As(), idFactory) + public Event(EventKind kind, Id data, IdFactory idFactory) + : this(kind, "document", data.As(), idFactory) { } diff --git a/src/Features/Lsif/Generator/Graph/Item.cs b/src/Features/Lsif/Generator/Graph/Item.cs index 49d53622289e008c2d3f50c5a1e4bc3265985fbe..6f9e95e51583d0c61d03d00cbce28da643257e2d 100644 --- a/src/Features/Lsif/Generator/Graph/Item.cs +++ b/src/Features/Lsif/Generator/Graph/Item.cs @@ -10,10 +10,10 @@ namespace Microsoft.CodeAnalysis.LanguageServerIndexFormat.Generator.Graph /// internal sealed class Item : Edge { - public Id Document { get; } + public Id Document { get; } public string? Property { get; } - public Item(Id outVertex, Id range, Id document, IdFactory idFactory, string? property = null) + public Item(Id outVertex, Id range, Id document, IdFactory idFactory, string? property = null) : base(label: "item", outVertex, new[] { range.As() }, idFactory) { Document = document; diff --git a/src/Features/Lsif/Generator/Graph/Document.cs b/src/Features/Lsif/Generator/Graph/LsifDocument.cs similarity index 85% rename from src/Features/Lsif/Generator/Graph/Document.cs rename to src/Features/Lsif/Generator/Graph/LsifDocument.cs index f0fcde9723f06f7385ca59c89581419fb8971e22..db3fcdb45f0300ebbf91ecb39774a440af88921f 100644 --- a/src/Features/Lsif/Generator/Graph/Document.cs +++ b/src/Features/Lsif/Generator/Graph/LsifDocument.cs @@ -9,12 +9,12 @@ namespace Microsoft.CodeAnalysis.LanguageServerIndexFormat.Generator.Graph /// /// Represents the document vertex that contains all the s. See https://github.com/Microsoft/language-server-protocol/blob/master/indexFormat/specification.md#ranges for examples. /// - internal sealed class Document : Vertex + internal sealed class LsifDocument : Vertex { public Uri Uri { get; } public string LanguageId { get; } - public Document(Uri uri, string languageId, IdFactory idFactory) + public LsifDocument(Uri uri, string languageId, IdFactory idFactory) : base(label: "document", idFactory) { this.Uri = uri; diff --git a/src/Features/Lsif/Generator/Graph/Project.cs b/src/Features/Lsif/Generator/Graph/LsifProject.cs similarity index 85% rename from src/Features/Lsif/Generator/Graph/Project.cs rename to src/Features/Lsif/Generator/Graph/LsifProject.cs index cb65634c79c9d8a8d25ca37a4cfb584c0f56bc2d..14bd71e4e368f87a77c0b3f5ca9ef18dd23ebdf9 100644 --- a/src/Features/Lsif/Generator/Graph/Project.cs +++ b/src/Features/Lsif/Generator/Graph/LsifProject.cs @@ -9,12 +9,12 @@ namespace Microsoft.CodeAnalysis.LanguageServerIndexFormat.Generator.Graph /// /// Represents a top-level project. See https://github.com/Microsoft/language-server-protocol/blob/master/indexFormat/specification.md#the-project-vertex for further details. /// - internal sealed class Project : Vertex + internal sealed class LsifProject : Vertex { public string Kind { get; } public Uri? Resource { get; } - public Project(string kind, Uri? resource, IdFactory idFactory) + public LsifProject(string kind, Uri? resource, IdFactory idFactory) : base(label: "project", idFactory) { Kind = kind; diff --git a/src/Features/Lsif/GeneratorTest/ProjectStructureTests.vb b/src/Features/Lsif/GeneratorTest/ProjectStructureTests.vb index 6267ab268a2dc70db56c9986618ba9f4abd99810..ffd1d2086ceefd0535b726d85ae3971f66fb7e1a 100644 --- a/src/Features/Lsif/GeneratorTest/ProjectStructureTests.vb +++ b/src/Features/Lsif/GeneratorTest/ProjectStructureTests.vb @@ -19,8 +19,8 @@ Namespace Microsoft.CodeAnalysis.LanguageServerIndexFormat.Generator.UnitTests )) - Dim projectVertex = Assert.Single(lsif.Vertices.OfType(Of Graph.Project)) - Dim documentVertices = lsif.GetLinkedVertices(Of Graph.Document)(projectVertex, "contains") + Dim projectVertex = Assert.Single(lsif.Vertices.OfType(Of Graph.LsifProject)) + Dim documentVertices = lsif.GetLinkedVertices(Of Graph.LsifDocument)(projectVertex, "contains") Assert.Single(documentVertices, Function(d) d.Uri.LocalPath = "Z:\A.cs") Assert.Single(documentVertices, Function(d) d.Uri.LocalPath = "Z:\B.cs") diff --git a/src/Features/Lsif/GeneratorTest/RangeResultSetTests.vb b/src/Features/Lsif/GeneratorTest/RangeResultSetTests.vb index 67dcada7da70427476313b74928680b85e58e0aa..4b3fe24cb05acfcbf9b9d6c840142bc89e1abbea 100644 --- a/src/Features/Lsif/GeneratorTest/RangeResultSetTests.vb +++ b/src/Features/Lsif/GeneratorTest/RangeResultSetTests.vb @@ -162,11 +162,11 @@ Namespace Microsoft.CodeAnalysis.LanguageServerIndexFormat.Generator.UnitTests Continue For End If - Dim documents As New HashSet(Of Graph.Document) + Dim documents As New HashSet(Of Graph.LsifDocument) ' Let's now enumerate all the documents and ranges to see which documents contain a range that links to ' this resultSet - For Each document In lsif.Vertices.OfType(Of Graph.Document) + For Each document In lsif.Vertices.OfType(Of Graph.LsifDocument) For Each range In lsif.GetLinkedVertices(Of Graph.Range)(document, "contains") If lsif.GetLinkedVertices(Of Graph.ResultSet)(range, "next").Contains(resultSetVertex) Then documents.Add(document) diff --git a/src/Features/Lsif/GeneratorTest/Utilities/TestLsifOutput.vb b/src/Features/Lsif/GeneratorTest/Utilities/TestLsifOutput.vb index 89c2ec013f09bbf60604acb2ade1483a7bcc3688..6cf774145df1d6ec11460fc141616294ec4cce12 100644 --- a/src/Features/Lsif/GeneratorTest/Utilities/TestLsifOutput.vb +++ b/src/Features/Lsif/GeneratorTest/Utilities/TestLsifOutput.vb @@ -63,7 +63,7 @@ Namespace Microsoft.CodeAnalysis.LanguageServerIndexFormat.Generator.UnitTests.U For Each testDocument In _workspace.Documents Dim documentVertex = _testLsifJsonWriter.Vertices _ - .OfType(Of Graph.Document) _ + .OfType(Of Graph.LsifDocument) _ .Where(Function(d) d.Uri.LocalPath = testDocument.FilePath) _ .Single() Dim rangeVertices = GetLinkedVertices(Of Range)(documentVertex, "contains")