From af10044e449d95aa546e88d63004590099b7faf2 Mon Sep 17 00:00:00 2001 From: Mikayla Hutchinson Date: Fri, 19 Apr 2024 00:52:20 -0400 Subject: [PATCH] Add support for JavaScript projects Fixes #201 --- .../MSBuildEditorVisualStudioPackage.cs | 2 + .../languages.pkgdef | 6 +++ .../MonoDevelop.MSBuild.csproj | 2 +- MonoDevelop.MSBuild/Schema/BuiltInSchema.cs | 1 + MonoDevelop.MSBuild/Schema/BuiltInSchemaId.cs | 1 + .../Schemas/JavaScript.buildschema.json | 42 +++++++++++++++++++ .../Workspace/MSBuildFileExtension.cs | 5 ++- .../Workspace/MSBuildFileKind.cs | 5 +++ .../Workspace/MSBuildFileKindExtensions.cs | 4 ++ 9 files changed, 65 insertions(+), 3 deletions(-) create mode 100644 MonoDevelop.MSBuild/Schemas/JavaScript.buildschema.json diff --git a/MonoDevelop.MSBuild.Editor.VisualStudio/MSBuildEditorVisualStudioPackage.cs b/MonoDevelop.MSBuild.Editor.VisualStudio/MSBuildEditorVisualStudioPackage.cs index f2af4efd..e9865a31 100644 --- a/MonoDevelop.MSBuild.Editor.VisualStudio/MSBuildEditorVisualStudioPackage.cs +++ b/MonoDevelop.MSBuild.Editor.VisualStudio/MSBuildEditorVisualStudioPackage.cs @@ -48,6 +48,7 @@ namespace MonoDevelop.MSBuild.Editor.VisualStudio [ProvideLanguageExtension (typeof (MSBuildLanguageService), MSBuildFileExtension.xproj)] [ProvideLanguageExtension (typeof (MSBuildLanguageService), MSBuildFileExtension.vcxproj)] [ProvideLanguageExtension (typeof (MSBuildLanguageService), MSBuildFileExtension.sfxproj)] + [ProvideLanguageExtension (typeof (MSBuildLanguageService), MSBuildFileExtension.esproj)] [ProvideLanguageExtension (typeof (MSBuildLanguageService), MSBuildFileExtension.proj)] [ProvideLanguageExtension (typeof (MSBuildLanguageService), MSBuildFileExtension.user)] [ProvideLanguageExtension (typeof (MSBuildLanguageService), MSBuildFileExtension.pubxml)] @@ -67,6 +68,7 @@ namespace MonoDevelop.MSBuild.Editor.VisualStudio [ProvideEditorExtension (typeof (MSBuildEditorFactory), MSBuildFileExtension.xproj, 65535)] [ProvideEditorExtension (typeof (MSBuildEditorFactory), MSBuildFileExtension.vcxproj, 65535)] [ProvideEditorExtension (typeof (MSBuildEditorFactory), MSBuildFileExtension.sfxproj, 65535)] + [ProvideEditorExtension (typeof (MSBuildEditorFactory), MSBuildFileExtension.esproj, 65535)] [ProvideEditorExtension (typeof (MSBuildEditorFactory), MSBuildFileExtension.proj, 65535)] [ProvideEditorExtension (typeof (MSBuildEditorFactory), MSBuildFileExtension.user, 65535)] [ProvideEditorExtension (typeof (MSBuildEditorFactory), MSBuildFileExtension.pubxml, 65535)] diff --git a/MonoDevelop.MSBuild.Editor.VisualStudio/languages.pkgdef b/MonoDevelop.MSBuild.Editor.VisualStudio/languages.pkgdef index 781f2b74..ca4f0bb5 100644 --- a/MonoDevelop.MSBuild.Editor.VisualStudio/languages.pkgdef +++ b/MonoDevelop.MSBuild.Editor.VisualStudio/languages.pkgdef @@ -46,6 +46,12 @@ [$RootKey$\XmlChooserFactory\MSBuild\vcxproj] "Extension"="vcxproj" +[$RootKey$\XmlChooserFactory\MSBuild\sfxproj] +"Extension"="sfxproj" + +[$RootKey$\XmlChooserFactory\MSBuild\esproj] +"Extension"="esproj" + [$RootKey$\XmlChooserFactory\MSBuild\proj] "Extension"="proj" diff --git a/MonoDevelop.MSBuild/MonoDevelop.MSBuild.csproj b/MonoDevelop.MSBuild/MonoDevelop.MSBuild.csproj index 66fdad34..d8c38d81 100644 --- a/MonoDevelop.MSBuild/MonoDevelop.MSBuild.csproj +++ b/MonoDevelop.MSBuild/MonoDevelop.MSBuild.csproj @@ -78,5 +78,5 @@ LogicalName="MonoDevelop.MSBuild.%(Filename).resources" /> - + diff --git a/MonoDevelop.MSBuild/Schema/BuiltInSchema.cs b/MonoDevelop.MSBuild/Schema/BuiltInSchema.cs index b8ce27ca..ab6bf684 100644 --- a/MonoDevelop.MSBuild/Schema/BuiltInSchema.cs +++ b/MonoDevelop.MSBuild/Schema/BuiltInSchema.cs @@ -45,6 +45,7 @@ static MSBuildSchema Load (BuiltInSchemaId[] schemaIds, out IList + /// The project is a JavaScript Project System project + /// + ESProj = Project + 7, + /// /// If this flag is set, the file is a .user file used to store user-specific settings and customizations for a project file. /// diff --git a/MonoDevelop.MSBuild/Workspace/MSBuildFileKindExtensions.cs b/MonoDevelop.MSBuild/Workspace/MSBuildFileKindExtensions.cs index 5e05f0a9..66f7f37a 100644 --- a/MonoDevelop.MSBuild/Workspace/MSBuildFileKindExtensions.cs +++ b/MonoDevelop.MSBuild/Workspace/MSBuildFileKindExtensions.cs @@ -86,6 +86,9 @@ static MSBuildFileKind GetProjectFileKind (string extension) if (string.Equals (extension, MSBuildFileExtension.sfxproj, StringComparison.OrdinalIgnoreCase)) { return MSBuildFileKind.SfxProj; } + if (string.Equals (extension, MSBuildFileExtension.esproj, StringComparison.OrdinalIgnoreCase)) { + return MSBuildFileKind.ESProj; + } if (string.Equals (extension, MSBuildFileExtension.pubxml, StringComparison.OrdinalIgnoreCase)) { return MSBuildFileKind.PubXml; } @@ -127,6 +130,7 @@ public static bool IsUserProj (this MSBuildFileKind kind, out MSBuildFileKind pr MSBuildFileKind.XProj => isUserProj ? "User settings for a generic MonoDevelop project file" : "Generic MonoDevelop project file", MSBuildFileKind.VcxProj => isUserProj ? "User settings for a C++ project file" : "C++ project file", MSBuildFileKind.SfxProj => isUserProj ? "User settings for a Shared Framework project file" : "Shared Framework project file", + MSBuildFileKind.ESProj => isUserProj ? "User settings for a JavaScript Project System project file" : "JavaScript Project System project file", MSBuildFileKind.Project => isUserProj ? "User settings for a project file" : "Project file", _ => null };