Пример #1
0
 public SemanticTokensBuilder(
     SemanticTokensDocument document,
     SemanticTokensLegend legend)
 {
     _document = document;
     _legend   = legend;
     _data     = ImmutableArray <int> .Empty.ToBuilder();
 }
Пример #2
0
 public SemanticTokensDocumentTests(ITestOutputHelper testOutputHelper)
 {
     _testOutputHelper = testOutputHelper;
     _loggerFactory    = new TestLoggerFactory(testOutputHelper);
     _logger           = _loggerFactory.CreateLogger <SemanticTokensDocumentTests>();
     _legend           = new SemanticTokensLegend()
     {
         TokenModifiers = SemanticTokenModifier.Defaults.Select(x => x.ToString()).ToArray(),
         TokenTypes     = SemanticTokenType.Defaults.Select(x => x.ToString()).ToArray(),
     };
 }
        public SemanticTokensDocumentTests(ITestOutputHelper testOutputHelper)
        {
            var loggerFactory = new TestLoggerFactory(testOutputHelper);

            _logger = loggerFactory.CreateLogger <SemanticTokensDocumentTests>();
            _legend = new SemanticTokensLegend
            {
                // specify a specific set so that additions to the default list do not cause breaks in the tests.
                TokenModifiers = new[]
                {
                    new SemanticTokenModifier("documentation"),
                    new SemanticTokenModifier("declaration"),
                    new SemanticTokenModifier("definition"),
                    new SemanticTokenModifier("static"),
                    new SemanticTokenModifier("async"),
                    new SemanticTokenModifier("abstract"),
                    new SemanticTokenModifier("deprecated"),
                    new SemanticTokenModifier("readonly"),
                    new SemanticTokenModifier("modification"),
                    new SemanticTokenModifier("defaultLibrary")
                }
                .ToArray(),
                TokenTypes = new[]
                {
                    new SemanticTokenType("comment"),
                    new SemanticTokenType("keyword"),
                    new SemanticTokenType("string"),
                    new SemanticTokenType("number"),
                    new SemanticTokenType("regexp"),
                    new SemanticTokenType("operator"),
                    new SemanticTokenType("namespace"),
                    new SemanticTokenType("type"),
                    new SemanticTokenType("struct"),
                    new SemanticTokenType("class"),
                    new SemanticTokenType("interface"),
                    new SemanticTokenType("enum"),
                    new SemanticTokenType("typeParameter"),
                    new SemanticTokenType("function"),
                    new SemanticTokenType("member"),
                    new SemanticTokenType("property"),
                    new SemanticTokenType("macro"),
                    new SemanticTokenType("variable"),
                    new SemanticTokenType("parameter"),
                    new SemanticTokenType("label"),
                    new SemanticTokenType("modifier"),
                    new SemanticTokenType("event"),
                    new SemanticTokenType("enumMember"),
                }
                .ToArray(),
            };
        }
Пример #4
0
 public SemanticTokensDocument(SemanticTokensLegend legend)
 {
     _legend   = legend;
     _prevData = null;
     Initialize();
 }