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

Fix: Infinite loop in language server due to not caching indeterminate entities #5940

Merged

Conversation

timotheeguerin
Copy link
Member

@timotheeguerin timotheeguerin commented Feb 10, 2025

fix #5938
The problem is everytime we created an indeterminate entity we created a new object instead of caching it from the type. This meant everytime we needed to reinstantiate the template it would create 2 separate instances.
This caused an inifinite loop in the LSP as it would call getTypeForNode for diagnostics

This should also solve some duplicate type issue we might have encountered.

@azure-sdk
Copy link
Collaborator

azure-sdk commented Feb 10, 2025

All changed packages have been documented.

  • @typespec/compiler
Show changes

@typespec/compiler - fix ✏️

Fix: Infinite loop in language server due to not caching indeterminate entities in templates

@azure-sdk
Copy link
Collaborator

azure-sdk commented Feb 10, 2025

You can try these changes here

🛝 Playground 🌐 Website 📚 Next docs 🛝 VSCode Extension

@timotheeguerin timotheeguerin added this pull request to the merge queue Feb 11, 2025
Merged via the queue into microsoft:main with commit 16e7721 Feb 11, 2025
24 checks passed
@timotheeguerin timotheeguerin deleted the fix/infinite-loop-diagnostic branch February 11, 2025 00:58
dmnorc pushed a commit to dmnorc/typespec that referenced this pull request Feb 18, 2025
…e entities (microsoft#5940)

fix microsoft#2964
The problem is everytime we created an indeterminate entity we created a
new object instead of caching it from the type. This meant everytime we
needed to reinstantiate the template it would create 2 separate
instances.
This caused an inifinite loop in the LSP as it would call getTypeForNode
for diagnostics

This should also solve some duplicate type issue we might have
encountered.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler:core Issues for @typespec/compiler
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Language Server Crash when using invalid value in @extension in a template
3 participants