Esempio n. 1
0
        public RustClassifier(IRustLexer lexer, ITextBuffer buffer, IStandardClassificationService standardClassificationService)
        {
            this.buffer = buffer;
            DocumentState state = DocumentState.CreateAndRegister(lexer, buffer);

            state.TokensChanged += TokensChanged;
            this.standardClassificationService = standardClassificationService;
            InitializeClassifierDictionary(standardClassificationService);
        }
Esempio n. 2
0
        public static DocumentState CreateAndRegister(IRustLexer lexer, ITextBuffer buffer)
        {
            DocumentState state;

            if (buffer.Properties.TryGetProperty <DocumentState>(Key, out state))
            {
                return(state);
            }
            state           = new DocumentState(lexer, buffer.CurrentSnapshot);
            buffer.Changed += (src, arg) => state.ApplyTextChanges(arg);
            buffer.Properties.AddProperty(Key, state);
            return(state);
        }
Esempio n. 3
0
 public DocumentState(IRustLexer lexer, ITextSnapshot version)
 {
     this.lexer = lexer;
     CurrentSnapshot = version;
     Initialize();
 }
Esempio n. 4
0
 public static DocumentState CreateAndRegister(IRustLexer lexer, ITextBuffer buffer)
 {
     DocumentState state;
     if(buffer.Properties.TryGetProperty<DocumentState>(Key, out state))
         return state;
     state = new DocumentState(lexer, buffer.CurrentSnapshot);
     buffer.Changed += (src, arg) => state.ApplyTextChanges(arg);
     buffer.Properties.AddProperty(Key, state);
     return state;
 }
Esempio n. 5
0
 public DocumentState(IRustLexer lexer, ITextSnapshot version)
 {
     this.lexer      = lexer;
     CurrentSnapshot = version;
     Initialize();
 }
Esempio n. 6
0
 public RustClassifierProvider(IRustLexer lexer)
 {
     this.lexer = lexer;
 }