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

Sticky scroll gets out of sync when editing Clojure file #157630

Closed
PEZ opened this issue Aug 9, 2022 · 4 comments
Closed

Sticky scroll gets out of sync when editing Clojure file #157630

PEZ opened this issue Aug 9, 2022 · 4 comments
Assignees
Labels
*caused-by-extension Issue identified to be caused by an extension editor-sticky-scroll

Comments

@PEZ
Copy link
Contributor

PEZ commented Aug 9, 2022

Type: Bug

When editing a (Clojure in my case) file, sticky scrolling first works, then when I have edited the file, adding lines, it stops working properly. Even after undoing the edits, the stickiness misbehaves, but in different ways. Making another document active, then activating the first one, sticky scrolling starts working again.

sticky-scroll-issue-157630.mp4
  1. Open a file with some structured code in it
  2. Confirm that sticky scrolling behaves correctly
  3. Add an empty lines to a class/function

Expected: Sticky scrolling should keep behaving

Actual: Sticky scrolling starts misbehaving

Also:

  1. Undo the change to the file

Expected: Sticky scrolling should start behaving

Actual: Sticky scrolling misbehaves in new interesing ways

Restore sticky scrolling:

  1. Activate another document in the same editor group
  2. Activate the original document again

Expected: Sticky scrolling should start behaving

Actual: Sticky scrolling starts behaving

VS Code version: Code - Insiders 1.71.0-insider (fe94606, 2022-08-09T09:40:38.691Z)
OS version: Darwin arm64 21.4.0
Modes:
Sandboxed: Yes

System Info
Item Value
CPUs Apple M1 Max (10 x 24)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
Load (avg) 9, 7, 6
Memory (System) 32.00GB (0.09GB free)
Process Argv --crash-reporter-id bb70326f-fa59-483f-b56d-effcec0a22c0
Screen Reader yes
VM 0%
Extensions (27)
Extension Author (truncated) Version
chronicler arc 0.1.16
calva bet 2.0.291
joyride bet 0.0.15
emojisense bie 0.9.1
better-toml bun 0.3.2
gitlens eam 12.1.2
vscode-pull-request-github Git 0.48.0
vscode-mocha-test-adapter hbe 2.14.1
vscode-test-explorer hbe 2.21.1
chat kar 0.35.0
restructuredtext lex 189.1.0
vscode-scss mrm 0.10.0
vscode-docker ms- 1.22.1
test-adapter-converter ms- 0.1.6
vsliveshare ms- 1.0.5683
vsliveshare-audio ms- 0.1.91
vsliveshare-pack ms- 0.4.0
debugger-for-chrome msj 4.13.0
vscode-react-native msj 1.9.2
ruby reb 0.28.1
vscode-yaml red 1.9.1
code-settings-sync Sha 3.4.3
vscode-scss-formatter sib 2.4.3
code-spell-checker str 2.5.4
shellcheck tim 0.19.6
org-mode too 0.5.0
vscode-ruby win 0.28.0

(1 theme extensions excluded)

A/B Experiments
vsliv695:30137379
vsins829:30139715
vsliv368:30146709
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
vswsl492:30256197
vslsvsres303:30308271
pythonvspyl392:30422396
pythontb:30258533
pythonptprofiler:30281269
vshan820:30294714
pythondataviewer:30285072
vscod805cf:30301675
bridge0708:30335490
bridge0723:30353136
cmake_vspar411:30542924
vsaa593cf:30376535
pythonvs932:30404738
wslgetstarted:30449409
vscscmwlcmt:30465136
cppdebug:30492333
pylanb8912:30522163
vsclangdf:30492506
c4g48928:30535728
dsvsc012:30540252

@alexdima
Copy link
Member

Currently, sticky lines are computed based on a DocumentSymbolProvider, which in this case is registered by the calva extension. #157165 tracks using a different source for computing the sticky lines.

@alexdima alexdima changed the title Sticky scroll gets out of sync when editing the file Sticky scroll gets out of sync when editing Clojure file Aug 10, 2022
@PEZ
Copy link
Contributor Author

PEZ commented Aug 10, 2022

Thanks! I'll check the tracking ticket to see where it is going.

For the record: Calva doesn't provide symbols directly. It uses clojure-lsp for this. And indeed, if I disable the clojure-lsp integration in Calva, I get no stickiness at all.

@aiday-mar
Copy link
Contributor

aiday-mar commented Aug 11, 2022

Hi thank you for your comment, I attach here a gif showing the outline model calculated using the clojure-lsp. I notice several problems in our internal outline model which is computed with the clojure-lsp :

  • The range of the outermost scope is calculated as (1, 1'000'000) which is not the correct range
  • After adding a space, the new outline model should be updated with the new ranges of the children. I.e: for child number 0 we should go from (16, 19) to (17, 20)

sticky-scroll-type-clojure

@aiday-mar aiday-mar reopened this Aug 11, 2022
@alexdima alexdima added the *caused-by-extension Issue identified to be caused by an extension label Aug 11, 2022
@PEZ
Copy link
Contributor Author

PEZ commented Aug 11, 2022

Thanks, @aiday-mar. The clojure-lsp team have made an update of the updating (not the sub childs yet, though) that I have yet to put to a test:

Very handy with your GIF and notes!

@github-actions github-actions bot locked and limited conversation to collaborators Sep 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*caused-by-extension Issue identified to be caused by an extension editor-sticky-scroll
Projects
None yet
Development

No branches or pull requests

3 participants