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

"IntelliSense engine" has affected the navigation bar's analysis of the code segments, only allowing the display of the outermost code segments. #12483

Closed
YingchangLiu opened this issue Jul 17, 2024 · 1 comment · Fixed by #12486
Assignees
Labels
enhancement Improvement to an existing feature Feature: Document Symbol Outline view and breadcrumbs fixed Check the Milestone for the release in which the fix is or will be available. Language Service quick fix
Milestone

Comments

@YingchangLiu
Copy link

Environment

  • OS and Version: Debian 12
  • VS Code Version: 1.19.1
  • C/C++ Extension Version: 1.20.5
  • If using SSH remote, specify OS of remote machine:

Bug Summary and Steps to Reproduce

Bug Summary:

After installing the C/C++ extension with IntelliSense Engine enabled by default, when you open a segment of code, you may notice that the navigation bar at the top of VSCode can only display the outermost layer of the code. For example:

1	void **alloc2 (int n1, int n2, int size)
2	{
3		int i2;
4		void **p;
5	
6		if ((p=(void**)malloc(n2*sizeof(void*)))==NULL)
7			return NULL;
8		if ((p[0]=(void*)malloc(n2*n1*size))==NULL) {
9			free(p);
10			return NULL;
11		}
12		for (i2=0; i2<n2; i2++)
13			p[i2] = (char*)p[0]+size*n1*i2;
14		return p;
15	}
  1. When I scroll the code line 10 return NULL; to the top, the navigation bar should display the position of the brackets for the line of code at the top. Under normal behavior (with IntelliSense Engine disabled), it is displayed as:
2	{
8		if ((p[0]=(void*)malloc(n2*n1*size))==NULL) {
-------------------------------------------------------------
10			return NULL;
  1. But if I enable the IntelliSense Engine, it shows:
1	void **alloc2 (int n1, int n2, int size)
-------------------------------------------------------------
10			return NULL;

Expected behavior:

This feature works well with short code, but if there is a longer main program, the code navigation will only display int main(int argc, char **argv). It would be great if this feature could be selectable.

Configuration and Logs

No need.

Other Extensions

No response

Additional context

No response

@sean-mcmanus sean-mcmanus self-assigned this Jul 17, 2024
@sean-mcmanus
Copy link
Contributor

@YingchangLiu A workaround is to use setting

"editor.stickyScroll.defaultModel": "foldingProviderModel"

or a subset of

        "[cpp]": {
            "editor.stickyScroll.defaultModel": "foldingProviderModel"
        },
        "[cuda-cpp]": {
            "editor.stickyScroll.defaultModel": "foldingProviderModel"
        },
        "[c]": {
            "editor.stickyScroll.defaultModel": "foldingProviderModel"
        }

if you don't want that to affect other languages.

@sean-mcmanus sean-mcmanus added Language Service quick fix Feature: Document Symbol Outline view and breadcrumbs enhancement Improvement to an existing feature labels Jul 17, 2024
@sean-mcmanus sean-mcmanus added this to the 1.22.0 milestone Jul 17, 2024
@bobbrow bobbrow moved this to Todo in cpptools Jul 17, 2024
@bobbrow bobbrow moved this from Todo to Pull Request in cpptools Jul 17, 2024
@github-project-automation github-project-automation bot moved this from Pull Request to Done in cpptools Jul 19, 2024
@sean-mcmanus sean-mcmanus added the fixed Check the Milestone for the release in which the fix is or will be available. label Aug 15, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Sep 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Improvement to an existing feature Feature: Document Symbol Outline view and breadcrumbs fixed Check the Milestone for the release in which the fix is or will be available. Language Service quick fix
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants