Skip to content

Dont format while typing inside Nonuser code - #454

Closed
basoundr wants to merge 0 commit into
dotnet:masterfrom
basoundr:fix1077103
Closed

Dont format while typing inside Nonuser code#454
basoundr wants to merge 0 commit into
dotnet:masterfrom
basoundr:fix1077103

Conversation

@basoundr

Copy link
Copy Markdown
Contributor

Fix #449 : Don't format inside Comments

Dont format while typing '{', ')',inside comments(Both Regular and Doc Comments)

@basoundr basoundr changed the title Fix1077103 Fix 449 Completing a paren inside a comment causes code to be auto-formatted Feb 12, 2015

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this a typing error?
Istyped -> IsTyped

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, it is a typing error. Will fix it. Thanks.

@heejaechang

Copy link
Copy Markdown
Contributor

so I searched code base and found the one we are using.

http://source.roslyn.io/#Microsoft.CodeAnalysis.Workspaces/LanguageServices/SyntaxFactsService/ISyntaxFactsService.cs,93f9c53bcee23054

we have bunch of code that checks context. can you use this rather than creating your own check? I thought auto formatter already used this before. not sure when that went away?

@balajikris

Copy link
Copy Markdown
Contributor

@basoundr do we check for if def'd out regions which is also considered as commented out code.. If so, we may need to add tests for those as well.

@heejaechang

Copy link
Copy Markdown
Contributor

@basoundr @balajikris the link I linked above should handle those cases as well.

@basoundr

Copy link
Copy Markdown
Contributor Author

@balajikris @heejaechang I was looking into the API that you mentioned. It seems that it satisfies the cases I had tested. I will just need to verify if it doesn't cover cases that we don't want to. Once I get it verified, I will update the PR. Thanks for letting me know about the PR.

@basoundr basoundr changed the title Fix 449 Completing a paren inside a comment causes code to be auto-formatted Dont format while typing inside Nonuser code Feb 17, 2015
@basoundr basoundr closed this Feb 17, 2015
@basoundr

Copy link
Copy Markdown
Contributor Author

I have some mistakes with my commits. Will rectify those and reopen the PR

@dpoeschl

Copy link
Copy Markdown
Contributor

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.

Completing a paren inside a comment causes code to be auto-formatted

7 participants