Problem

Intellisense don't working for refrenced assemblies

Posted 3 years ago by Avatar Mike Pavlov - Terrasoft

Hi!

I've got next problem with SyntaxEditor, may be missed something in documentation:

In case, when you don't include in variable declaration full type "path" with namespaces - you don't get an IntelliSense enumeration for this variable.

For example:

var strDict = new Dictionary<string, string>(); // you will see nothing after input “strDict.”
var strDict = new System.Collections.Generic.Dictionary<string, string>();// In this case - all works and I can see all members of strDict


Comments (5)

Posted 3 years ago by Actipro Software Support - Cleveland, OH, USA

Hello,

You would need to ensure that you have an appropriate using at the top of your file, such as:

using System.Collections.Generic;

 Without that, you would have to use the full type path like you show in your second line.


Actipro Software Support
Posted 3 years ago by Mike Pavlov - Terrasoft

The situation seems clear now - the version we use (11.2.122) have a "lack of understanding" of next specific, but valid code file:

namespace WebApp {

  using System.Collections.Generic;

  public partial class PanelPageSchema {

  // .. some code

  }
}

namespace WebApp {
  public partial class PanelPageSchema {
  public bool NewMethod(int someParameter) {
        var strDict = new Dictionary<string, string>(); 
        // ... 
	return true;
  }
}

The bottom part of this block(body of NewMethod) opens in your component as CodeFragment, another parts setted by method SetHeaderAndFooterText. In this case editor cannot parse members of variable strDict. An the same time Visual Studio work with this code correctly.

We bought enterprise license for SyntaxEditor 11.2.122 - what we need to get this problem fixed for our version?

Posted 3 years ago by Actipro Software Support - Cleveland, OH, USA

Hi Mike,

From what you pasted, there is no using statement for System.Collections.Generic in the second namespace declaration on line 12.  So Dictionary<T,U> won't resolve.

Alternatively what you could do is just move your using statement in the first namespace up to the root level, outside of the namespaces blocks.  Then it will cover scope for everything.


Actipro Software Support
Posted 3 years ago by Mike Pavlov - Terrasoft

Thanks, now I see - what was my mistake.

The only strange behavior - that inside body of NewMethod - editor "knows" about type Dictionary<T,U> - it shows in completion list

Posted 3 years ago by Actipro Software Support - Cleveland, OH, USA

Hi Mike,

Thanks for the note, that does appear to be a minor bug that can occur in this scenario due to how we propagate containing namespace info in merged partial type scenarios.  This bug only shows up though if you have the same type declared partially in the same file and when the namespace imports are different.  You could work around it either by moving the imports up per what we described, or by separating the type declarations into separate files.  We'll make a note of the bug.


Actipro Software Support
Information The latest build of this product (2014.2 build 0181) was released 7 days ago, which was after the last post in this thread.

Add a Comment

Please log in to a validated account to post comments.