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

strange indent hint line #177760

Closed
qwq0 opened this issue Mar 21, 2023 · 4 comments
Closed

strange indent hint line #177760

qwq0 opened this issue Mar 21, 2023 · 4 comments
Assignees
Labels
*as-designed Described behavior is as designed

Comments

@qwq0
Copy link

qwq0 commented Mar 21, 2023

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.76.2
  • OS Version: Windows10 22H2

This indent line is weird in c++: (The prompt line in the red box should not exist)
screenshot

int main()
{
    int n;
    read(n);
    for (int i = 0; i < n; i++)
    {
        scanf("%d %d", &node[i].x, &node[i].y);
    }

    std::sort(node, node + n, [](Node &a, Node &b) -> bool
              { return (a.x != b.y ? a.x < b.x : a.y < b.y); });



    return 0;
}

The same problem occurs in javascript:
screenshot

/**
 * @param {number} a 
 * @param {number} x 
 * @returns {number}
 */
function fastPower(a, x)
{
    if (a == 0)
        return 1;



    if (x & 1)
        return fastPower(a * a, x >> 1) * a;
    else
        return fastPower(a * a, x >> 1);
}

Steps to Reproduce:

  1. Copy this code into vscode editor
  2. Enable the indent prompt line
@rebornix rebornix assigned hediet and unassigned rebornix Mar 23, 2023
qwq0 added a commit to qwq0/vscode that referenced this issue Mar 24, 2023
qwq0 added a commit to qwq0/vscode that referenced this issue Mar 25, 2023
qwq0 added a commit to qwq0/vscode that referenced this issue Mar 25, 2023
@qwq0
Copy link
Author

qwq0 commented Mar 25, 2023

I tried to fix this by referring to brace pairs in the indent guide
#178301

@hediet hediet added the *as-designed Described behavior is as designed label Mar 27, 2023
@VSCodeTriageBot
Copy link
Collaborator

The described behavior is how it is expected to work. If you disagree, please explain what is expected and what is not in more detail. See also our issue reporting guidelines.

Happy Coding!

@VSCodeTriageBot VSCodeTriageBot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 27, 2023
@hediet
Copy link
Member

hediet commented Mar 27, 2023

I suggest you disable indentation based indent guides and enable bracket guides.

The feature works as designed in your screenshots.

@qwq0
Copy link
Author

qwq0 commented Mar 28, 2023

I suggest you disable indentation based indent guides and enable bracket guides.

The feature works as designed in your screenshots.

@hediet Thank you very much. I enabled the brace guide and disabled indentation guide.
But this creates new problem where the expected indented prompt line does not show up.
(I understand that might be the desired behavior given this option)
screenshot

@github-actions github-actions bot locked and limited conversation to collaborators May 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*as-designed Described behavior is as designed
Projects
None yet
Development

No branches or pull requests

4 participants