Esempio n. 1
0
        public override bool IsInsertionTrigger(
            SourceText text,
            int characterPosition,
            OptionSet options
            )
        {
            // Bring up on space or at the start of a word, or after a ( or [.
            //
            // Note: we don't want to bring this up after traditional enum operators like & or |.
            // That's because we don't like the experience where the enum appears directly after the
            // operator.  Instead, the user normally types <space> and we will bring up the list
            // then.
            var ch = text[characterPosition];

            return(ch == ' ' ||
                   ch == '[' ||
                   ch == '(' ||
                   ch == '~' ||
                   (
                       options.GetOption(
                           CompletionOptions.TriggerOnTypingLetters2,
                           LanguageNames.CSharp
                           ) && CompletionUtilities.IsStartingNewWord(text, characterPosition)
                   ));
        }
Esempio n. 2
0
        internal static bool IsTriggerAfterSpaceOrStartOfWordCharacter(SourceText text, int characterPosition, OptionSet options)
        {
            // Bring up on space or at the start of a word.
            var ch = text[characterPosition];

            return(ch == ' ' || (CompletionUtilities.IsStartingNewWord(text, characterPosition) && options.GetOption(CompletionOptions.TriggerOnTypingLetters, LanguageNames.CSharp)));
        }
Esempio n. 3
0
        internal override bool IsInsertionTrigger(SourceText text, int characterPosition, OptionSet options)
        {
            var ch = text[characterPosition];

            return(ch == ' ' ||
                   (CompletionUtilities.IsStartingNewWord(text, characterPosition) &&
                    options.GetOption(CompletionOptions.TriggerOnTypingLetters, LanguageNames.CSharp)));
        }
 protected override bool ShouldTriggerAfterQuotes(SourceText text, int insertedCharacterPosition)
 => CompletionUtilities.IsStartingNewWord(text, insertedCharacterPosition);
Esempio n. 5
0
 public override bool IsInsertionTrigger(SourceText text, int characterPosition, CompletionOptions options)
 => text[characterPosition] == ' ' ||
 options.TriggerOnTypingLetters && CompletionUtilities.IsStartingNewWord(text, characterPosition);