microsoft / microsoft/vscode-cpptools

Stale squiggles after a signature-help attempt

Open
#11,761 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Language Service
Dominant language
TypeScript
Stars
6.2k
Forks
1.7k
Avg merge
14h 46m
Merged PRs (30d)
61

Description

The high-level symptom is stale squiggles. The underlying cause appears to be related to invocation of an IntelliSense operation (i.e. signature-help) following by some text being typed before the next (non-preparse) IntelliSense update pass.

Example:

Starting with the following code:

class test
{
    int a;
};

(Timing is important in the next steps)
Type a ( after the a, pausing briefly to allow signature-help a chance to execute before the next character is typed.

class test
{
    int a(;
};

Then, before the next IntelliSense update pass starts, paste in ) = 0. This should result in:

class test
{
    int a() = 0;
};

After a pause here for the IntelliSense pass to complete, 2 errors are reported where only 1 was expected.

If another character is typed (i.e. another space), the invalid error is removed. (Or, if no other action is taken to trigger a fresh IntelliSense pass, the invalid error will remain.)

This example avoids typing a }, ; or moving to a new line, explicitly to avoid conditions in which cpptools will trigger (stop suppressing) a 'preparse' pass, which will always reset squiggles.

The fact that the second error is detect when the second bit of text is pasted demonstrates that the IntelliSense parser is indeed processing the text that was pasted after the ( (and should have removed the prior error, internally surfaced by the signature-help operation).

We suspect this may also occur with other IntelliSense operations than signature help.

https://github.com/microsoft/vscode-cpptools/assets/49173979/79caf860-8fea-463d-8a05-2c38aea8bd29

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the signature-help sequence in the issue and compare the diagnostics after the pasted ) = 0 with those after an additional character triggers another IntelliSense pass. Investigate how signature-help, text changes, and the non-preparse IntelliSense update interact; done means the stale second squiggle is removed without requiring further typing.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.