Replace wildcard SDK imports with explicit imports in docs and examples#28
Merged
Replace wildcard SDK imports with explicit imports in docs and examples#28
Conversation
1 task
…nd example files Co-authored-by: brunoborges <129743+brunoborges@users.noreply.github.com> Agent-Logs-Url: https://github.com/github/copilot-sdk-java/sessions/e64d87ca-6bc9-49cb-9074-2ad5864ff11f
Copilot
AI
changed the title
[WIP] Update imports to prefer explicit imports in error-handling.md
Replace wildcard SDK imports with explicit imports in docs and examples
Mar 25, 2026
brunoborges
approved these changes
Mar 25, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the documentation and runnable JBang example to replace wildcard com.github.copilot.sdk.*, events.*, and json.* imports with explicit class imports, making each snippet’s dependencies clearer and more copy/paste-friendly.
Changes:
- Replaced wildcard SDK imports with explicit imports across docs code blocks.
- Updated
jbang-example.javato use explicit SDK imports. - Kept examples functionally the same while clarifying referenced SDK types.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/site/markdown/index.md | Updates the quick example and JBang snippet to use explicit SDK imports. |
| src/site/markdown/hooks.md | Updates the complete hooks example to use explicit SDK imports. |
| src/site/markdown/getting-started.md | Updates multiple tutorial snippets to use explicit SDK imports. |
| src/site/markdown/documentation.md | Updates the basic usage snippet to use explicit SDK imports. |
| src/site/markdown/cookbook/pr-visualization.md | Updates the cookbook example imports to explicit SDK imports. |
| src/site/markdown/cookbook/persisting-sessions.md | Updates cookbook snippets to explicit SDK imports. |
| src/site/markdown/cookbook/multiple-sessions.md | Updates cookbook example imports to explicit SDK imports. |
| src/site/markdown/cookbook/managing-local-files.md | Updates cookbook example imports to explicit SDK imports. |
| src/site/markdown/cookbook/error-handling.md | Updates multiple error-handling snippets to explicit SDK imports. |
| jbang-example.java | Replaces wildcard SDK imports with explicit imports in the runnable example. |
| README.md | Replaces wildcard SDK imports with explicit imports in the quick start snippet. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Your branch is up to date with 'upstream/copilot/doc-update-explicit-imports'. modified: src/site/markdown/cookbook/pr-visualization.md modified: src/site/markdown/getting-started.md All 3 classes (`PRVisualization`, `ToolExample`, `WeatherAssistant`) compiled cleanly with `BUILD SUCCESS`. The explicit imports are correct. Signed-off-by: Ed Burns <edburns@microsoft.com>
edburns
approved these changes
Mar 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
All documentation code samples and
jbang-example.javaused wildcard imports (import com.github.copilot.sdk.*,events.*,json.*). Each block now imports only the specific classes it uses.Changes
README.md,jbang-example.java, and 9 markdown files undersrc/site/markdown/(including all 5 cookbook recipes,getting-started.md,index.md,documentation.md,hooks.md)Before:
After (example from
error-handling.md):Pull request checklist
mvn spotless:applyhas been run to format the codemvn clean verifypasses locallyDoes this introduce a breaking change?
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.