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

'Add Definition' sometimes doesn't reveal the function #2

Open
BigBahss opened this issue Feb 2, 2021 · 2 comments
Open

'Add Definition' sometimes doesn't reveal the function #2

BigBahss opened this issue Feb 2, 2021 · 2 comments

Comments

@BigBahss
Copy link
Owner

BigBahss commented Feb 2, 2021

The 'Add Definition' commands sometimes don't properly reveal the inserted function (The editor doesn't scroll all the way to where the function was inserted). This seems to only happen for large files with a lot of DocumentSymbols, and it is unclear why. I've spent a good amount of time trying to debug and fix this problem, and it doesn't seem to be a problem in the C-mantic code. The Range passed to TextEditor.revealRange() is always correct, but the editor doesn't always scroll to that range. The editor does scroll in the direction of the function, but only a little bit. I haven't found consistent setup to reproduce the problem, other than that it only happens for large files. Also, this happens for ms-vscode.cpptools, clangd, and ccls, so it doesn't seem to be a problem with the language server. I'm considering opening an issue with vscode. If I do I'll link it here.

@BigBahss BigBahss added the help wanted Extra attention is needed label Feb 2, 2021
@BigBahss BigBahss pinned this issue Feb 2, 2021
@BigBahss BigBahss changed the title Add Definition sometimes doesn't reveal the function 'Add Definition' sometimes doesn't reveal the function Feb 7, 2021
@BigBahss
Copy link
Owner Author

I noticed this can happen in other extensions, specifically gruntfuggly.todo-tree, so this must be a bug in vscode.

@BigBahss
Copy link
Owner Author

Release 0.4.0 has a workaround for this issue that sets a 500ms timeout and checks if the editor actually revealed the range, and if not it will try it again. If the first one didn't work, the second one usually does. I have noticed that the second one can still fail, but this improves the issue a lot. Leaving open for now.

@BigBahss BigBahss removed the help wanted Extra attention is needed label Apr 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant