示例#1
0
 private Event(EventKind kind, string scope, Id <Element> data, IdFactory idFactory)
     : base(label: "$event", idFactory)
 {
     this.Kind  = kind switch { EventKind.Begin => "begin", EventKind.End => "end", _ => throw new ArgumentException(nameof(kind)) };
     this.Scope = scope;
     this.Data  = data;
 }
示例#2
0
 public LsifDocument(Uri uri, string languageId, string?contents, IdFactory idFactory)
     : base(label: "document", idFactory)
 {
     this.Uri        = uri;
     this.LanguageId = languageId;
     this.Contents   = contents;
 }
示例#3
0
文件: Edge.cs 项目: belav/roslyn
 public Edge(
     string label,
     Id <Vertex> outVertex,
     Id <Vertex>[] inVertices,
     IdFactory idFactory
     ) : base(type: "edge", label: label, idFactory)
 {
     OutVertex  = outVertex;
     InVertices = inVertices;
 }
示例#4
0
文件: Range.cs 项目: belav/roslyn
        public static Range FromTextSpan(
            TextSpan textSpan,
            SourceText sourceText,
            IdFactory idFactory
            )
        {
            var linePositionSpan = sourceText.Lines.GetLinePositionSpan(textSpan);

            return(new Range(
                       start: ConvertLinePositionToPosition(linePositionSpan.Start),
                       end: ConvertLinePositionToPosition(linePositionSpan.End),
                       idFactory
                       ));
        }
示例#5
0
文件: Edge.cs 项目: belav/roslyn
        public static Edge Create <TOutVertex, TInVertex>(
            string label,
            Id <TOutVertex> outVertex,
            Id <TInVertex> inVertex,
            IdFactory idFactory
            )
            where TOutVertex : Vertex
            where TInVertex : Vertex
        {
            var inVerticesArray = new Id <Vertex> [1];

            inVerticesArray[0] = inVertex.As <TInVertex, Vertex>();

            return(new Edge(label, outVertex.As <TOutVertex, Vertex>(), inVerticesArray, idFactory));
        }
示例#6
0
文件: Edge.cs 项目: belav/roslyn
        public static Edge Create <TOutVertex, TInVertex>(
            string label,
            Id <TOutVertex> outVertex,
            IList <Id <TInVertex> > inVertices,
            IdFactory idFactory
            )
            where TOutVertex : Vertex
            where TInVertex : Vertex
        {
            var inVerticesArray = new Id <Vertex> [inVertices.Count];

            // Note: this is ultimately just an array copy, but in a strongly-typed way. The JIT might see through this as a memory copy,
            // but might require some more explicit code if not.
            for (var i = 0; i < inVertices.Count; i++)
            {
                inVerticesArray[i] = inVertices[i].As <TInVertex, Vertex>();
            }

            return(new Edge(label, outVertex.As <TOutVertex, Vertex>(), inVerticesArray, idFactory));
        }
示例#7
0
 public Capabilities(
     IdFactory idFactory,
     bool hoverProvider,
     bool declarationProvider,
     bool definitionProvider,
     bool referencesProvider,
     bool typeDefinitionProvider,
     bool documentSymbolProvider,
     bool foldingRangeProvider,
     bool diagnosticProvider)
     : base(label: "capabilities", idFactory)
 {
     HoverProvider          = hoverProvider;
     DeclarationProvider    = declarationProvider;
     DefinitionProvider     = definitionProvider;
     ReferencesProvider     = referencesProvider;
     TypeDefinitionProvider = typeDefinitionProvider;
     DocumentSymbolProvider = documentSymbolProvider;
     FoldingRangeProvider   = foldingRangeProvider;
     DiagnosticProvider     = diagnosticProvider;
 }
示例#8
0
 public FoldingRangeResult(FoldingRange[] result, IdFactory idFactory)
     : base(label: "foldingRangeResult", idFactory)
 {
     Result = result;
 }
示例#9
0
 public Event(EventKind kind, Id <Document> data, IdFactory idFactory)
     : this(kind, "document", data.As <Document, Element>(), idFactory)
 {
 }
示例#10
0
 public Event(EventKind kind, Id <Project> data, IdFactory idFactory)
     : this(kind, "project", data.As <Project, Element>(), idFactory)
 {
 }
示例#11
0
文件: Range.cs 项目: belav/roslyn
 public Range(Position start, Position end, IdFactory idFactory)
     : base(label: "range", idFactory)
 {
     Start = start;
     End   = end;
 }
示例#12
0
 public Document(Uri uri, string languageId, IdFactory idFactory)
     : base(label: "document", idFactory)
 {
     this.Uri        = uri;
     this.LanguageId = languageId;
 }
示例#13
0
 public Project(string kind, Uri?resource, IdFactory idFactory)
     : base(label: "project", idFactory)
 {
     Kind     = kind;
     Resource = resource;
 }
示例#14
0
 public HoverResult(Hover result, IdFactory idFactory)
     : base(label: "hoverResult", idFactory)
 {
     Result = result;
 }