• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# ICompletionSession类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ICompletionSession的典型用法代码示例。如果您正苦于以下问题:C# ICompletionSession类的具体用法?C# ICompletionSession怎么用?C# ICompletionSession使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ICompletionSession类属于命名空间,在下文中一共展示了ICompletionSession类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: AugmentCompletionSession

        public void AugmentCompletionSession(ICompletionSession session, IList<CompletionSet> completionSets)
        {
            if (IsHtmlFile && completionSets.Any())
            {
                var bottomSpan = completionSets.First().ApplicableTo;
                if (!JScriptEditorUtil.IsInJScriptLanguageBlock(_lbm, bottomSpan.GetStartPoint(bottomSpan.TextBuffer.CurrentSnapshot)))
                {
                    // This is an HTML statement completion session, so do nothing
                    return;
                }
            }

            // TODO: Reflect over the ShimCompletionSet to see where the Description value comes from
            //       as setting the property does not actually change the value.
            var newCompletionSets = completionSets
                .Select(cs => cs == null ? cs : new ScriptCompletionSet(
                    cs.Moniker,
                    cs.DisplayName,
                    cs.ApplicableTo,
                    cs.Completions
                        .Select(c => c == null ? c : new Completion(
                            c.DisplayText,
                            c.InsertionText,
                            DocCommentHelper.ProcessParaTags(c.Description),
                            c.IconSource,
                            c.IconAutomationText))
                        .ToList(),
                    cs.CompletionBuilders))
                .ToList();
            
            completionSets.Clear();

            newCompletionSets.ForEach(cs => completionSets.Add(cs));
        }
开发者ID:sanyaade-mobiledev,项目名称:ASP.NET-Mvc-2,代码行数:34,代码来源:ScriptCompletionReplacementSource.cs


示例2: AugmentCompletionSession

        public void AugmentCompletionSession(ICompletionSession session, IList<CompletionSet> completionSets)
        {
            if ( !settings.TextCompletionEnabled ) {
            return;
              }
              if ( session.TextView.TextBuffer != this.theBuffer ) {
            return;
              }
              if ( !PlainTextCompletionContext.IsSet(session) ) {
            return;
              }
              var snapshot = theBuffer.CurrentSnapshot;
              var triggerPoint = session.GetTriggerPoint(snapshot);
              if ( !triggerPoint.HasValue ) {
            return;
              }

              var applicableToSpan = GetApplicableToSpan(triggerPoint.Value);

              var then = this.bufferStatsOnCompletion;
              var now = new BufferStats(snapshot);
              if ( currentCompletions == null || now.SignificantThan(then) ) {
            this.currentCompletions = BuildCompletionsList();
            this.bufferStatsOnCompletion = now;
              }
              var set = new CompletionSet(
            moniker: "plainText",
            displayName: "Text",
            applicableTo: applicableToSpan,
            completions: currentCompletions,
            completionBuilders: null
            );
              completionSets.Add(set);
        }
开发者ID:bayulabster,项目名称:viasfora,代码行数:34,代码来源:PlainTextCompletionSource.cs


示例3: AugmentCompletionSession

        public void AugmentCompletionSession(ICompletionSession session, IList<CompletionSet> completionSets)
        {
            var position = session.GetTriggerPoint(_buffer).GetPoint(_buffer.CurrentSnapshot);
            var line = position.GetContainingLine();

            if (line == null)
                return;

            string text = line.GetText();
            var linePosition = position - line.Start;

            foreach (var source in completionSources)
            {
                var span = source.GetInvocationSpan(text, linePosition, position);
                if (span == null) continue;

                var trackingSpan = _buffer.CurrentSnapshot.CreateTrackingSpan(span.Value.Start + line.Start, span.Value.Length, SpanTrackingMode.EdgeInclusive);
                completionSets.Add(new StringCompletionSet(
                    source.GetType().Name,
                    trackingSpan,
                    source.GetEntries(quoteChar: text[span.Value.Start], caret: session.TextView.Caret.Position.BufferPosition)
                ));
            }
            // TODO: Merge & resort all sets?  Will StringCompletionSource handle other entries?
            //completionSets.SelectMany(s => s.Completions).OrderBy(c=>c.DisplayText.TrimStart('"','\''))
        }
开发者ID:Russe11,项目名称:WebEssentials2013,代码行数:26,代码来源:JavaScriptCompletionSourceProvider.cs


示例4: IsRetriggerChar

        protected override bool IsRetriggerChar(ICompletionSession session, char typedCharacter) {
            if (typedCharacter == ' ') {
                return true;
            }

            return base.IsRetriggerChar(session, typedCharacter);
        }
开发者ID:wenh123,项目名称:PTVS,代码行数:7,代码来源:TemplateCompletionController.cs


示例5: AugmentCompletionSession

        public void AugmentCompletionSession(ICompletionSession session, IList<CompletionSet> completionSets)
        {
            if (_disposed)
                throw new ObjectDisposedException("XSharpCompletionSource");

            List<Completion> completions = new List<Completion>()
            {
                new Completion("SELF"),
                new Completion("FUNCTION"),
                new Completion("CLASS")
            };
            
            ITextSnapshot snapshot = _buffer.CurrentSnapshot;
            var triggerPoint = (SnapshotPoint)session.GetTriggerPoint(snapshot);

            if (triggerPoint == null)
                return;

            var line = triggerPoint.GetContainingLine();
            SnapshotPoint start = triggerPoint;

            while (start > line.Start && !char.IsWhiteSpace((start - 1).GetChar()))
            {
                start -= 1;
            }

            var applicableTo = snapshot.CreateTrackingSpan(new SnapshotSpan(start, triggerPoint), SpanTrackingMode.EdgeInclusive);

            // XSHARP : Disable Intellisense 
            //completionSets.Add(new CompletionSet("All", "All", applicableTo, completions, Enumerable.Empty<Completion>()));
        }
开发者ID:X-Sharp,项目名称:XSharpPublic,代码行数:31,代码来源:CompletionSource.cs


示例6: AugmentCompletionSession

        public void AugmentCompletionSession(ICompletionSession session, IList<CompletionSet> completionSets)
        {
            var position = session.GetTriggerPoint(this.textBuffer).GetPoint(this.textBuffer.CurrentSnapshot);
            var line = position.GetContainingLine();

            if (line == null)
            {
                return;
            }

            int linePos = position - line.Start.Position;

            var info = UIRouterStateCompletionUtils.FindCompletionInfo(line.GetText(), linePos);
            if (info == null)
            {
                return;
            }

            var callingFilename = this.textBuffer.GetFileName();
            var appHierarchy = this.ngHierarchyProvider.Get(callingFilename);

            IEnumerable<Completion> results = null;
            results = this.GetCompletions(appHierarchy);

            var trackingSpan = this.textBuffer.CurrentSnapshot.CreateTrackingSpan(info.Item2.Start + line.Start, info.Item2.Length, SpanTrackingMode.EdgeInclusive);
            completionSets.Add(new CompletionSet(
                "Angular views",
                "Angular views",
                trackingSpan,
                results,
                null
            ));
        }
开发者ID:rosieks,项目名称:Rosieks.VisualStudio.Angular,代码行数:33,代码来源:StateCompletionSource.cs


