Intellisense don't working for refrenced assemblies

SyntaxEditor .NET Languages Add-on for Silverlight Forum

Posted 12 years ago by Mike Pavlov - Terrasoft
Version: 11.2.0122
Platform: Silverlight 5
Avatar

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)

Answer - Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

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 12 years ago by Mike Pavlov - Terrasoft
Avatar

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?

Answer - Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

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 12 years ago by Mike Pavlov - Terrasoft
Avatar

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

Answer - Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

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

The latest build of this product (v18.1 build 0233) was released 4 years ago, which was after the last post in this thread.