Skip to content

Conversation

@CyrusNajmabadi
Copy link
Member

This is part 1 of 2. The second part will provide the hooks to asp.net to use this.

@ghost ghost added the Area-IDE label Jun 10, 2022
internal sealed class CSharpJsonEmbeddedLanguageBraceMatcher :
AbstractJsonEmbeddedLanguageBraceMatcher
PredefinedEmbeddedLanguageNames.Json, LanguageNames.CSharp, supportsUnannotatedAPIs: true, "Json"), Shared]
internal sealed class CSharpJsonBraceMatcher : AbstractJsonBraceMatcher
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of having names for each embeded-language/feature-name pair, we just have the names of hte embedded languages once.

[ImportingConstructor]
[Obsolete(MefConstruction.ImportingConstructorMessage, error: true)]
public CSharpJsonEmbeddedLanguageBraceMatcher()
public CSharpJsonBraceMatcher()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved to a simpler and more consistent naming pattern. Instead of repeating 'EmbeddedLanguage' in teh name, we just state the name of the embedded language. Regex/Json are already clearly embedded langauges, so this cut down on verbosity everywhere.

: base(name, language, identifiers)
{
SupportsUnannotatedAPIs = supportsUnannotatedAPIs;
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

at this point, this pattern is repeated 3 times. strongly thinking of just converting it to two classes which take in the typeof(IEmbeddedLanguageDocumentHighlightsService) etc. data as a parameter at teh use site.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opened #61853 to simplify this.

src\Analyzers\VisualBasic\CodeFixes\VisualBasicCodeFixes.projitems*{0141285d-8f6c-42c7-baf3-3c0ccd61c716}*SharedItemsImports = 5
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\VisualBasicWorkspaceExtensions.projitems*{0141285d-8f6c-42c7-baf3-3c0ccd61c716}*SharedItemsImports = 5
src\Compilers\CSharp\CommandLine\CscCommandLine.projitems*{0161e25c-918a-4dc8-9648-30fdcc8e31e9}*SharedItemsImports = 5
src\Compilers\CSharp\csc\CscCommandLine.projitems*{0161e25c-918a-4dc8-9648-30fdcc8e31e9}*SharedItemsImports = 5
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jaredpar not sure what's going on here. every time i undo this, vs changes it back.

@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner June 13, 2022 18:00
@CyrusNajmabadi CyrusNajmabadi enabled auto-merge June 13, 2022 19:08
@CyrusNajmabadi CyrusNajmabadi merged commit 36ddff6 into dotnet:main Jun 13, 2022
@ghost ghost added this to the Next milestone Jun 13, 2022
@CyrusNajmabadi CyrusNajmabadi deleted the aspHighlights branch June 13, 2022 20:58
@RikkiGibson RikkiGibson modified the milestones: Next, 17.3 P3 Jun 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants