Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Nodejs/Product/Nodejs/Jade/JadeContentTypeDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class JadeContentTypeDefinition {
public const string JadeLanguageName = "Jade";
public const string JadeContentType = "jade";
public const string JadeFileExtension = ".jade";
public const string PugFileExtension = ".pug";

/// <summary>
/// Exports the Jade content type
Expand All @@ -41,5 +42,13 @@ class JadeContentTypeDefinition {
[ContentType(JadeContentType)]
[FileExtension(JadeFileExtension)]
public FileExtensionToContentTypeDefinition IJadeFileExtension { get; set; }

/// <summary>
/// Exports the Pug file extension
/// </summary>
[Export(typeof(FileExtensionToContentTypeDefinition))]
[ContentType(JadeContentType)]
[FileExtension(PugFileExtension)]
public FileExtensionToContentTypeDefinition IPugFileExtension { get; set; }
}
}
2 changes: 1 addition & 1 deletion Nodejs/Product/Nodejs/Jade/JadeLanguageInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public int GetColorizer(IVsTextLines pBuffer, out IVsColorizer ppColorizer) {
}

public int GetFileExtensions(out string pbstrExtensions) {
pbstrExtensions = JadeContentTypeDefinition.JadeFileExtension;
pbstrExtensions = string.Join(";", new[] { JadeContentTypeDefinition.JadeFileExtension, JadeContentTypeDefinition.PugFileExtension });
return VSConstants.S_OK;
}

Expand Down
2 changes: 2 additions & 0 deletions Nodejs/Product/Nodejs/NodejsPackage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,10 @@ namespace Microsoft.NodejsTools {
[ProvideTextEditorAutomation(NodejsConstants.Nodejs, 106, 102, ProfileMigrationType.PassThrough)]
[ProvideLanguageService(typeof(JadeLanguageInfo), JadeContentTypeDefinition.JadeLanguageName, 3041, RequestStockColors = true, ShowSmartIndent = false, ShowCompletion = false, DefaultToInsertSpaces = true, HideAdvancedMembersByDefault = false, EnableAdvancedMembersOption = false, ShowDropDownOptions = false)]
[ProvideEditorExtension2(typeof(JadeEditorFactory), JadeContentTypeDefinition.JadeFileExtension, 50, __VSPHYSICALVIEWATTRIBUTES.PVA_SupportsPreview, "*:1", ProjectGuid = VSConstants.CLSID.MiscellaneousFilesProject_string, NameResourceID = 3041, EditorNameResourceId = 3045)]
[ProvideEditorExtension2(typeof(JadeEditorFactory), JadeContentTypeDefinition.PugFileExtension, 50, __VSPHYSICALVIEWATTRIBUTES.PVA_SupportsPreview, "*:1", ProjectGuid = VSConstants.CLSID.MiscellaneousFilesProject_string, NameResourceID = 3041, EditorNameResourceId = 3045)]
[ProvideEditorLogicalView(typeof(JadeEditorFactory), VSConstants.LOGVIEWID.TextView_string)]
[ProvideLanguageExtension(typeof(JadeEditorFactory), JadeContentTypeDefinition.JadeFileExtension)]
[ProvideLanguageExtension(typeof(JadeEditorFactory), JadeContentTypeDefinition.PugFileExtension)]
[ProvideTextEditorAutomation(JadeContentTypeDefinition.JadeLanguageName, 3041, 3045, ProfileMigrationType.PassThrough)]
[ProvideLanguageEditorOptionPage(typeof(NodejsFormattingSpacingOptionsPage), NodejsConstants.Nodejs, "Formatting", "Spacing", "3042")]
[ProvideLanguageEditorOptionPage(typeof(NodejsFormattingBracesOptionsPage), NodejsConstants.Nodejs, "Formatting", "Braces", "3043")]
Expand Down
24 changes: 23 additions & 1 deletion Nodejs/Product/Nodejs/Project/ImportWizard/ImportSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,34 @@

namespace Microsoft.NodejsTools.Project.ImportWizard {
internal class ImportSettings : DependencyObject {
public static readonly string DefaultLanguageExtensionsFilter = string.Join(";",
new[] {
".txt",
".htm",
".html",
".css",
".png",
".jpg",
".gif",
".bmp",
".ico",
".svg",
".json",
".md",
".ejs",
".styl",
".xml",
".ts",
Jade.JadeContentTypeDefinition.JadeFileExtension,
Jade.JadeContentTypeDefinition.PugFileExtension
}.Select(x => "*" + x));

private bool _isAutoGeneratedProjectPath;

public ImportSettings() {
TopLevelJavaScriptFiles = new BulkObservableCollection<string>();

Filters = "*.txt;*.htm;*.html;*.css;*.png;*.jpg;*.gif;*.bmp;*.ico;*.svg;*.json;*.md;*.ejs;*.styl;*.jade;*.xml;*.ts";
Filters = DefaultLanguageExtensionsFilter;
}

public string ProjectPath {
Expand Down