Skip to content

Conversation

@jpoehnelt
Copy link
Member

@jpoehnelt jpoehnelt commented Jun 25, 2025

closes #9

@jpoehnelt jpoehnelt changed the title feat/suggestions scopes feat: suggest scopes Jun 25, 2025
@jpoehnelt jpoehnelt requested a review from Copilot June 25, 2025 20:45
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances the scope markdown generator by registering two new document scopes as sensitive and suggesting alternative non-sensitive scopes that share the same prefix.

  • Adds https://www.googleapis.com/auth/documents and .../documents.readonly to SENSITIVE_SCOPES.
  • Implements suggestion logic in getScopeMarkdown to list non-sensitive scopes with the full shared prefix.
  • Introduces a helper getSharedPrefix function.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/scopes.ts Added document scopes, suggestion collection & sorting, plus getSharedPrefix utility
.changeset/eager-colts-peel.md Created changeset entry for the new feature
Comments suppressed due to low confidence (3)

src/scopes.ts:225

  • [nitpick] This destructured id shadows the outer function parameter id, which can be confusing. Consider renaming the loop variable to something like altId for clarity.
			for (const { id } of suggestions) {

src/scopes.ts:198

  • The new suggestion-generation logic is not covered by existing tests. Consider adding unit tests to verify suggestion filtering, sorting, and edge cases.
		const suggestions: { id: string; sharedPrefix: string }[] = [];

src/scopes.ts:246

  • [nitpick] There’s no documentation for getSharedPrefix. Adding a JSDoc comment explaining its purpose, parameters, and return value would improve readability.
function getSharedPrefix(a: string, b: string): string {

Co-authored-by: Copilot <[email protected]>
@jpoehnelt jpoehnelt merged commit 844bae6 into main Jun 25, 2025
5 of 6 checks passed
@jpoehnelt jpoehnelt deleted the feat/suggestions-scopes branch June 25, 2025 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Suggest alternative scopes in diagnostic for sensitive or restricted scopes

1 participant