Skip to content

Conversation

noonowl
Copy link

@noonowl noonowl commented Mar 26, 2025

Description

This PR improves the GitHub API rate limit handling in the Kotlin Language Server extension by adding proper Personal Access Token (PAT) support.

Changes

  • Fix GitHub API authentication header format to use Authorization: Bearer <token>
  • Add conditional token header addition
  • Add helpful warning message when rate limit is exceeded without a token

Why

GitHub's API has rate limits for unauthenticated requests. When users hit these limits, they get 403 errors. By supporting Personal Access Tokens (PATs), users can increase their rate limits and avoid these errors.

How to use

  1. Create a GitHub Personal Access Token with repo scope
  2. Set the token as an environment variable:
    # macOS/Linux
    export GITHUB_TOKEN=your_token_here
    
    # Windows (PowerShell)
    $env:GITHUB_TOKEN="your_token_here"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extension Related to the VSCode extension
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants