Break out embedded language classification (MEF side)#59905
Break out embedded language classification (MEF side)#59905CyrusNajmabadi merged 10 commits intodotnet:release/dev17.3from
Conversation
| new JsonEmbeddedLanguageEditorFeatures(info), | ||
| new RegexEmbeddedLanguageEditorFeatures(this, info), | ||
| new FallbackEmbeddedLanguage(info)); | ||
| new RegexEmbeddedLanguageEditorFeatures(this, info)); |
There was a problem hiding this comment.
intentional. the fallbackembeddedlanguage went away. it was only there for classification, and now classification is handled using a normal MEF registration path.
| @@ -11,9 +11,5 @@ namespace Microsoft.CodeAnalysis.EmbeddedLanguages.LanguageServices | |||
| /// </summary> | |||
| internal interface IEmbeddedLanguage | |||
There was a problem hiding this comment.
questionable if IEmbeddedLanguage serves any purpose now. a followup PR will try to remove it.
| internal static class PredefinedEmbeddedLanguageClassifierNames | ||
| { | ||
| /// <summary> | ||
| /// A special built-in classifier for classifying escapes in strings and character literals if no other embedded |
There was a problem hiding this comment.
Would be nice if there was an [Order(After = OrderAttribute.AllOthers)] or something, and then this could be "just" another classifier, and be given a better name (EscapeCharacterClassifier perhaps)
There was a problem hiding this comment.
I'm actually even removing this fromthis list, and we'll just have this baked in as something special :)
I really like the direction here |
Coming in next PR which i'm working on now :) |
Followup to #59896
This moves to exporting embeded language classifiers using standard MEF mechanisms.
WIth this, a 3rd party (like ASP) would be able to add their own classifier for their own dsl strings.
Next followup will be to autodetect strings that have
// lang=lang_nameon it or which have theStringSyntaxAttribute. We'll allow lang classifiers to specify the string-name that they are exported for, and we'll auto call into them if we find these codemarkers.