问题描述
我创建了一个新的类,如下所示
I have created a new classes like following
[Order(Before = "High")] [Export(typeof(ICompletionSourceProvider))]
[ContentType("JavaScript"), Name("EnhancedJavaScriptCompletion")]
internal sealed class JavaScriptCompletionSourceProvider
: ICompletionSourceProvider
{ }
和CompletionSource
internal sealed class CompletionSource : ICompletionSource, IDisposable
{
public void AugmentCompletionSession(ICompletionSession session, IList<CompletionSet> completionSets)
{
}
public void Dispose()
{
}
}
这些都已添加到Visual Studio Package
项目中.因此,当我尝试使用F5调试时,可以看到调试符号正在加载,并且调试在
These are both Added to a Visual Studio Package
project.So when I try to debug (with F5) I can see the debugging symbols are loading and the debugging stops in the
protected override void Initialize()
{
Debug.WriteLine(string.Format(CultureInfo.CurrentCulture, "Entering Initialize() of: {0}", this.ToString()));
base.Initialize();
}
但是,当我编辑.js文件并调用智能感知(即带有.
的点)时,deubbger不会打入类的ICompletionSourceProvider
或ICompletionSource
方法.
However when I'm editing a .js file, and invoking the intellisense (with that .
dot that is) the deubbger won't break into ICompletionSourceProvider
nor ICompletionSource
methods of my classes.
所以我的问题是:
- 1-5此截屏视频中有关标准Java Intellisense的问题 http://screencast.com/t/TwDlnpfOV0bX
- 6如何通过附加选项扩展标准
javascript
智能感知? - 7是否可以为同一个
ContentType
使用两个ICompletionSourceProvider
类?
- 1-5 Questions about standard Javascript Intellisense addressed in this screencast http://screencast.com/t/TwDlnpfOV0bX
- 6 how can we extend the standard
javascript
intellisense with extra options? - 7 Is it possible to have two
ICompletionSourceProvider
classes for the sameContentType
?
推荐答案
扩展未组合的原因是您尚未将其作为MEF组件添加到.vsixmanifest中.要添加它,
The reason your extension isn't getting composed is you haven't added it as MEF component to in your .vsixmanifest. To add it,
- 通过在解决方案资源管理器中双击文件来打开.vsixmanifest设计器.
- 点击断言
- 点击右侧的新建"
- 选择"Microsoft.VisualStudio.MefComponent"作为类型
- 选择当前解决方案中的项目"
- 选择您的扩展项目
这篇关于使用自定义ICompletionSourceProvider扩展VS2012 Javascript Intellisense的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!