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

VSCode Sticky Scroll not working in outlineModel mode. #24

Open
ctataryn opened this issue Jan 24, 2025 · 0 comments
Open

VSCode Sticky Scroll not working in outlineModel mode. #24

ctataryn opened this issue Jan 24, 2025 · 0 comments

Comments

@ctataryn
Copy link

First off, thank you for creating this project, it's so nice to be able to ctrl-click through my .proto files now!

Issue: It seems that VSCode's "Sticky Scroll" (i.e. seeing the first line of the containing block as you scroll through a file), isn't working with the VSCode extension. Now, VSCode can be configured to use one of the three hints for getting the sticky scroll line number that it should pin to the top of the editor, they are:

  • outlineModel (default)
  • foldingProviderModel
  • indentationModel

Since this extension does provide outline hints (i.e. if I open a .proto file, you can see top-level messages all defined in the Outline panel on the left sidebar), sticky scroll should "just work". However it doesn't, and I'm not sure why.

I can flip to using foldingProviderModel or indentationModel as my default sticky scroll model, however the fellow who maintains our .proto files is a C/C++'er and prefers to place his braces on a separate line under the message preamble, like so:

message Cmpl
{
    VehicleKey                  vehicleKey = 1;
    uint32                      level = 2;
    uint32                      classLevel = 3; 

This results in sticky scroll looking like this, which kind of defeats its purpose:

Image

Instead it'd be desirable if it were to look like this, which should be achievable via the outlineModel, but it's not working:

Image

Reproduce

  1. Open a .proto file
  2. Ensure you can see an "Outline" section fully filled out in the left hand sidebar of VSCode
  3. Ensure "Sticky Scroll" is enabled under Settings -> Text Editor
  4. Ensure "Sticky Scroll: Default Model" is set to outlineModel.
  5. Start scrolling through the document and notice that the sticky scroll section at the top of the file doesn't appear.
  6. Go back into settings and change the Default Model to be either foldingProviderModel or indentationModel.
  7. Start scrolling through the document and notice that the sticky scroll section at the top of the editor now DOES appear, but it will only show the line containing an opening brace, if your opening brace is not on the same line as your message or enum declaration, you won't know what the brace represents.
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