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

Notebook outline view: Symbols are often incomplete #208665

Open
aeschli opened this issue Mar 25, 2024 · 4 comments
Open

Notebook outline view: Symbols are often incomplete #208665

aeschli opened this issue Mar 25, 2024 · 4 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug debt Code quality issues notebook-toc-outline

Comments

@aeschli
Copy link
Contributor

aeschli commented Mar 25, 2024

Testing #208546

Version: 1.88.0-insider
Commit: b0d975f
Date: 2024-03-25T05:51:49.226Z
Electron: 28.2.6
ElectronBuildId: 27476517
Chromium: 120.0.6099.291
Node.js: 18.18.2
V8: 12.0.267.19-electron.0
OS: Linux x64 5.14.0-1048-oem

  • Create a notebook with a JavaScript code block below.
  • In the outline enable Code Cell Symbols
  • you can see temp1232, temp33, add and sub
  • change the name of a temp. Outline does not update
  • close the notebook and reopen it. Now it shows
  • change the type of the cell from JavaScript to Python. Also no change.
// fn cell
const temp1232 = "hello world"
const temp33 = "hello world"

console.log(temp);

function add(a, b) {
    return a + b;
}

console.log(add(1, 2));1

function sub(a, b) {
    return a - b;
}
@Tyriar
Copy link
Member

Tyriar commented Mar 25, 2024

I also saw this:

image

@Tyriar
Copy link
Member

Tyriar commented Mar 25, 2024

It eventually updated 🤷

@Yoyokrazy
Copy link
Contributor

I believe this is a consequence of symbol fetching being an asynchronous operation. The goal was to avoid symbol fetching blocking the outline view updating, but currently there are some issues with the outline view not updating as symbols are finished being gathered. There will be a bit more work here, likely involving a different event flow to the outline recompute.

@Yoyokrazy Yoyokrazy added bug Issue identified by VS Code Team member as probable bug notebook-toc-outline labels Apr 2, 2024
@Yoyokrazy
Copy link
Contributor

Update after debt investigations:

  • this is due to the outlineEntryFactory having its own cache for symbols, and when we check for updates to the outline, the new symbols are not present in the outlineView model cache and therefore not being included in the recomputed NotebookCellOutline. Once the there is a single provider, single outlineModel, and then a single outlineViewModel, they will share the same cache and therefore will be recomputed and shown to the user in real time.
  • Solution to this will be included in the refactor work in Refactor: share outline between nb sticky scroll and outline #200873, so going to avoid patching just this case in particular rn. The bigger refactor is in progress, but will finalize during the next complete debt week (beginning of May)

@Yoyokrazy Yoyokrazy added the debt Code quality issues label Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug debt Code quality issues notebook-toc-outline
Projects
None yet
Development

No branches or pull requests

3 participants