Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue diagnostic for a templated model with a template parameter that is not used. #5494

Open
wants to merge 20 commits into
base: main
Choose a base branch
from

Conversation

chunyu3
Copy link
Contributor

@chunyu3 chunyu3 commented Jan 6, 2025

Fix #181
Fix #5488

  • check all the usage of the template parameter, if a template parameter is not used, issue diagnostic and dim the template parameter.
  • implement codeFix for unused-template-parameter diagnostic: remove the unused template parameter.

@microsoft-github-policy-service microsoft-github-policy-service bot added the compiler:core Issues for @typespec/compiler label Jan 6, 2025
@azure-sdk
Copy link
Collaborator

azure-sdk commented Jan 6, 2025

All changed packages have been documented.

  • @typespec/compiler
Show changes

@typespec/compiler - feature ✏️

Support diagnostics for unused template parameter in model template

@typespec/protobuf - internal ✏️

Suppress unused-template-parameter diagnostic for Map model

@chunyu3 chunyu3 added ide Issues for VS, VSCode, Monaco, etc. and removed compiler:core Issues for @typespec/compiler labels Jan 6, 2025
@azure-sdk
Copy link
Collaborator

azure-sdk commented Jan 6, 2025

You can try these changes here

🛝 Playground 🌐 Website 📚 Next docs 🛝 VSCode Extension

@markcowl markcowl self-assigned this Jan 9, 2025
Copy link
Contributor

@markcowl markcowl left a comment

Choose a reason for hiding this comment

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

Not sure that we want to do this

packages/compiler/src/core/messages.ts Outdated Show resolved Hide resolved
packages/protobuf/lib/proto.tsp Outdated Show resolved Hide resolved
@chunyu3 chunyu3 requested a review from markcowl January 16, 2025 05:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ide Issues for VS, VSCode, Monaco, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unused template parameter in model template Unused template parameter silently ignored
3 participants