-
Notifications
You must be signed in to change notification settings - Fork 33.5k
Fix auto closing comments not work properly in certain situations #226074
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
base: main
Are you sure you want to change the base?
Conversation
@rebornix Could you take some time to look at this PR? Thanks! |
@rebornix Sorry for the ping here, would you mind taking some time to look at this PR or could we add this to the September milestone? Thanks! |
Hi @BABA983 thank you for making this PR and I am really sorry for the wait time. I will have a look right now at the 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.
Hi I looked at the PR. I think the solution you propose is a bit finicky and could lead to unexpected issues. I think instead what we could do is simply not to go through the block comment logic when the cursor is inside a comment. This alternative solution has also been mentioned by one of my teammates on the issue this PR is closing. To verify the token type at a specific position you can use the following code:
model.tokenization.forceTokenization();
model.tokenization.getLineTokens(lineNumber).getStandardTokenType(tokenIndex)
The standard token type can be one of these values:
export const enum StandardTokenType {
Other = 0,
Comment = 1,
String = 2,
RegEx = 3
}
Close #156031