Skip to content

Add code symbols into outline#972

Open
vezwork wants to merge 2 commits into
mainfrom
feat/code-cell-symbols
Open

Add code symbols into outline#972
vezwork wants to merge 2 commits into
mainfrom
feat/code-cell-symbols

Conversation

@vezwork
Copy link
Copy Markdown
Member

@vezwork vezwork commented May 6, 2026

Addresses an issue mentioned by @juliasilge: #167 (comment)

Screenshot 2026-05-06 at 4 04 39 PM

Adds code symbols under code cells in the outline.

@vezwork vezwork requested a review from juliasilge May 6, 2026 20:06
@posit-snyk-bot
Copy link
Copy Markdown
Contributor

posit-snyk-bot commented May 6, 2026

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@vezwork
Copy link
Copy Markdown
Member Author

vezwork commented May 6, 2026

I attempted to add tests until I remembered that our test setup does not have actual LSPs for Python or R in it, so we can't really test this. Well... now that I write that, I realize I could probably mock one out. That seems a little contrived, but maybe still worth it.

@juliasilge
Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Collaborator

@juliasilge juliasilge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I seem to be getting two of everything, at least in Positron:

Image

@vezwork
Copy link
Copy Markdown
Member Author

vezwork commented May 19, 2026

I was able to reproduce duplicated language symbols in code cells in Positron with inline outputs enabled. Looking into what is happening.

@vezwork
Copy link
Copy Markdown
Member Author

vezwork commented May 19, 2026

@juliasilge In qmds in Positron with Positron › Quarto › Inline Output: Enabled enabled, the following command (from getCodeCellSymbols in this PR) is returning duplicated symbols:

await commands.executeCommand<DocumentSymbol[] | SymbolInformation[]>(
  "vscode.executeDocumentSymbolProvider",
  uri
);

I checked the surrounding context, including the vdoc content. Everything seems to be in order, nothing strange otherwise. When I disabled Positron › Quarto › Inline Output: Enabled and re-open the document, I no longer experience the duplicated symbols issue. It appears to me that the "vscode.executeDocumentSymbolProvider" command does not function as expected when inline outputs are enabled.

@vezwork
Copy link
Copy Markdown
Member Author

vezwork commented May 19, 2026

@seeM mocked out fake LSPs in #980. Maybe I can copy that approach for tests in this PR.

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

Successfully merging this pull request may close these issues.

3 participants