示例7: AugmentCompletionSession

        public void AugmentCompletionSession(ICompletionSession session, IList<CompletionSet> completionSets)
        {
            if (_disposed)
                return;

            List<Completion> completions = new List<Completion>();
            foreach (string item in RobotsTxtClassifier._valid)
            {
                completions.Add(new Completion(item, item, null, _glyph, item));
            }

            ITextSnapshot snapshot = _buffer.CurrentSnapshot;
            var triggerPoint = (SnapshotPoint)session.GetTriggerPoint(snapshot);

            if (triggerPoint == null)
                return;

            var line = triggerPoint.GetContainingLine();
            string text = line.GetText();
            int index = text.IndexOf(':');
            int hash = text.IndexOf('#');
            SnapshotPoint start = triggerPoint;

            if (hash > -1 && hash < triggerPoint.Position || (index > -1 && (start - line.Start.Position) > index))
                return;

            while (start > line.Start && !char.IsWhiteSpace((start - 1).GetChar()))
            {
                start -= 1;
            }

            var applicableTo = snapshot.CreateTrackingSpan(new SnapshotSpan(start, triggerPoint), SpanTrackingMode.EdgeInclusive);

            completionSets.Add(new CompletionSet("All", "All", applicableTo, completions, Enumerable.Empty<Completion>()));
        }
开发者ID:ncl-dmoreira,项目名称:WebEssentials2013,代码行数:35,代码来源:RobotsCompletionSource.cs


示例8: AugmentCompletionSession

        public void AugmentCompletionSession(ICompletionSession session, IList<CompletionSet> completionSets)
        {
            int triggerPointPosition = session.GetTriggerPoint(session.TextView.TextBuffer).GetPosition(session.TextView.TextSnapshot);
            ITrackingSpan trackingSpan = session.TextView.TextSnapshot.CreateTrackingSpan(triggerPointPosition, 0, SpanTrackingMode.EdgeInclusive);

            var rewriteDirectives = new[] {
                new ApacheCompletion("RewriteBase", "RewriteBase", "The RewriteBase directive explicitly sets the base URL for per-directory rewrites."),
                new ApacheCompletion("RewriteCond", "RewriteCond", "The RewriteCond directive defines a rule condition. One or more RewriteCond can precede a RewriteRule directive."),
                new ApacheCompletion("RewriteEngine", "RewriteEngine", "The RewriteEngine directive enables or disables the runtime rewriting engine."),
                new ApacheCompletion("RewriteLock", "RewriteLock", "This directive sets the filename for a synchronization lockfile which mod_rewrite needs to communicate with RewriteMap programs."),
                new ApacheCompletion("RewriteLog", "RewriteLog", "The RewriteLog directive sets the name of the file to which the server logs any rewriting actions it performs."),
                new ApacheCompletion("RewriteLogLevel", "RewriteLogLevel", "The RewriteLogLevel directive sets the verbosity level of the rewriting logfile."),
                new ApacheCompletion("RewriteMap", "RewriteMap", "The RewriteMap directive defines a Rewriting Map which can be used inside rule substitution strings by the mapping-functions to insert/substitute fields through a key lookup."),
                new ApacheCompletion("RewriteOptions", "RewriteOptions", "The RewriteOptions directive sets some special options for the current per-server or per-directory configuration."),
                new ApacheCompletion("RewriteRule", "RewriteRule", "The RewriteRule directive is the real rewriting workhorse. The directive can occur more than once, with each instance defining a single rewrite rule. The order in which these rules are defined is important - this is the order in which they will be applied at run-time.")
            };

            var completionSet = new CompletionSet(
                ApacheContentType.Name,
                "Apache Rewrite Directives",
                trackingSpan,
                rewriteDirectives,
                null
            );

            completionSets.Add(completionSet);
        }
开发者ID:managedfusion,项目名称:managedfusion-rewriter-visualstudio,代码行数:27,代码来源:ApacheCompletionSource.cs


