-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Spurious asterisk is inserted on new line if the previous one starts from the space(s) followed by asterisk #5733
Comments
The code that implements this is at https://github.com/microsoft/vscode-cpptools/blob/release/Extension/src/LanguageServer/languageConfig.ts#L229 if anyone wants to debug/fix it. I debugged it, but I didn't see what was wrong with the generated regex's (and I don't have currently have time to continue investigating). |
When I implemented this, I emulated what VS Code was doing for TypeScript. I seem to recall this being a problem for TypeScript too, but since I tried it again, it looks like they have a way to disable it for the case you've shared. I believe this is the set of rules for TypeScript: https://github.com/microsoft/vscode/blob/e5ceb315da2462b0fea70716e79cc82ce708b438/extensions/typescript-language-features/src/features/languageConfiguration.ts#L21 EDIT: I think this is the commit that changed the behavior: microsoft/vscode@81f5833#diff-5fa357ec086244b9f81089781bd6e25b. There appears to be a new property that can be used to ensure the |
Also mentioned in #2072 |
I can confirm that adding to settings |
This bug is has a bug. At new line in a comment section, the asterisk is not automatically inserted anymore. |
@UR3IQO Fixed with https://github.com/microsoft/vscode-cpptools/releases/tag/1.3.0-insiders2 , except for the issue mentioned by @clement-analogue @elahehrashedi I can repro the issue with
2nd newline doesn't continue the "*". |
@clement-analogue @elahehrashedi The change at #7238 fixes the issue (unless we find some problem with it later). UPDATE: My fix wasn't sufficient in the repro:
|
Although the original repro with one "*" is fixed, this case
with 2 consecutive |
Fix is released in the 1.3.0 release version https://github.com/microsoft/vscode-cpptools/releases/tag/1.3.0 |
Type: LanguageService
Describe the bug
When editing C code expression spurious asterisk is inserted on the new line if the previous line starts from the space(s) followed by asterisk
Steps to reproduce
Create new .c file. Enter the following code:
Put cursor before the
+
and hit enter. If there is one or more space(s) before the aterisk, spurious asterisk will be inserted on the new line. See the record:The very bad thing is that the code with the asterisk added may compile without any warnings or errors, but you will get wrong result (for example multiplication instead of addition or subtraction).
The problem roots are probably from the automatic asterisk insertion function when editing comments in the following form:
If so, that function should be activated only if the comment is edited.
The text was updated successfully, but these errors were encountered: