Skip to content

Conversation

@johnsoncodehk
Copy link

Fixes vuejs/language-tools#4582

In getNewImportFixes, prioritize checking scriptKind over file extension for isJs. This ensures consistent JsdocTypeImport behavior for file types added via LS plugins.

Copilot AI review requested due to automatic review settings December 4, 2025 20:33
@github-project-automation github-project-automation bot moved this to Not started in PR Backlog Dec 4, 2025
@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Dec 4, 2025
@typescript-bot
Copy link
Collaborator

This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise.

@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Dec 4, 2025
@typescript-bot
Copy link
Collaborator

This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise.

Copy link

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 isJS check in the getNewImportFixes function to better support Language Service plugins (like Vue.js language tools) that add custom file types via LS plugins. The change prioritizes checking scriptKind over file extension to determine if a file should be treated as JavaScript, ensuring consistent JsdocTypeImport behavior.

Key changes:

  • Import ScriptKind enum for script kind checking
  • Remove the top-level isJs variable that only checked file extension
  • Move JS determination logic into the conditional block where it's needed, checking scriptKind first with hasJSFileExtension as fallback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

Status: Not started

Development

Successfully merging this pull request may close these issues.

Auto-import in JSDoc always uses ts behaviour

2 participants