Open debonte opened 1 month ago
Thanks. If you need more details then please let me know
Can you include a log as described here?
https://github.com/microsoft/pylance-release/blob/main/TROUBLESHOOTING.md#filing-an-issue
My suspicion is that we're running out of memory. There are some things we outline here that you can do to alleviate that problem:
another data that could be helpful is providing this info (https://github.com/microsoft/pylance-release/wiki/Collecting-data-for-an-investigation.#collecting-cpuprofiles)
basically do
and provide the profile data to us.
I suspect out of memory too, the device only has 1GB RAM of which the container only really gets about 400-500MB. For reference this is running on a Dual ARM Cortex-A9 MPCore (600MHz).
I shall attempt some profiling but will need to ensure no sensitive info is in the logs, so please bear with me. It might also be tricky to get a representative profile of the full issue since that would cause a full crash. Will do my best!
@luabud we might want to add low resource mode
where we turn off most of features except only core ones.
basically, only enables these features and turn off everything else.
turn off
basically, we provide only cheap features that help typing but nothing else. it will be a little bit better than plain text.
// No user files
"python.analysis.exclude": ["**"],
// Expensvie to turn on
"python.analysis.indexing": false,
"python.analysis.fixAll": [],
"python.analysis.diagnosticMode": "openFilesOnly",
"python.analysis.enablePytestSupport": false,
"python.analysis.inlayHints.callArgumentNames": "off",
"python.analysis.inlayHints.functionReturnTypes": false,
"python.analysis.inlayHints.pytestParameters": false,
"python.analysis.inlayHints.variableTypes": false,
"python.analysis.supportRestructuredText": false,
"python.analysis.typeCheckingMode": "off",
"python.analysis.useLibraryCodeForTypes": false,
// vscode settings that affect pylance feature but
// expensive to turn on
"editor.semanticHighlighting.enabled": false,
"editor.occurrencesHighlight": "off",
// okay to turn on if they want to
"python.analysis.completeFunctionParens": false,
"python.analysis.autoFormatStrings": false,
"python.analysis.autoImportCompletions": false,
"python.analysis.gotoDefinitionInStringLiteral": false,
here are settings user would want to make pylance
behave like lightweight mode
with existing pylance
bits.
with this settings, editor related features such as completion
, hover
, signature help
, syntax highlighting
, go to definition
and etc will continue to work but any advanced feature such as workspace symbol search
, pytest hover/completion
, inlay hint
, auto imports
, rename
, semantic coloring
and etc won't work.
Users can enable specific settings to activate features they want, however, because many features share the same underlying engines, enabling one feature might result in resource consumption similar to that of enabling multiple features.
From Marketplace review: