Skip to content
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

Semantic snippets: Add inline statement snippets #67819

Merged
merged 4 commits into from
May 1, 2023

Conversation

DoctorKrolic
Copy link
Contributor

First commit: added all abstractions for inline statement snippets. Made if and while statements inline
Second commit: while working I noticed that all current snippets produce a single TextChange, so abstracted that in a separate class
Third commit: made foreach snippet inline as well. It required a little change in the abstraction frameork made in commit 1

Closes: #60628

Demo:
foreach

@DoctorKrolic DoctorKrolic requested a review from a team as a code owner April 14, 2023 14:25
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Apr 14, 2023
@ghost ghost added the Community The pull request was submitted by a contributor who is not a Microsoft employee. label Apr 14, 2023
@MartyIX
Copy link
Contributor

MartyIX commented Apr 17, 2023

Is there a documentation / a blog post regarding semantic snippets in general? Sorry to asking here. I'm just curious.

@DoctorKrolic
Copy link
Contributor Author

The original proposal is #56541. A few things changed (e.g. as far as I know there is no intend to make snippet text as descriptions, e.g. write to the console, but as shortcuts as it were before (cw)). In general most thing there are still valid there

@DoctorKrolic
Copy link
Contributor Author

Can I get a review here? @akhera99 I cannot just add you to review list since I am an external contributor, so tagging you explicitely.

Copy link
Member

@akhera99 akhera99 left a comment

Choose a reason for hiding this comment

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

Looks good to me! Thanks for the contribution!

@akhera99 akhera99 merged commit e25732e into dotnet:main May 1, 2023
@ghost ghost added this to the Next milestone May 1, 2023
@DoctorKrolic DoctorKrolic deleted the inline-statement-snippets branch May 1, 2023 18:03
333fred added a commit to 333fred/roslyn that referenced this pull request May 2, 2023
* upstream/main: (2060 commits)
  implement code folding for anonymous objects
  Cleanup/perf in creating member maps. (dotnet#67997)
  Address feedback, clean the use of ILegacyGlobalOptionsWorkspaceService
  Update Publish.json
  Semantic snippets: Add inline statement snippets (dotnet#67819)
  Update VSSDK Build tools version
  Update doc comment
  Address feedback
  Move declaration near reference
  Address feedback
  Avoid stack overflow due to deep recursion on long chain of calls. (dotnet#67913)
  Check ILegacyGlobalOptionsWorkspaceService is null
  test scout queue
  add test
  update editor
  "Where" clause typo fix (dotnet#68002)
  Use `Keyword` helper method instead of hardcoding keyword help terms
  Move the SyntaxTree and SemanticModel action based analyzers to respect context.FilterSpan
  EnC refactoring: Align wrappers with contracts better (dotnet#67967)
  Include EA.RazorCompiler in source build (dotnet#67996)
  ...
@Cosifne Cosifne modified the milestones: Next, 17.7 P2 May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE Community The pull request was submitted by a contributor who is not a Microsoft employee. untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
Development

Successfully merging this pull request may close these issues.

foreach autocompletion should be offered when ctrl+. is pressed on a variable representing a collection
4 participants