Open BigBahss opened 3 years ago
I noticed this can happen in other extensions, specifically gruntfuggly.todo-tree
, so this must be a bug in vscode.
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.
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. TheRange
passed toTextEditor.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 forms-vscode.cpptools
,clangd
, andccls
, 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.