Browse Source

Implemented some missing functions in refactoring context.

newNRvisualizers
Mike Krüger 14 years ago
parent
commit
7958965a70
  1. 24
      ICSharpCode.NRefactory.CSharp/Refactoring/RefactoringContext.cs

24
ICSharpCode.NRefactory.CSharp/Refactoring/RefactoringContext.cs

@ -48,22 +48,36 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring
get; get;
} }
public ICompilation Compilation {
get;
protected set;
}
public abstract CSharpFormattingOptions FormattingOptions { public abstract CSharpFormattingOptions FormattingOptions {
get; get;
} }
public abstract AstType CreateShortType (IType fullType); public abstract AstType CreateShortType (IType fullType);
public AstType CreateShortType (string ns, string typeName) public AstType CreateShortType (string ns, string name, int typeParameterCount = 0)
{ {
throw new NotImplementedException(); var def = Compilation.MainAssembly.GetTypeDefinition (ns, name, typeParameterCount);
//return CreateShortType (TypeResolveContext.GetTypeDefinition (ns, typeName, 0, StringComparer.Ordinal)); if (def == null) {
foreach (var asm in Compilation.ReferencedAssemblies) {
def = asm.GetTypeDefinition (ns, name, typeParameterCount);
if (def != null)
break;
}
}
if (def == null)
return new MemberType (new SimpleType (ns), name);
return CreateShortType (def);
} }
public virtual AstType CreateShortType (AstType fullType) public virtual AstType CreateShortType (AstType fullType)
{ {
throw new NotImplementedException(); return CreateShortType (Resolve (fullType).Type);
//return CreateShortType (Resolve (fullType).Type.Resolve (TypeResolveContext));
} }
// public abstract IType GetDefinition (AstType resolvedType); // public abstract IType GetDefinition (AstType resolvedType);

Loading…
Cancel
Save