示例9: AugmentCompletionSession

        public void AugmentCompletionSession(ICompletionSession session, IList<CompletionSet> completionSets)
        {
            var position = session.GetTriggerPoint(_buffer).GetPoint(_buffer.CurrentSnapshot);
            var line = position.GetContainingLine();

            if (line == null) return;

            int linePos = position - line.Start.Position;

            var info = GruntTaskCompletionUtils.FindCompletionInfo(line.GetText(), linePos);
            if (info == null) return;

            var callingFilename = _buffer.GetFileName();
            var baseFolder = Path.GetDirectoryName(callingFilename);

            IEnumerable<Intel.Completion> results = new List<Intel.Completion>();
            if (String.IsNullOrWhiteSpace(info.Item1))
                results = GetRootCompletions(baseFolder);

            var trackingSpan = _buffer.CurrentSnapshot.CreateTrackingSpan(info.Item2.Start + line.Start, info.Item2.Length, SpanTrackingMode.EdgeInclusive);
            completionSets.Add(new CompletionSet(
                "Node.js Modules",
                "Node.js Modules",
                trackingSpan,
                results,
                null
            ));

        }
开发者ID:jmorenor,项目名称:WebEssentials2013,代码行数:29,代码来源:GruntTaskCompletionSourceProvider.cs


示例10: AugmentCompletionSession

        public override void AugmentCompletionSession(ICompletionSession session, IList<CompletionSet> completionSets) {
            var doc = HtmlEditorDocument.FromTextBuffer(_buffer);
            if (doc == null) {
                return;
            }
            doc.HtmlEditorTree.EnsureTreeReady();

            var primarySnapshot = doc.PrimaryView.TextSnapshot;
            var nullableTriggerPoint = session.GetTriggerPoint(primarySnapshot);
            if (!nullableTriggerPoint.HasValue) {
                return;
            }
            var triggerPoint = nullableTriggerPoint.Value;

            var artifacts = doc.HtmlEditorTree.ArtifactCollection;
            var index = artifacts.GetItemContaining(triggerPoint.Position);
            if (index < 0) {
                return;
            }

            var artifact = artifacts[index] as TemplateArtifact;
            if (artifact == null) {
                return;
            }

            var artifactText = doc.HtmlEditorTree.ParseTree.Text.GetText(artifact.InnerRange);
            artifact.Parse(artifactText);

            ITrackingSpan applicableSpan;
            var completionSet = GetCompletionSet(session.GetOptions(_analyzer._serviceProvider), _analyzer, artifact.TokenKind, artifactText, artifact.InnerRange.Start, triggerPoint, out applicableSpan);
            completionSets.Add(completionSet);
        }
开发者ID:omnimark,项目名称:PTVS,代码行数:32,代码来源:DjangoCompletionSource.cs


示例11: FindSpanAtCurrentPositionFrom

 private ITrackingSpan FindSpanAtCurrentPositionFrom(ICompletionSession session)
 {
     var currentPoint = (session.TextView.Caret.Position.BufferPosition) - 1;
     var navigator = provider.NavigatorService.GetTextStructureNavigator(buffer);
     var extent = navigator.GetExtentOfWord(currentPoint);
     return currentPoint.Snapshot.CreateTrackingSpan(extent.Span, SpanTrackingMode.EdgeInclusive);
 }
开发者ID:ericbock,项目名称:raconteur,代码行数:7,代码来源:CompletionSource.cs


