diff --git a/Gcode15/Gcode15/Gcode15.csproj.user b/Gcode15/Gcode15/Gcode15.csproj.user index 48601fd..20184fd 100644 --- a/Gcode15/Gcode15/Gcode15.csproj.user +++ b/Gcode15/Gcode15/Gcode15.csproj.user @@ -4,6 +4,7 @@ Program C:\Program Files %28x86%29\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe /rootsuffix Exp + Program diff --git a/Gcode15/Gcode15/obj/Release/.NETFramework,Version=v4.5.2.AssemblyAttributes.cs b/Gcode15/Gcode15/obj/Release/.NETFramework,Version=v4.5.2.AssemblyAttributes.cs new file mode 100644 index 0000000..f1a77a1 --- /dev/null +++ b/Gcode15/Gcode15/obj/Release/.NETFramework,Version=v4.5.2.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.5.2", FrameworkDisplayName = ".NET Framework 4.5.2")] diff --git a/Gcode15/Gcode15/obj/Release/Gcode15.csproj.FileListAbsolute.txt b/Gcode15/Gcode15/obj/Release/Gcode15.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..e69de29 diff --git a/GcodeClassifier.cs b/GcodeClassifier.cs index 026af6e..7e5c7be 100644 --- a/GcodeClassifier.cs +++ b/GcodeClassifier.cs @@ -3,15 +3,12 @@ namespace GcodeLanguage { using System; using System.Collections.Generic; - using System.ComponentModel.Composition; using Microsoft.VisualStudio.Text; using Microsoft.VisualStudio.Text.Classification; - using Microsoft.VisualStudio.Text.Editor; using Microsoft.VisualStudio.Text.Tagging; - using Microsoft.VisualStudio.Utilities; /// - /// Classifier that classifies all text as an instance of the "GcodeClassifier" classification type. - /// + /// Classifier that classifies all text as an instance of the "GcodeClassifier" classification type. + /// // internal class GcodeClassifier : IClassifier // { // /// @@ -124,7 +121,7 @@ internal GcodeClassifier(ITextBuffer buffer, _GcodeTypes[GcodeTokenTypes.Gcode_9] = typeService.GetClassificationType("Gcode_9"); _GcodeTypes[GcodeTokenTypes.Gcode_Comment] = typeService.GetClassificationType("Gcode_Comment"); - + _GcodeTypes[GcodeTokenTypes.Gcode_ocode] = typeService.GetClassificationType("Gcode_ocode"); // if typeService.GetClassificationType returns Null, check GcodeClassifierClassificationDefinition diff --git a/GcodeClassifierClassificationDefinition.cs b/GcodeClassifierClassificationDefinition.cs index 471a5c1..7702d7e 100644 --- a/GcodeClassifierClassificationDefinition.cs +++ b/GcodeClassifierClassificationDefinition.cs @@ -1,6 +1,6 @@ -using System.ComponentModel.Composition; -using Microsoft.VisualStudio.Text.Classification; +using Microsoft.VisualStudio.Text.Classification; using Microsoft.VisualStudio.Utilities; +using System.ComponentModel.Composition; namespace GcodeLanguage { @@ -22,7 +22,7 @@ internal static class GcodeClassifierClassificationDefinition #pragma warning restore 169 /// - /// Defines the Gcode_A classification type. + /// Defines the Gcode_Undefined classification type. /// [Export(typeof(ClassificationTypeDefinition))] [Name("Gcode_Undefined")] diff --git a/GcodeClassifierFormat.cs b/GcodeClassifierFormat.cs index 9dd6922..b322afa 100644 --- a/GcodeClassifierFormat.cs +++ b/GcodeClassifierFormat.cs @@ -1,7 +1,7 @@ -using System.ComponentModel.Composition; -using System.Windows.Media; -using Microsoft.VisualStudio.Text.Classification; +using Microsoft.VisualStudio.Text.Classification; using Microsoft.VisualStudio.Utilities; +using System.ComponentModel.Composition; +using System.Windows.Media; namespace GcodeLanguage { @@ -174,7 +174,8 @@ internal sealed class Gcode_F : ClassificationFormatDefinition public Gcode_F() { DisplayName = "Gcode - F"; //human readable version of the name (in Tools>Options>Environment>Fonts and Colors>Text Editor - ForegroundColor = Colors.BlueViolet; + //ForegroundColor = Colors.DarkGoldenrod; + ForegroundColor = Color.FromRgb(192, 64, 128); } } #endregion @@ -199,7 +200,9 @@ internal sealed class Gcode_G : ClassificationFormatDefinition public Gcode_G() { DisplayName = "Gcode - G"; //human readable version of the name (in Tools>Options>Environment>Fonts and Colors>Text Editor - ForegroundColor = Colors.Coral; + //ForegroundColor = Colors.Blue; + ForegroundColor = Color.FromRgb(0, 0, 255); + } } #endregion @@ -249,7 +252,8 @@ internal sealed class Gcode_I : ClassificationFormatDefinition public Gcode_I() { DisplayName = "Gcode - I"; //human readable version of the name (in Tools>Options>Environment>Fonts and Colors>Text Editor - ForegroundColor = Colors.BlueViolet; + //ForegroundColor = Colors.Chocolate; + ForegroundColor = Color.FromRgb(192, 0, 0); } } #endregion @@ -274,7 +278,8 @@ internal sealed class Gcode_J : ClassificationFormatDefinition public Gcode_J() { DisplayName = "Gcode - J"; //human readable version of the name (in Tools>Options>Environment>Fonts and Colors>Text Editor - ForegroundColor = Colors.BlueViolet; + //ForegroundColor = Colors.RosyBrown; + ForegroundColor = Color.FromRgb(192, 0, 128); } } #endregion @@ -299,7 +304,8 @@ internal sealed class Gcode_K : ClassificationFormatDefinition public Gcode_K() { DisplayName = "Gcode - K"; //human readable version of the name (in Tools>Options>Environment>Fonts and Colors>Text Editor - ForegroundColor = Colors.BlueViolet; + //ForegroundColor = Colors.CornflowerBlue; + ForegroundColor = Color.FromRgb(192, 128, 0); } } #endregion @@ -349,7 +355,8 @@ internal sealed class Gcode_M : ClassificationFormatDefinition public Gcode_M() { DisplayName = "Gcode - M"; //human readable version of the name (in Tools>Options>Environment>Fonts and Colors>Text Editor - ForegroundColor = Colors.Coral; + //ForegroundColor = Colors.DarkBlue; + ForegroundColor = Color.FromRgb(0, 64, 255); } } #endregion @@ -474,7 +481,8 @@ internal sealed class Gcode_R : ClassificationFormatDefinition public Gcode_R() { DisplayName = "Gcode - R"; //human readable version of the name (in Tools>Options>Environment>Fonts and Colors>Text Editor - ForegroundColor = Colors.BlueViolet; + //ForegroundColor = Colors.OrangeRed; + ForegroundColor = Color.FromRgb(255, 0, 0); } } #endregion @@ -524,7 +532,8 @@ internal sealed class Gcode_T : ClassificationFormatDefinition public Gcode_T() { DisplayName = "Gcode - T"; //human readable version of the name (in Tools>Options>Environment>Fonts and Colors>Text Editor - ForegroundColor = Colors.BlueViolet; + //ForegroundColor = Colors.RoyalBlue; + ForegroundColor = Color.FromRgb(128, 64, 0); } } #endregion @@ -624,8 +633,8 @@ internal sealed class Gcode_X : ClassificationFormatDefinition public Gcode_X() { DisplayName = "Gcode - X"; //human readable version of the name (in Tools>Options>Environment>Fonts and Colors>Text Editor - ForegroundColor = Colors.Tomato; - BackgroundColor = Colors.MidnightBlue; + //ForegroundColor = Colors.Brown; + ForegroundColor = Color.FromRgb(128, 0, 0); } } #endregion @@ -650,8 +659,8 @@ internal sealed class Gcode_Y : ClassificationFormatDefinition public Gcode_Y() { DisplayName = "Gcode - Y"; //human readable version of the name (in Tools>Options>Environment>Fonts and Colors>Text Editor - ForegroundColor = Colors.LawnGreen; - BackgroundColor = Colors.MidnightBlue; + //ForegroundColor = Colors.Peru; + ForegroundColor = Color.FromRgb(128, 0, 128); } } #endregion @@ -676,8 +685,8 @@ internal sealed class Gcode_Z : ClassificationFormatDefinition public Gcode_Z() { DisplayName = "Gcode - Z"; //human readable version of the name (in Tools>Options>Environment>Fonts and Colors>Text Editor - ForegroundColor = Colors.Cyan; - BackgroundColor = Colors.MidnightBlue; + //ForegroundColor = Colors.DarkCyan; + ForegroundColor = Color.FromRgb(255, 128, 0); } } #endregion diff --git a/GcodeClassifierProvider.cs b/GcodeClassifierProvider.cs index 40275ec..12ae4c5 100644 --- a/GcodeClassifierProvider.cs +++ b/GcodeClassifierProvider.cs @@ -1,12 +1,9 @@  namespace GcodeLanguage { - using System; - using System.Collections.Generic; using System.ComponentModel.Composition; using Microsoft.VisualStudio.Text; using Microsoft.VisualStudio.Text.Classification; - using Microsoft.VisualStudio.Text.Editor; using Microsoft.VisualStudio.Text.Tagging; using Microsoft.VisualStudio.Utilities; // /// @@ -82,6 +79,13 @@ internal sealed class GcodeClassifierProvider : ITaggerProvider [BaseDefinition("projection")] internal static FileExtensionToContentTypeDefinition GcodeFileTypeNC = null; + [Export] + [FileExtension(".tgc")] // semi-colon delimited file extensions work only in VS2017/2019 - so we create multiple FileExtensionToContentTypeDefinition + [ContentType("Gcode")] + [BaseDefinition("code")] + [BaseDefinition("projection")] + internal static FileExtensionToContentTypeDefinition GcodeFileTypeTGC = null; + [Import] internal IClassificationTypeRegistryService ClassificationTypeRegistry = null; diff --git a/GcodeLanguageExtension.csproj b/GcodeLanguageExtension.csproj index ad59ecc..7ebcb26 100644 --- a/GcodeLanguageExtension.csproj +++ b/GcodeLanguageExtension.csproj @@ -62,6 +62,7 @@ TRACE prompt 4 + AnyCPU @@ -78,6 +79,7 @@ true + Always Always @@ -95,87 +97,87 @@ packages\Microsoft.VisualStudio.CoreUtility.14.3.25407\lib\net45\Microsoft.VisualStudio.CoreUtility.dll - True + False packages\Microsoft.VisualStudio.Editor.14.3.25407\lib\net45\Microsoft.VisualStudio.Editor.dll - True + False packages\Microsoft.VisualStudio.Imaging.14.3.25407\lib\net45\Microsoft.VisualStudio.Imaging.dll - True + False packages\Microsoft.VisualStudio.Language.Intellisense.14.3.25407\lib\net45\Microsoft.VisualStudio.Language.Intellisense.dll - True + False packages\Microsoft.VisualStudio.OLE.Interop.7.10.6070\lib\Microsoft.VisualStudio.OLE.Interop.dll - True + False packages\Microsoft.VisualStudio.Shell.14.0.14.3.25407\lib\Microsoft.VisualStudio.Shell.14.0.dll - True + False packages\Microsoft.VisualStudio.Shell.Immutable.10.0.10.0.30319\lib\net40\Microsoft.VisualStudio.Shell.Immutable.10.0.dll - True + False packages\Microsoft.VisualStudio.Shell.Immutable.11.0.11.0.50727\lib\net45\Microsoft.VisualStudio.Shell.Immutable.11.0.dll - True + False packages\Microsoft.VisualStudio.Shell.Immutable.12.0.12.0.21003\lib\net45\Microsoft.VisualStudio.Shell.Immutable.12.0.dll - True + False packages\Microsoft.VisualStudio.Shell.Immutable.14.0.14.3.25407\lib\net45\Microsoft.VisualStudio.Shell.Immutable.14.0.dll - True + False packages\Microsoft.VisualStudio.Shell.Interop.7.10.6071\lib\Microsoft.VisualStudio.Shell.Interop.dll - True + False packages\Microsoft.VisualStudio.Shell.Interop.8.0.8.0.50727\lib\Microsoft.VisualStudio.Shell.Interop.8.0.dll - True + False packages\Microsoft.VisualStudio.Shell.Interop.9.0.9.0.30729\lib\Microsoft.VisualStudio.Shell.Interop.9.0.dll - True + False packages\Microsoft.VisualStudio.Text.Data.14.3.25407\lib\net45\Microsoft.VisualStudio.Text.Data.dll - True + False packages\Microsoft.VisualStudio.Text.Logic.14.3.25407\lib\net45\Microsoft.VisualStudio.Text.Logic.dll - True + False packages\Microsoft.VisualStudio.Text.UI.14.3.25407\lib\net45\Microsoft.VisualStudio.Text.UI.dll - True + False packages\Microsoft.VisualStudio.Text.UI.Wpf.14.3.25407\lib\net45\Microsoft.VisualStudio.Text.UI.Wpf.dll - True + False packages\Microsoft.VisualStudio.TextManager.Interop.7.10.6070\lib\Microsoft.VisualStudio.TextManager.Interop.dll - True + False packages\Microsoft.VisualStudio.TextManager.Interop.8.0.8.0.50727\lib\Microsoft.VisualStudio.TextManager.Interop.8.0.dll - True + False packages\Microsoft.VisualStudio.Threading.14.1.111\lib\net45\Microsoft.VisualStudio.Threading.dll - True + False packages\Microsoft.VisualStudio.Validation.14.1.111\lib\net45\Microsoft.VisualStudio.Validation.dll - True + False diff --git a/images/GcodeLanguageExtension.png b/images/GcodeLanguageExtension.png index ac8527f..1fee62c 100644 Binary files a/images/GcodeLanguageExtension.png and b/images/GcodeLanguageExtension.png differ diff --git a/source.extension.vsixmanifest b/source.extension.vsixmanifest index a7a915f..a6589fe 100644 --- a/source.extension.vsixmanifest +++ b/source.extension.vsixmanifest @@ -1,24 +1,29 @@  - - - Gcode Language Extension - G-Code highlighting extension to the Visual Studio Editor. - https://github.com/gojimmypi/GcodeLanguageExtension - LICENSE.md - Gcode-syntax-highlighting-icon.jpg - gcode syntax highlighting cnc 3dprinter g-code g.code - - - - - - - - - - - - - + + + Gcode Language Extension + G-Code highlighting extension to the Visual Studio Editor. + https://github.com/gojimmypi/GcodeLanguageExtension + LICENSE.md + Gcode-syntax-highlighting-icon.jpg + gcode syntax highlighting cnc 3dprinter g-code g.code + + + + x86 + + + amd64 + + + + + + + + + + +