Hi,
I have an Editor package created thru Visual Studio Integration Package
wizard (C#). Also created another project in
the same solution for language service containing different classes for
implementing a language service (c#).
My question is: How to integrate/ link the editor with Language service. I
am proferring the language service
in the MyLanguagePackage. Have added various attributes for language service
as shown below.
the language service is not invoked from editor package so What is missing
here ?
I think it is in the IvsEditorFactory -> CreateEditorInstance( ) ->
two pointers i.e. ppunkDocView and ppunkDocData which should be
assigned a IVsCodeWindow and IvsTextLines instantiated from languageservice
package to link them.
Is that assumption correct?
if not, please let me know how to integrate Editor and Language service.
Will appreciate your help on this.
-----------------------------------
Editor's Package class
-------------------------------
namespace Vsip.VsPackage4
{
/////////////////////////////////////////////////////////////////////////////
// VsPackage4
[MSVSIP.DefaultRegistryRoot("Software\\Microsoft\\VisualStudio\\8.0")]
[MSVSIP.InstalledProductRegistration(false, "#100", "#102", "1.0")]
[MSVSIP.ProvideLoadKey("Standard", "1.0", "Package Name", "Company", 1)]
[MSVSIP.ProvideMenuResource(1000, 1)]
[MSVSIP.ProvideEditorExtension(typeof(EditorFactory), ".abc", 32,
ProjectGuid = ""{... guid here ...}"",
TemplateDir = "..\\Templates",
NameResourceID = 106,
DefaultName = "Package Name")]
[MSVSIP.ProvideEditorLogicalView(typeof(EditorFactory), "{... guid here
...}")]
[Guid("... guid here ...")]
public sealed class VsPackage4 : MSVSIP.Package
{
...
}
------------------------------------------------------
Language Service Package
-----------------------------------------------
[MSVSIP.DefaultRegistryRoot("Software\\Microsoft\\VisualStudio\\8.0")]
[MSVSIP.InstalledProductRegistration(false, "#100", "#102", "1.1")]
[MSVSIP.ProvideLoadKey("standard", "8.0", "Test", "Test", 1)]
[Guid("{... guid here ...}")]
[MSVSIP.ProvideLanguageService(typeof(MyLangService), "MyLangService",
222, CodeSense = true, ShowCompletion = true)]
[ProvideLanguageExtension(typeof(MyLangService), ".abc")]
public sealed class MyLanguagePackage : Package
{
MyLangService _MyLangService = null;
protected override void Initialize()
{
_MyLangService = new MyLangService();
_MyLangService.SetSite(this);
IServiceContainer serviceContainer = (IServiceContainer)this;
serviceContainer.AddService(typeof(MyLangService),
_MyLangService, true);
}
... other method for languageservice package here...
...
}
[Guid("... guid here ...")]
public class MyLangService : LanguageService
{
private LanguagePreferences mLanguagePreferences;
private MyScanner _MyScanner = null;
.... overrides for LanguageService class here...
}
Mo - 28 Jul 2005 05:07 GMT
Could someone please respond to my question below?
Thanks in Advance
Mo
> Hi,
>
[quoted text clipped - 83 lines]
>
> }