示例12: AugmentCompletionSession

		public void AugmentCompletionSession(ICompletionSession session, IList<CompletionSet> completionSets) {
			var snapshot = session.TextView.TextSnapshot;
			var triggerPoint = session.GetTriggerPoint(snapshot);
			if (triggerPoint == null)
				return;
			var info = CompletionInfo.Create(snapshot);
			if (info == null)
				return;

			// This helps a little to speed up the code
			ProfileOptimizationHelper.StartProfile("roslyn-completion-" + info.Value.CompletionService.Language);

			CompletionTrigger completionTrigger;
			session.Properties.TryGetProperty(typeof(CompletionTrigger), out completionTrigger);

			var completionList = info.Value.CompletionService.GetCompletionsAsync(info.Value.Document, triggerPoint.Value.Position, completionTrigger).GetAwaiter().GetResult();
			if (completionList == null)
				return;
			Debug.Assert(completionList.Span.End <= snapshot.Length);
			if (completionList.Span.End > snapshot.Length)
				return;
			var trackingSpan = snapshot.CreateTrackingSpan(completionList.Span.Start, completionList.Span.Length, SpanTrackingMode.EdgeInclusive, TrackingFidelityMode.Forward);
			var completionSet = RoslynCompletionSet.Create(imageMonikerService, mruCompletionService, completionList, info.Value.CompletionService, session.TextView, DefaultCompletionSetMoniker, dnSpy_Roslyn_Shared_Resources.CompletionSet_All, trackingSpan);
			completionSets.Add(completionSet);
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:25,代码来源:CompletionSource.cs


示例13: GetLineSpan

        private static SnapshotSpan GetLineSpan(AutoCompletionSource source, ICompletionSession session)
        {
            var currentPoint = (session.TextView.Caret.Position.BufferPosition) - 1;
            var lineStart = source.TextBuffer.CurrentSnapshot.GetText().LastIndexOf('\n', currentPoint) + 1;

            return new SnapshotSpan(source.TextBuffer.CurrentSnapshot, lineStart, currentPoint - lineStart + 1);
        }
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:7,代码来源:AutoCompletionSource.cs


示例14: Completion

            /// <summary>
            /// Augment the completion session with the provided set of words if this completion session is 
            /// being created for a word completion session
            /// </summary>
            void ICompletionSource.AugmentCompletionSession(ICompletionSession session, IList<CompletionSet> completionSets)
            {
                var textView = session.TextView;

                // Only provide completion information for the ITextBuffer directly associated with the 
                // ITextView.  In a projcetion secnario there will be several ITextBuffer instances associated
                // with a given ITextView and we provide ICompletionSource values for all of them.  We want to
                // avoid creating duplicate completion information
                if (textView.TextBuffer != _textBuffer)
                {
                    return;
                }

                // Get out the collection of words.  If none is present then there is no information to
                // augment here
                CompletionData completionData;
                if (!textView.Properties.TryGetPropertySafe(_completionDataKey, out completionData) || completionData.WordCollection == null)
                {
                    return;
                }

                var trackingSpan = completionData.WordSpan.Snapshot.CreateTrackingSpan(
                    completionData.WordSpan.Span,
                    SpanTrackingMode.EdgeInclusive);
                var completions = completionData.WordCollection.Select(word => new Completion(word));
                var wordCompletionSet = new WordCompletionSet(trackingSpan, completions);
                completionSets.Add(wordCompletionSet);
            }
开发者ID:aesire,项目名称:VsVim,代码行数:32,代码来源:WordCompletionSessionFactoryService.cs


示例15: TextOfLine

        void ICompletionSource.AugmentCompletionSession(ICompletionSession session, IList<CompletionSet> completionSets)
        {
            int position = session.GetTriggerPoint(session.TextView.TextBuffer).GetPosition(textBuffer.CurrentSnapshot);
            int line = textBuffer.CurrentSnapshot.GetLineNumberFromPosition(position);
            int column = position - textBuffer.CurrentSnapshot.GetLineFromPosition(position).Start.Position;

            Microsoft.VisualStudio.IronPythonInference.Modules modules = new Microsoft.VisualStudio.IronPythonInference.Modules();

            IList<Declaration> attributes;
            if (textBuffer.GetReadOnlyExtents(new Span(0, textBuffer.CurrentSnapshot.Length)).Count > 0)
            {
                int start;
                var readWriteText = TextOfLine(textBuffer, line, column, out start, true);
                var module = modules.AnalyzeModule(new QuietCompilerSink(), textBuffer.GetFileName(), readWriteText);

                attributes = module.GetAttributesAt(1, column - 1);

                foreach (var attribute in GetEngineAttributes(readWriteText, column - start - 1))
                {
                    attributes.Add(attribute);
                }
            }
            else
            {
                var module = modules.AnalyzeModule(new QuietCompilerSink(), textBuffer.GetFileName(), textBuffer.CurrentSnapshot.GetText());

                attributes = module.GetAttributesAt(line + 1, column);
            }

            completionSets.Add(GetCompletions((List<Declaration>)attributes, session));
        }
开发者ID:kageyamaginn,项目名称:VSSDK-Extensibility-Samples,代码行数:31,代码来源:CompletionSource.cs


示例16: AugmentCompletionSession

        public void AugmentCompletionSession(ICompletionSession session, IList<CompletionSet> completionSets) {
            var buffer = _textBuffer;
            var snapshot = buffer.CurrentSnapshot;
            var triggerPoint = session.GetTriggerPoint(buffer).GetPoint(snapshot);

            // Disable completions if user is editing a special command (e.g. ".cls") in the REPL.
            if (snapshot.TextBuffer.Properties.ContainsProperty(typeof(IReplEvaluator)) && snapshot.Length != 0 && snapshot[0] == '.') {
                return;
            }

            if (ShouldTriggerRequireIntellisense(triggerPoint, _classifier, true, true)) {
                AugmentCompletionSessionForRequire(triggerPoint, session, completionSets);
                return;
            }

            var textBuffer = _textBuffer;
            var span = GetApplicableSpan(session, textBuffer);
            var provider = VsProjectAnalyzer.GetCompletions(
                _textBuffer.CurrentSnapshot,
                span,
                session.GetTriggerPoint(buffer));

            var completions = provider.GetCompletions(_glyphService);
            if (completions != null && completions.Completions.Count > 0) {
                completionSets.Add(completions);
            }
        }
开发者ID:CforED,项目名称:Node.js-Tools-for-Visual-Studio,代码行数:27,代码来源:CompletionSource.cs


示例17: if

    void ICompletionSource.AugmentCompletionSession(ICompletionSession session, IList<CompletionSet> completionSets)
    {
      var fileModel = VsUtils.TryGetFileModel(_textBuffer);

      if (fileModel == null)
        return;

      var client  = fileModel.Server.Client;
      var triggerPoint = session.GetTriggerPoint(_textBuffer);
      var snapshot = _textBuffer.CurrentSnapshot;
      var version = snapshot.Version.Convert();

      client.Send(new ClientMessage.CompleteWord(fileModel.Id, version, triggerPoint.GetPoint(snapshot).Position));
      var result = client.Receive<ServerMessage.CompleteWord>();
      var span = result.replacementSpan;
      var applicableTo = snapshot.CreateTrackingSpan(new Span(span.StartPos, span.Length), SpanTrackingMode.EdgeInclusive);

      var completions = new List<Completion>();

      CompletionElem.Literal literal;
      CompletionElem.Symbol  symbol;

      foreach (var elem in result.completionList)
      {
        if ((literal = elem as CompletionElem.Literal) != null)
          completions.Add(new Completion(literal.text, literal.text, "literal", null, null));
        else if ((symbol = elem as CompletionElem.Symbol) != null)
          completions.Add(new Completion(symbol.name, symbol.name, symbol.description, null, null));
      }

      completionSets.Add(new CompletionSet("NitraWordCompletion", "Nitra word completion", applicableTo, completions, null));
    }
开发者ID:rsdn,项目名称:nitra,代码行数:32,代码来源:NitraCompletionSource.cs


示例18: AugmentCompletionSession

        public void AugmentCompletionSession(ICompletionSession session, IList<CompletionSet> completionSets)
        {
            var caretPosition = session.TextView.Caret.Position.BufferPosition.Position;
            var tokenTriggeringIntellisense = _tokenizedBuffer.CurrentState.FindTokenAtIndex(caretPosition);
            if (caretPosition == tokenTriggeringIntellisense.IndexToken.StartIndex) tokenTriggeringIntellisense = tokenTriggeringIntellisense.Previous();
            var numberOfCharactersBeforeCursor = caretPosition - tokenTriggeringIntellisense.IndexToken.StartIndex;
            var textFromSymbolBeforeCursor = tokenTriggeringIntellisense.IndexToken.Token.Text.Substring(0, numberOfCharactersBeforeCursor);
            var currentIndexToken = _tokenizedBuffer.CurrentState.FindTokenAtIndex(0);
            var completions = new List<Completion>();

            while (currentIndexToken != null)
            {
                if (currentIndexToken.IndexToken.StartIndex != tokenTriggeringIntellisense.IndexToken.StartIndex)
                {
                    if (currentIndexToken.Node.Value.Type == TokenType.Symbol && currentIndexToken.Node.Value.Text.StartsWith(textFromSymbolBeforeCursor))
                    {
                        if (completions.Find(c => c.DisplayText == currentIndexToken.Node.Value.Text) == null)
                        {
                            completions.Add(new Completion(currentIndexToken.Node.Value.Text));
                        }
                    }
                }

                currentIndexToken = currentIndexToken.Next();
            }

            var snapshot = session.TextView.TextSnapshot;
            var start = new SnapshotPoint(snapshot, tokenTriggeringIntellisense.IndexToken.StartIndex);
            var end = new SnapshotPoint(snapshot, start.Position + tokenTriggeringIntellisense.IndexToken.Token.Text.Length);
            var applicableTo = snapshot.CreateTrackingSpan(new SnapshotSpan(start, end), SpanTrackingMode.EdgeInclusive);
            completionSets.Add(new CompletionSet("All", "All", applicableTo, completions, new List<Completion>()));
        }
开发者ID:vasily-kirichenko,项目名称:vsClojure,代码行数:32,代码来源:HippieCompletionSource.cs


示例19: AugmentCompletionSession

        public void AugmentCompletionSession(ICompletionSession session, IList<CompletionSet> completionSets)
        {
            if (disposed)
                return;

            ITextSnapshot snapshot = textBuffer.CurrentSnapshot;
            SnapshotPoint? triggerPoint = session.GetTriggerPoint(snapshot);
            if (triggerPoint == null)
                return;

            int position = triggerPoint.Value.Position;

            CompletionContext context;
            var completionProviders = CompletionEngine.GetCompletionProviders(session, textBuffer, triggerPoint.Value, navigator, out context).ToList();
            if (completionProviders.Count == 0 || context == null)
                return;

            var completions = new List<Completion>();

            foreach (ICompletionListProvider completionListProvider in completionProviders)
                completions.AddRange(completionListProvider.GetCompletionEntries(context));

            if (completions.Count == 0)
                return;

            ITrackingSpan trackingSpan =
                textBuffer.CurrentSnapshot.CreateTrackingSpan(
                    position <= context.SpanStart || position > context.SpanStart + context.SpanLength
                        ? new Span(position, 0)
                        : new Span(context.SpanStart, context.SpanLength), SpanTrackingMode.EdgeInclusive);

            CompletionSet completionSet = new CompletionSet("PaketCompletion", "Paket", trackingSpan, completions, Enumerable.Empty<Completion>());

            completionSets.Add(completionSet);
        }
开发者ID:dungpa,项目名称:Paket.VisualStudio,代码行数:35,代码来源:PaketCompletionSourceProvider.cs


示例20: RCompletionContext

 public RCompletionContext(ICompletionSession session, ITextBuffer textBuffer, AstRoot ast, int position)
 {
     Session = session;
     TextBuffer = textBuffer;
     Position = position;
     AstRoot = ast;
 }
开发者ID:AlexanderSher,项目名称:RTVS-Old,代码行数:7,代码来源:RCompletionContext.cs



注:本文中的ICompletionSession类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ICompletionWidget类代码示例发布时间:2022-05-24
下一篇:
C# ICompletionData类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap