I'm working on a Visual Studio extension project, providing language service for Lua(this feature is already done). Now I'm going to add a project type for Lua. Now there will be two VsPackage classs(one for lunguage service, one for project type) in the project.
When I'm debugging the project, project type seems not work, which haven't show up a Lua project type when click 'New Project'. When I tested it in an empty project, it works well.
Here is the first package:
[PackageRegistration(UseManagedResourcesOnly = true)]
[SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1650:ElementDocumentationMustBeSpelledCorrectly", Justification = "pkgdef, VS and vsixmanifest are valid VS terms")]
[ProvideProjectFactory(typeof(NPLProjectFactory), null,
"NPL Project Files (*.nplproj);*.nplproj", "nplproj", "nplproj",
".\\NullPath", LanguageVsTemplate = "NPL")]
[ProvideProjectItem(typeof(NPLProjectFactory), "NPL Items", ".\\NullPath", 500)]
[Guid(Guids.guidNPLProjectPkgString)]
[ProvideObject(typeof(NPLPropertyPage))]
[ProvideMenuResource("Menus.ctmenu", 1)]
public sealed class NPLProjectPackage : CommonProjectPackage
{
}
second
[PackageRegistration(UseManagedResourcesOnly = true)]
[InstalledProductRegistration("#110", "#112", "1.0", IconResourceID = 400)]
[ProvideKeyBindingTable(GuidList.guidNPLLanguageServiceEditorFactoryString, 102)]
//[ProvideEditorLogicalView(typeof(EditorFactory), "{7651a703-06e5-11d1-8ebd-00a0c90f26ea}")]
[ProvideService(typeof(ILuaLanguageService), ServiceName = "NPL Language Service")]
// Provide the language service for the .lua extension
[ProvideLanguageExtension(typeof(LanguageService), Configuration.Extension)]
[ProvideLanguageService(typeof(LanguageService), Configuration.Name, 110,
CodeSense = true,
EnableCommenting = true,
MatchBraces = true,
MatchBracesAtCaret = true,
ShowCompletion = true,
ShowMatchingBrace = true,
AutoOutlining = true,
EnableAsyncCompletion = true,
QuickInfo = true,
EnableFormatSelection = true,
CodeSenseDelay = 1000)]
[ProvideToolWindow(typeof(SourceOutlineToolWindow), Style = VsDockStyle.Tabbed)]
//This attribute is needed to let the shell know that this package exposes some menus.
[ProvideMenuResource("Menus.ctmenu", 1)]
[ProvideAutoLoad("F1536EF8-92EC-443C-9ED7-FDADF150DA82")] // = VSConstants.UICONTEXT_SolutionExists.ToString()
// there is bug in vs 2015 for associating language service with code expansion
// https://social.msdn.microsoft.com/Forums/vstudio/en-US/41f559c9-fa86-4108-b516-2d2fabd432a2/code-snippets-not-working-in-vs-2012?forum=vsx
[ProvideLanguageCodeExpansion(typeof(LanguageService), Configuration.Name, 110, Configuration.Name,
@"%InstallRoot%\NPL\Snippets\%LCID%\SnippetsIndex.xml",
// the paths of the snippet files
SearchPaths = @"%InstallRoot%\NPL\Snippets\%LCID%\Lua\;",
ForceCreateDirs = @"%InstallRoot%\NPL\Snippets\%LCID%\Lua\;")]
[Guid(GuidList.guidNPLLanguageServicePkgString)]
public sealed class NPLLanguageServicePackage : BasePackage
{
}
Does anyone have any idea? Thanks in advance!
Here is my project link:https://github.com/LiXizhi/NPL