
Hi
I'm trying to get intellisense to work with c# and partial classes. I did a someone trying to accomplish what I'm trying to do in this post here 101241. However, when I added my partial class using project.SourceFiles.QueueCode, my intellisens broke.
As an example, i'm using the sample demo that comes with the installer DotNetAddonCSharpGettingStarted02 with some modifications.
MainControl.xaml, i changed the class to be partial class and removed the using System.Collections.Generic;
...
<system:String xml:space="preserve">using System;
namespace DotNetLanguagesAddon {
public partial class CSharpLanguage {
...
MainControl.xaml.cs, i added my custom partial class to the queue
public MainControl() {
InitializeComponent();
projectAssembly = new CSharpProjectAssembly("SampleBrowser");
var assemblyLoader = new BackgroundWorker();
assemblyLoader.DoWork += DotNetProjectAssemblyReferenceLoader;
assemblyLoader.RunWorkerAsync();
var language = new CSharpSyntaxLanguage();
language.RegisterProjectAssembly(projectAssembly);
codeEditor.Document.Language = language;
// my custom class
projectAssembly.SourceFiles.QueueCode(language, "myclass.cs", @"using System;
namespace DotNetLanguagesAddon {
public partial class CSharpLanguage {
protected string Name { get; set; }
}
}");
}
When I run the editor, I get the following intellisense results in the CSharpLanguage class:
- this.Name Works
- any intellisense from using System; DOES NOT work. ie: var dt = new DateTime();
- if I add using System.Collections.Generic to the code, intellisens for this does not work. ie: var mylist = new List<string>();
The result above are only applicable in the CSharpLanguage class, if i create a new class and start typing in there, the intellisense works just fine.
Is there some method i'm missing to have the intellisense work correctly for related partial classes?