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

Code snippets whose shortcuts start with # cannot be used #54038

Closed
vsfeedback opened this issue Jun 11, 2021 · 2 comments · Fixed by #54158
Closed

Code snippets whose shortcuts start with # cannot be used #54038

vsfeedback opened this issue Jun 11, 2021 · 2 comments · Fixed by #54158
Assignees
Labels
Area-IDE Bug Developer Community The issue was originally reported on https://developercommunity.visualstudio.com Regression Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented
Milestone

Comments

@vsfeedback
Copy link

This issue has been moved from a ticket on Developer Community.


[severity:It's more difficult to complete my work]
I've just updated VS2019 to ver. 16.10.1 and all my code snippets whose shortcuts start with '#' (hash sign) cannot be used.

Steps to reproduce:

  1. Create a code snippet (for C# in my case) and give it a shortcut '#abc'
  2. Start editing a C# file
  3. Type '#abc' and press Tab twice

Expected behaviour:
The code snipped should be inserted.

Actual behaviour:
The '#abc' text stays on the screen and two tabs are inserted afterwards.


Original Comments

Feedback Bot on 6/10/2021, 06:48 PM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.


Original Solutions

(no solutions)

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Jun 11, 2021
@RaceRalph
Copy link

It's a regression. Shortcuts starting with '#' were working in all versions of VS2019 preceding 16.10.

@jinujoseph jinujoseph added Bug Developer Community The issue was originally reported on https://developercommunity.visualstudio.com and removed untriaged Issues and PRs which have not yet been triaged by a lead labels Jun 16, 2021
@jinujoseph jinujoseph added this to the 17.0 milestone Jun 16, 2021
@sharwell
Copy link
Member

📝 This behavior only occurs when Argument Completion is enabled. The error is caused by this code failing to handle the case where token.Kind == None:

var token = await semanticModel.SyntaxTree.GetTouchingWordAsync(caretPosition.Position, document.GetRequiredLanguageService<ISyntaxFactsService>(), cancellationToken).ConfigureAwait(false);
var semanticInfo = semanticModel.GetSemanticInfo(token, document.Project.Solution.Workspace, cancellationToken);

@sharwell sharwell added the 4 - In Review A fix for the issue is submitted for review. label Jun 17, 2021
sharwell added a commit to sharwell/roslyn that referenced this issue Jun 17, 2021
@sharwell sharwell added Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented and removed 4 - In Review A fix for the issue is submitted for review. labels Jun 18, 2021
@jinujoseph jinujoseph modified the milestones: 17.0, 17.0.P2 Jun 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE Bug Developer Community The issue was originally reported on https://developercommunity.visualstudio.com Regression Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants