Changeset 2128
- Timestamp:
- Dec 1, 2012, 7:47:53 PM (10 years ago)
- Location:
- trunk/tools/vslol
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/vslol/CppKeywordClassifier.cs
r2127 r2128 61 61 private IClassifier m_classifier; 62 62 63 private IClassificationType m_types_type, m_constant_type ;64 private Regex m_types_regex, m_constant_regex ;63 private IClassificationType m_types_type, m_constant_type, m_normal_type; 64 private Regex m_types_regex, m_constant_regex, m_normal_regex; 65 65 66 66 private static string[] m_all_types = … … 122 122 }; 123 123 124 private static string[] m_all_normal = 125 { 126 }; 127 128 private static string[] m_cpp_normal = 129 { 130 "interface|delegate|event|finally", 131 "gcnew|generic|initonly|property|sealed", 132 }; 133 124 134 internal CppKeywordClassifier(IClassificationTypeRegistryService registry, 125 135 IClassifier classifier, … … 128 138 m_classifier = classifier; 129 139 130 /* Regex for types and specifiers */131 140 m_types_type = registry.GetClassificationType("LolAnyType"); 141 m_normal_type = registry.GetClassificationType("LolAnyIdentifier"); 142 m_constant_type = registry.GetClassificationType("LolAnyConstant"); 132 143 133 144 List<string> types_list = m_all_types.ToList(); 145 List<string> constants_list = m_all_constants.ToList(); 146 List<string> normals_list = m_all_normal.ToList(); 147 134 148 if (type.IsOfType("c/c++")) 149 { 135 150 types_list = types_list.Concat(m_cpp_types).ToList(); 151 constants_list = constants_list.Concat(m_cpp_constants).ToList(); 152 normals_list = normals_list.Concat(m_cpp_normal).ToList(); 153 } 154 136 155 if (type.IsOfType("csharp")) 156 { 137 157 types_list = types_list.Concat(m_csharp_types).ToList(); 158 constants_list = constants_list.Concat(m_csharp_constants).ToList(); 159 } 160 138 161 if (type.IsOfType("lolfx")) 162 { 139 163 types_list = types_list.Concat(m_lolfx_types).ToList(); 164 constants_list = constants_list.Concat(m_lolfx_constants).ToList(); 165 } 166 140 167 m_types_regex = 141 new Regex(@"\b(" + String.Join("|", types_list.ToArray()) + @")\b"); 142 143 /* Regex for constant words */ 144 m_constant_type = registry.GetClassificationType("LolAnyConstant"); 145 146 List<string> constants_list = m_all_constants.ToList(); 147 if (type.IsOfType("c/c++")) 148 constants_list = constants_list.Concat(m_cpp_constants).ToList(); 149 if (type.IsOfType("csharp")) 150 constants_list = constants_list.Concat(m_csharp_constants).ToList(); 151 if (type.IsOfType("lolfx")) 152 constants_list = constants_list.Concat(m_lolfx_constants).ToList(); 168 new Regex("^(" + String.Join("|", types_list.ToArray()) + ")$"); 153 169 m_constant_regex = 154 new Regex(@"\b(" + String.Join("|", constants_list.ToArray()) + @")\b"); 170 new Regex("^(" + String.Join("|", constants_list.ToArray()) + ")$"); 171 m_normal_regex = 172 new Regex("^(" + String.Join("|", normals_list.ToArray()) + ")$"); 155 173 } 156 174 … … 177 195 continue; 178 196 } 197 198 if (m_normal_regex.IsMatch(cs.Span.GetText())) 199 { 200 ret.Add(new ClassificationSpan(cs.Span, m_normal_type)); 201 continue; 202 } 179 203 } 180 204 … … 243 267 [Name(LolCppConstantFormat.m_name)] 244 268 internal static ClassificationTypeDefinition LolCustomConstantType = null; 269 270 [Export(typeof(ClassificationTypeDefinition))] 271 [Name(LolCppIdentifierFormat.m_name)] 272 internal static ClassificationTypeDefinition LolCustomIdentifierType = null; 245 273 } 246 274 … … 255 283 public LolCppTypeFormat() 256 284 { 257 this.DisplayName = "C/C++ Types and Qualifiers ";285 this.DisplayName = "C/C++ Types and Qualifiers (VsLol)"; 258 286 this.ForegroundColor = Colors.Lime; 259 287 this.ForegroundOpacity = 1.0; … … 273 301 public LolCppConstantFormat() 274 302 { 275 this.DisplayName = "C/C++ Constants ";303 this.DisplayName = "C/C++ Constants (VsLol)"; 276 304 this.ForegroundColor = Colors.Magenta; 277 305 this.ForegroundOpacity = 1.0; … … 281 309 } 282 310 311 [Export(typeof(EditorFormatDefinition))] 312 [ClassificationType(ClassificationTypeNames = LolCppIdentifierFormat.m_name)] 313 [Name(LolCppIdentifierFormat.m_name)] 314 [UserVisible(true)] 315 [Order(After = Priority.Default)] /* Override the Visual Studio classifiers */ 316 internal sealed class LolCppIdentifierFormat : LolGenericFormat 317 { 318 public const string m_name = "LolAnyIdentifier"; 319 public LolCppIdentifierFormat() 320 { 321 this.DisplayName = "C/C++ Identifiers (VsLol)"; 322 this.ForegroundColor = Colors.Silver; 323 this.ForegroundOpacity = 1.0; 324 this.IsBold = false; 325 CopyStyleColor(PredefinedClassificationTypeNames.Identifier); 326 } 327 } 328 283 329 } /* namespace lol */ -
trunk/tools/vslol/Properties/AssemblyInfo.cs
r2123 r2128 30 30 [assembly: Guid("58968f91-edb8-4a4c-9f4f-ba39fdb4a21a")] 31 31 32 [assembly: AssemblyVersion("1.0.0. 5")]33 [assembly: AssemblyFileVersion("1.0.0. 5")]32 [assembly: AssemblyVersion("1.0.0.6")] 33 [assembly: AssemblyFileVersion("1.0.0.6")] -
trunk/tools/vslol/source.extension.vsixmanifest
r2122 r2128 4 4 <Name>VsLol</Name> 5 5 <Author>Lol</Author> 6 <Version>1.0.0. 5</Version>6 <Version>1.0.0.6</Version> 7 7 <Description xml:space="preserve">Lol Engine Productivity Tools.</Description> 8 8 <Locale>1033</Locale>
Note: See TracChangeset
for help on using the changeset viewer.