Skip to content

Conversation

matthewbastien
Copy link
Member

@matthewbastien matthewbastien commented Jul 31, 2025

Removed SwiftLanguageService.withSnapshotFromDiskOpenedInSourcekitd() in favor of a new OnDiskDocumentManager actor that will cache all snapshots opened for the duration of a textDocument/doccDocumentation request. This will prevent the syntax tree from being parsed multiple times for the same document in a single request.

Follow up to #2216

@matthewbastien
Copy link
Member Author

@swift-ci please test

1 similar comment
@matthewbastien
Copy link
Member Author

@swift-ci please test

@matthewbastien
Copy link
Member Author

@swift-ci please test windows

@matthewbastien
Copy link
Member Author

@swift-ci please test

@matthewbastien
Copy link
Member Author

@swift-ci please test Windows

Copy link
Member

@ahoppen ahoppen left a comment

Choose a reason for hiding this comment

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

A couple comments but otherwise looks good to me.

@matthewbastien
Copy link
Member Author

@swift-ci please test

@matthewbastien
Copy link
Member Author

@swift-ci please test Windows

@matthewbastien
Copy link
Member Author

matthewbastien commented Aug 14, 2025

Rebasing on top of main meant that I needed to rearrange a few things:

  • Moved withOnDiskDocumentManager(_:) and OnDiskDocumentManager to SourceKitLSPServer
  • Added openDocumentOnDisk(snapshot:originalFile:) and closeDocumentOnDisk(snapshot:) to LanguageService so that SwiftLanguageService can manage opening and closing the dummy snapshots in sourcekitd.
  • Renamed symbolGraph(forOnDiskContentsOf:at:) to symbolGraphForDocumentOnDisk(at:manager:) which accepts an OnDiskDocumentManager that it will use to retrieve snapshots.

@matthewbastien
Copy link
Member Author

@swift-ci please test

@matthewbastien
Copy link
Member Author

@swift-ci please test Windows

@ahoppen ahoppen force-pushed the docc-cache-snapshots branch from 9aca958 to 58096eb Compare August 27, 2025 13:34
@ahoppen
Copy link
Member

ahoppen commented Aug 27, 2025

@swift-ci Please test

@ahoppen
Copy link
Member

ahoppen commented Aug 27, 2025

@swift-ci Please test Windows

@ahoppen ahoppen merged commit 47ca76b into swiftlang:main Aug 27, 2025
3 checks passed
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.

2 participants