Ejemplo n.º 1
0
            private async Task CreateNoResultsFoundEntryIfNecessaryAsync()
            {
                string message;

                lock (Gate)
                {
                    // If we got definitions, then no need to show the 'no results found' message.
                    if (this.Definitions.Count > 0)
                    {
                        return;
                    }

                    message = NoDefinitionsFoundMessage;
                }

                var definitionBucket = GetOrCreateDefinitionBucket(CreateNoResultsDefinitionItem(message), expandedByDefault: true);
                var entry            = await SimpleMessageEntry.CreateAsync(definitionBucket, navigationBucket : null, message).ConfigureAwait(false);

                lock (Gate)
                {
                    EntriesWhenGroupingByDefinition    = EntriesWhenGroupingByDefinition.Add(entry);
                    EntriesWhenNotGroupingByDefinition = EntriesWhenNotGroupingByDefinition.Add(entry);
                    CurrentVersionNumber++;
                }

                NotifyChange();
            }
Ejemplo n.º 2
0
            private async Task CreateNoResultsFoundEntryIfNecessaryAsync()
            {
                bool noDefinitions;

                lock (Gate)
                {
                    noDefinitions = this.Definitions.Count == 0;
                }

                if (noDefinitions)
                {
                    // Create a fake definition/reference called "search found no results"
                    await OnEntryFoundAsync(
                        NoResultsDefinitionItem,
                        bucket =>
                        SimpleMessageEntry.CreateAsync(
                            bucket,
                            null,
                            ServicesVSResources.Search_found_no_results
                            ) !,
                        addToEntriesWhenGroupingByDefinition : true,
                        addToEntriesWhenNotGroupingByDefinition : true
                        )
                    .ConfigureAwait(false);
                }
            }
            private async Task CreateMissingReferenceEntriesIfNecessaryAsync(
                bool whenGroupingByDefinition)
            {
                // Go through and add dummy entries for any definitions that
                // that we didn't find any references for.

                var definitions = GetDefinitionsToCreateMissingReferenceItemsFor(whenGroupingByDefinition);

                foreach (var definition in definitions)
                {
                    if (definition.IsExternal)
                    {
                        await OnEntryFoundAsync(definition,
                                                bucket => SimpleMessageEntry.CreateAsync(bucket, bucket, ServicesVSResources.External_reference_found) !,
                                                addToEntriesWhenGroupingByDefinition : whenGroupingByDefinition,
                                                addToEntriesWhenNotGroupingByDefinition : !whenGroupingByDefinition).ConfigureAwait(false);
                    }
                    else
                    {
                        // Create a fake reference to this definition that says "no references found to <symbolname>".
                        //
                        // We'll place this under a single bucket called "Symbols without references" and we'll allow
                        // the user to navigate on that text entry to that definition if possible.
                        await OnEntryFoundAsync(SymbolsWithoutReferencesDefinitionItem,
                                                bucket => SimpleMessageEntry.CreateAsync(
                                                    definitionBucket: bucket,
                                                    navigationBucket: RoslynDefinitionBucket.Create(Presenter, this, definition, expandedByDefault: false),
                                                    string.Format(ServicesVSResources.No_references_found_to_0, definition.NameDisplayParts.JoinText())) !,
                                                addToEntriesWhenGroupingByDefinition : whenGroupingByDefinition,
                                                addToEntriesWhenNotGroupingByDefinition : !whenGroupingByDefinition,
                                                expandedByDefault : false).ConfigureAwait(false);
                    }
                }
            }
            private void CreateMissingReferenceEntriesIfNecessary()
            {
                // Go through and add dummy entries for any definitions that
                // that we didn't find any references for.

                var definitions = GetDefinitionsToCreateMissingReferenceItemsFor();

                foreach (var definition in definitions)
                {
                    // Create a fake reference to this definition that says
                    // "no references found to <symbolname>".
                    OnEntryFound(definition,
                                 (db, c) => SimpleMessageEntry.CreateAsync(
                                     db, GetMessage(db.DefinitionItem)));
                }
            }
            private async Task CreateMissingReferenceEntriesIfNecessaryAsync()
            {
                // Go through and add dummy entries for any definitions that
                // that we didn't find any references for.

                var definitions = GetDefinitionsToCreateMissingReferenceItemsFor();

                foreach (var definition in definitions)
                {
                    // Create a fake reference to this definition that says
                    // "no references found to <symbolname>".
                    await OnEntryFoundAsync(definition,
                                            bucket => SimpleMessageEntry.CreateAsync(
                                                bucket, GetMessage(bucket.DefinitionItem))).ConfigureAwait(false);
                }
            }
            private void CreateNoResultsFoundEntryIfNecessary()
            {
                bool noDefinitions;

                lock (_gate)
                {
                    noDefinitions = this._definitions.Count == 0;
                }

                if (noDefinitions)
                {
                    // Create a fake definition/reference called "search found no results"
                    this.OnEntryFound(NoResultsDefinitionItem,
                                      (db, c) => SimpleMessageEntry.CreateAsync(
                                          db, ServicesVisualStudioNextResources.Search_found_no_results));
                }
            }
            private async Task CreateNoResultsFoundEntryIfNecessaryAsync()
            {
                bool noDefinitions;

                lock (_gate)
                {
                    noDefinitions = this._definitions.Count == 0;
                }

                if (noDefinitions)
                {
                    // Create a fake definition/reference called "search found no results"
                    await OnEntryFoundAsync(NoResultsDefinitionItem,
                                            bucket => SimpleMessageEntry.CreateAsync(
                                                bucket, ServicesVisualStudioNextResources.Search_found_no_results)).ConfigureAwait(false);
                }
            }
            private async Task CreateNoResultsFoundEntryIfNecessaryAsync(CancellationToken cancellationToken)
            {
                string message;

                lock (Gate)
                {
                    // If we got definitions, then no need to show the 'no results found' message.
                    if (this.Definitions.Count > 0)
                    {
                        return;
                    }

                    message = NoDefinitionsFoundMessage;
                }

                // Create a fake definition/reference called "search found no results"
                await OnEntryFoundAsync(
                    CreateNoResultsDefinitionItem(message),
                    bucket => SimpleMessageEntry.CreateAsync(bucket, navigationBucket: null, message) !,
                    addToEntriesWhenGroupingByDefinition : true,
                    addToEntriesWhenNotGroupingByDefinition : true,
                    expandedByDefault : true,
                    cancellationToken).ConfigureAwait(false);
            }