-
Notifications
You must be signed in to change notification settings - Fork 767
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
RangeError: Maximum call stack size exceeded #1464
Comments
Thanks for the bug report. I'm able to repro the issue as described. I'll investigate further. |
@jakebaily, the call to My thought is to cap string literals to a predefined length — say, 16K characters. We'd still tokenize them, but internally the "value" of the token would include only the first 16K characters. It's unlikely that such a long string will be used for an f-string, a literal, etc. Any other thoughts or suggestions? |
I think it might not be too uncommon to have a long multi-line string; I've seem some pretty big ones in docstrings and such. With say 100 characters per line, you could probably get up to that limit pretty quickly. Is there something about that string that is making it special, or is it purely the length? Maybe we just need to chunk the string when rebuilding it if it's too long, working around this This code was picked directly from performance optimizations made in the TS compiler, so I'm a little surprised they haven't hit it themselves. |
Thanks for the bug report. This will be addressed in the next release. I've added an internal limit of 32K characters for string literals. I don't think it's worth bending over backward to try to retain the full string beyond that because it's unlikely to be a meaningful f-string, string literal type, or docstring beyond that length. |
Thanks for the quick response. I found after removing ~10% of the entries in the With this new limit, will the Pulumi package need to change how it's registering these modules to work with Pylance? |
No, there shouldn't be any need for a change. Pylance uses static analysis, so doesn't know about any form of dynamic module registration anyway. |
This issue has been fixed in version 2021.6.3, which we've just released. You can find the changelog here: https://github.com/microsoft/pylance-release/blob/main/CHANGELOG.md#202163-23-june-2021 |
Environment data
Expected behaviour
Autocomplete and Intellisense working as expected for the
pulumi_aws
library.Actual behaviour
Autocomplete does not work and docstrings aren't shown in Intellisense.
Python Language Server output has the error:
An internal error occurred while parsing file "/Users/jon.king/projects/pylp/venv/lib/python3.9/site-packages/pulumi_aws/init.py": RangeError: Maximum call stack size exceeded
Logs
Python Language Server Log
Code Snippet / Additional information
I don't think the Pulumi CLI is necessary to recreate the problem. I was able to recreate the issue starting from a blank project:
requirements.txt:
__main__.py:
The text was updated successfully, but these errors were encountered: