-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Semantic snippets - while snippet #64893
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
...table/Snippets/SnippetProviders/AbstractConditionalExpressionAndBlockBasedSnippetProvider.cs
Outdated
Show resolved
Hide resolved
src/Features/CSharp/Portable/Snippets/CSharpWhileLoopSnippetProvider.cs
Outdated
Show resolved
Hide resolved
| return newIndentation.GetIndentationString(parsedDocument.Text, syntaxFormattingOptions.UseTabs, syntaxFormattingOptions.TabSize) + newLine; | ||
| } | ||
|
|
||
| protected override async Task<Document> AddIndentationToDocumentAsync(Document document, int position, ISyntaxFacts syntaxFacts, CancellationToken cancellationToken) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The indentation should probably be abstracted out for every block - since most of them are exactly the same. I'll do that in a follow-up PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The vast majority of snippets have such block, so this definitely needs an abstraction. I am only not sure how it will work if semantic snippets become a VB thing as well
...table/Snippets/SnippetProviders/AbstractConditionalExpressionAndBlockBasedSnippetProvider.cs
Outdated
Show resolved
Hide resolved
|
From a cursory glance, this looks really good! I'll do a more in depth review by the beginning of the week |
...ers/Snippets/AbstractCSharpConditionExpressionAndBlockBasedSnippetCompletionProviderTests.cs
Outdated
Show resolved
Hide resolved
src/Features/Core/Portable/Snippets/SnippetProviders/AbstractWhileLoopSnippetProvider.cs
Outdated
Show resolved
Hide resolved
src/Features/Core/Portable/Snippets/SnippetProviders/AbstractWhileLoopSnippetProvider.cs
Outdated
Show resolved
Hide resolved
|
Looks good to me with the fixes I suggested! |
Co-authored-by: Ankita Khera <[email protected]>
Co-authored-by: Ankita Khera <[email protected]>
|
Looks good, thanks for contributing! |
I noticed that
ifandwhilestatements are very similar, but there was a semantic snippet only forif. I tried to abstract as lot of logic as possible, but unfortunatelyIfStatementSyntaxandWhileStatementSyntaxdon't have a common ancestor, so there is still some amount of code duplication(@akhera99 You are the master here, waiting for your review)