league1991 / CodeAtlasVsix

A graph-based code navigation plugin for Visual Studio
https://marketplace.visualstudio.com/items?itemName=YaobinOuyang.CodeAtlas
GNU General Public License v2.0
238 stars 38 forks source link

Blank window after solution analysis #2

Open aschekatihin opened 6 years ago

aschekatihin commented 6 years ago

Tried to install extension on VS 2017 community edition. After solution analysis graph window remains blank. No errors reported.

image

league1991 commented 6 years ago

@aschekatihin That's expected. You can place the cursor on a function and press Alt+F, that will show the function in viewport.

brannigan32 commented 6 years ago

Hi. I got the same behavior with the blank screen and no error message. But even if I use ALT+F nothing happens. Also the "search" or "symbol" are complete empty. Is that also as expected?

league1991 commented 6 years ago

@brannigan32 That isn't expected... You can check if there is any file in "[solution folder] / CodeGraphData/Result_solution/xml" folder. If the answer is yes, that means the analysis process succeed. Otherwise, some errors occured when CodeGraph try to scan the projects. You can select some of them and use "Analyse Selected Projects" to isolate the problematic ones. If it's appropriate, you can also send your whole VS solution to me.

brannigan32 commented 6 years ago

Hi. Yes there are a bunch of files (mainly xml files) the folder xml. So it seems, that the analysis processed. But if I go to the souce code, mark a function and press ALT+f nothing happens. Any ideas? Thank you.

league1991 commented 6 years ago

@brannigan32 Open index.xml in that folder to see if the function you tried is in the list. If not, the code file in which you tried Alt+F is probably not analysed. You can open "Advanced Configurations" (Actually it's doxywizard) and try to include that file. If yes, you can try to search the function name directly on the "search" tab and see what will happen.

brannigan32 commented 6 years ago

Hi. Sorry for the late response. Actually I found out, that for some functions the graph is generated. However it seems to bo, that this is not the case for all functions. Is there any filter selecting the functions?

ms22941 commented 6 years ago

Hi. I got the same probs as @brannigan32 . It seems the solution has been scanned, but pressing Alt-F or clicking the corresponding toolbar button leads to no reaction. A lot of .xml were generated, don't know wether they are complete. I'm using VS 2017 pro on a mainly c# solution.

league1991 commented 5 years ago

@brannigan32 Maybe some functions are in disabled macros. Try to define those macros in code graph.

league1991 commented 5 years ago

@ms22941 You can try to search those functions' name in xmls. If you find them, something wrong happened inside CodeGraph.

ms22941 commented 5 years ago

Hi Yiubun,

I tried again:

You find attached

When trying to open the XML in FireFox I got an error (XML not well formed).

Hope this information helps to find the problem.

Best Regards, Martin.

Von: Yiubun Auyeung notifications@github.com Gesendet: Freitag, 14. September 2018 18:49 An: league1991/CodeAtlasVsix CodeAtlasVsix@noreply.github.com Cc: ms22941 ms22941@web.de; Mention mention@noreply.github.com Betreff: Re: [league1991/CodeAtlasVsix] Blank window after solution analysis (#2)

@ms22941 https://github.com/ms22941 You can try to search those functions' name in xmls. If you find them, something wrong happened inside CodeGraph.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/league1991/CodeAtlasVsix/issues/2#issuecomment-421418397 , or mute the thread https://github.com/notifications/unsubscribe-auth/ADeJ_zngter3eEAZvSeqpjM4ICM0rTtiks5ua939gaJpZM4UeBO5 . https://github.com/notifications/beacon/ADeJ_8NBLKduMGboLLHriSPHWmQgmgWTks5ua939gaJpZM4UeBO5.gif

using LCCDatabase; using System.Collections.Generic; using System.Diagnostics;

namespace LCCApplication { // -------------------------------------------------------------------------- // ViewModel for the Car selection dialog // --------------------------------------------------------------------------

// -------------------------------------------------------------------------- public enum CarSelectionMode { Single = 1, // ViewModel is DriverViewModel, car will be directly assigned to driver in database SingleIndexed, // ViewModel istRacingSeriesSetupViewModel, CarUid will be written to selected index of SelectedCarUids[] MultiLimited // ViewModel istRacingSeriesSetupViewModel, CarUids will be written to SelectedCarUids[] }

// -------------------------------------------------------------------------- public class SelectCarViewModel : BaseViewModel { // -------------------------------------------------------------------------- public const int cInvalidUid = ApplicationCore.cInvalidUid;

// --------------------------------------------------------------------------
private EMContainer DBContext { get; set; }

// --------------------------------------------------------------------------
// Alle Fahrzeuge, die ausgewählt werden können (observable collection)
private CarViewModels selectableCarViewModels = null;

public CarViewModels SelectableCarViewModels
{
  get
  {
    return selectableCarViewModels;
  }

  set
  {
    if (selectableCarViewModels != value)
    {
      selectableCarViewModels = value;
      foreach (CarViewModel cvm in selectableCarViewModels)
      {
        cvm.Selected = SelectedCarUids.Contains(cvm.Uid);
        cvm.Touched = (cvm.Uid == LastCarTouched);
      }
      OnPropertyChanged("SelectableCarViewModels");
    }
  }
}

// --------------------------------------------------------------------------
private int lastCarTouched = -1;

public int LastCarTouched
{
  get { return lastCarTouched; }
  set
  {
    if (lastCarTouched != value)
    {
      lastCarTouched = value;
      if (SelectableCarViewModels != null)
      {
        foreach (CarViewModel dvm in SelectableCarViewModels)
        {
          dvm.Touched = (dvm.Uid == LastCarTouched);
        }
      }
      OnPropertyChanged("LastCarTouched");
    }
  }
}

// --------------------------------------------------------------------------
public CarSelectionMode SelectionMode { get { return SelectionParameter.SelectionMode; } }

public SelectCarParameter SelectionParameter { get; private set; }

// --------------------------------------------------------------------------
public bool SelectionConfirmed { get; private set; }

// --------------------------------------------------------------------------
// ***** Ctor *****
// --------------------------------------------------------------------------
public SelectCarViewModel()
{
  DBContext = null;
  SelectionConfirmed = false;
  LastCarTouched = cInvalidUid;

  if (IsNotInDesginMode)
  {
    RefreshDBContext();
  }
}

// --------------------------------------------------------------------------
public void Initialize(SelectCarParameter scp)
{
  SelectionParameter = scp;
  switch (SelectionMode)
  {
    case CarSelectionMode.Single:
      InitSingleCarSelection();
      break;

    case CarSelectionMode.SingleIndexed:
      InitSingleIndexedCarSelection();
      break;

    case CarSelectionMode.MultiLimited:
      InitMultipleCarsSelection();
      break;
  }
}

// --------------------------------------------------------------------------
private void InitSingleCarSelection()
{
  ISingleCarSelectionViewModel targetViewModel = SelectionParameter.TargetViewModel as ISingleCarSelectionViewModel;
  Debug.Assert(targetViewModel != null);
  Title = "Fahrzeugauswahl für " + targetViewModel.FullName;
  List<int> currentSelection = new List<int>();
  if (targetViewModel != null &&
      targetViewModel.CurrentCarUid > 0)
  {
    currentSelection.Add(targetViewModel.CurrentCarUid);
  }
  SelectedCarUids = currentSelection;

  if (SelectedCarUids.Count == 1)
  {
    CarTouched(SelectedCarUids[0]);
  }
}

// --------------------------------------------------------------------------
private void InitSingleIndexedCarSelection()
{
  IMultiCarSelectionViewModel targetViewModel = SelectionParameter.TargetViewModel as IMultiCarSelectionViewModel;
  Debug.Assert(targetViewModel != null);
  Title = "Fahrzeugauswahl für Regler " + (SelectionParameter.SelectedIndex+1).ToString();
  List<int> currentSelection = new List<int>();
  if (targetViewModel.SelectedCarUids[SelectionParameter.SelectedIndex] >= 0)
  {
    currentSelection.Add(targetViewModel.SelectedCarUids[SelectionParameter.SelectedIndex]);
  }
  SelectedCarUids = currentSelection;

  if (SelectedCarUids.Count == 1)
  {
    CarTouched(SelectedCarUids[0]);
  }
}

// --------------------------------------------------------------------------
private void InitMultipleCarsSelection()
{
  IMultiCarSelectionViewModel targetViewModel = SelectionParameter.TargetViewModel as IMultiCarSelectionViewModel;
  Debug.Assert(targetViewModel != null);

  Title = "Fahrzeugauswahl für " + targetViewModel.MultiSelectionLimit.ToString() + " Teilnehmer pro Rennen";

  List<int> currentSelection = new List<int>();
  // set up the existing selection for the dialog
  foreach (var uid in targetViewModel.SelectedCarUids)
  {
    if (uid >= 0 && currentSelection.Count < targetViewModel.MultiSelectionLimit)
    {
      currentSelection.Add(uid);
    }
  }
  SelectedCarUids = currentSelection;

  if (SelectedCarUids.Count >= 1)
  {
    CarTouched(SelectedCarUids[0]);
  }
}

// --------------------------------------------------------------------------
public void CarSelected(int uid)
{
  LastSelectedCarUid = uid;
  switch (SelectionMode)
  {
    case CarSelectionMode.Single:
      {
        // clear all other selected Cars
        foreach (CarViewModel cvm in SelectableCarViewModels)
        {
          cvm.Selected = (cvm.Uid == uid);
        }
        UpdateSelectedCarUids();
        ConfirmSelection();
        break;
      }
    case CarSelectionMode.SingleIndexed:
      {
        // clear all other selected Cars
        foreach (CarViewModel cvm in SelectableCarViewModels)
        {
          cvm.Selected = (cvm.Uid == uid);
        }
        ConfirmSelection();
        break;
      }
    case CarSelectionMode.MultiLimited:
      {
        IMultiCarSelectionViewModel targetViewModel = SelectionParameter.TargetViewModel as IMultiCarSelectionViewModel;
        Debug.Assert(targetViewModel != null);

        UpdateSelectedCarUids();
        if (SelectedCarUids.Count == targetViewModel.MultiSelectionLimit)
        {
          ConfirmSelection();
        }
        break;
      }
  }
}

// --------------------------------------------------------------------------
public void CarTouched(int uid)
{
  LastCarTouched = uid;
}

// --------------------------------------------------------------------------
public void UpdateSelectedCarUids()
{
  SelectedCarUids.Clear();
  foreach (CarViewModel cvm in SelectableCarViewModels)
  {
    if (cvm.Selected)
    {
      SelectedCarUids.Add(cvm.Uid);
    }
  }
}

// --------------------------------------------------------------------------
public void ConfirmSelection()
{
  SelectionConfirmed = true;

  switch (SelectionMode)
  {
    case CarSelectionMode.Single:
      {
        ISingleCarSelectionViewModel targetViewModel = SelectionParameter.TargetViewModel as ISingleCarSelectionViewModel;
        Debug.Assert(targetViewModel != null);
        targetViewModel.AssignCar(LastSelectedCarUid);
        break;
      }

    case CarSelectionMode.SingleIndexed:
      {
        IMultiCarSelectionViewModel targetViewModel = SelectionParameter.TargetViewModel as IMultiCarSelectionViewModel;
        Debug.Assert(targetViewModel != null);
        // clear uid on all other controllers
        for (int i = 0; i < targetViewModel.SelectedCarUids.Length; i++)
        {
          if (targetViewModel.SelectedCarUids[i] == LastSelectedCarUid)
          {
            targetViewModel.SelectedCarUids[i] = -1;
          }
        }
        targetViewModel.SelectedCarUids[SelectionParameter.SelectedIndex] = LastSelectedCarUid;
        break;
      }

    case CarSelectionMode.MultiLimited:
      {
        IMultiCarSelectionViewModel targetViewModel = SelectionParameter.TargetViewModel as IMultiCarSelectionViewModel;
        Debug.Assert(targetViewModel != null);
        SelectedCarUids.CopyTo(targetViewModel.SelectedCarUids);
        break;
      }
  }
}

// --------------------------------------------------------------------------
public void RefreshDBContext()
{
  DBContext = EntityModel.CreateDatabaseContext();
  SelectableCarViewModels = new FilteredCarViewModels(DBContext);
}

// --------------------------------------------------------------------------
private void SortSelectableCarViewModels()
{

// SelectableCarViewModels. }

//public static void Sort<T>(this ObservableCollection<T> collection, Comparison<T> comparison)
//{
//  var sortableList = new List<T>(collection);
//  sortableList.Sort(comparison);

//  for (int i = 0; i < sortableList.Count; i++)
//  {
//    collection.Move(collection.IndexOf(sortableList[i]), i);
//  }
//}

// --------------------------------------------------------------------------
private string title = string.Empty;

public string Title
{
  get { return title; }
  set
  {
    if (title != value)
    {
      title = value;
      OnPropertyChanged("Title");
    }
  }
}

// --------------------------------------------------------------------------
public bool OKButtonActive
{
  get
  {
    return SelectionMode != CarSelectionMode.Single;
  }
}

// --------------------------------------------------------------------------
public bool NoCarButtonActive
{
  get
  {
    return SelectionMode == CarSelectionMode.Single;
  }
}

// --------------------------------------------------------------------------
private List<int> selectedCarUids = new List<int>();

public List<int> SelectedCarUids
{
  get
  { return selectedCarUids; }
  set
  {
    if (selectedCarUids != value)
    {
      selectedCarUids = value;

      // mark all selected dvm
      if (SelectableCarViewModels != null)
      {
        foreach (CarViewModel cvm in SelectableCarViewModels)
        {
          cvm.Selected = SelectedCarUids.Contains(cvm.Uid);
        }
      }

      OnPropertyChanged("SelectedCarUids");
    }
  }
}

// --------------------------------------------------------------------------
private int lastSelectedCarUid = cInvalidUid; // used to determine the Car for a car selection

public int LastSelectedCarUid
{
  get
  {
    return lastSelectedCarUid;
  }
  private set
  {
    if (lastSelectedCarUid != value)
    {
      lastSelectedCarUid = value;
      OnPropertyChanged("LastSelectedCarUid");
    }
  }
}

// --------------------------------------------------------------------------

} }

league1991 commented 5 years ago

@ms22941 Is it possible for you to send the whole project to my e-mail, 549088764@qq.com? It will also be very helpful to send all the analysis result files under "CodeGraphData" folder to me. Then I can open your results and see what happened.

ms22941 commented 5 years ago

Got it working finally! It looks like the reason why it did not work was an '&' in the name of the solution directory which lead to an error when parsing the xml... After removing the '&', recompiling (don't know wether thats really required) and re-analysing the solution Code Graph seems to work fine.

league1991 commented 5 years ago

@ms22941 Thanks for your reply. Recompiling is unnecessary. It seems to be doxygen's bug...

weirdyang commented 3 years ago

Experiencing the same thing in vs2019

league1991 commented 3 years ago

@captmomo Can you use Alt+F to add functions?

weirdyang commented 3 years ago

Hi I figured it out.

To get it to work.

  1. Open code graph
  2. Set language to c#
  3. Click on analyse
  4. Alt f and the node appears

Only following this sequence made it work.

league1991 commented 3 years ago

You are right. You have to do it manually but I guess step 2 is unnecessary.

Thanks for your feedback, maybe I should update the UI message.

league1991 commented 3 years ago

You can make a very simple console project from VS and check if CodeGraph can analyse your project. If it can, something wrong happened in your original project, try to shrink the search scope by excluding some projects.

umarmlone notifications@github.com 于2020年11月16日周一 下午1:41写道:

Doesn't work in Visual Studio 2019 16.7.7. The Code Graph window is empty. Using Alt+F adds the symbol to the Code Graph by does not show the relationship.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/league1991/CodeAtlasVsix/issues/2#issuecomment-727748009, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABLOW3TPNHLM5V5MNONZ4HLSQC3RHANCNFSM4FDYCO4Q .