Conversation
|
Hi @NarxPal! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
|
test failures are resolved and from..import autocomplete implementation now works as expected , pr is ready to merge! cc @stroxler |


Summary
earlier exported symbols were appearing only when we had importedName for the module.
for eg.
from math import sqhere ,
sqis theimportedNamesince it has chars for importedName the completion suggestion will show symbols for it, but in case when
from math importthere is no importedName the completion suggestion won't work since
from_stmt_import_from_namefn inpyrefly/lib/state/lsp.rsrequire importedName.so I added
importedNameEmptyto match the condition forfrom math import |and trigger completion when there's no name. after that i made sure thatThisModuleentries appear first, so i marked themLocalin completion source. and didReexportforOtherModuleentries.up until now i was able to trigger completion and symbols are appearing as expected but pyrefly/test are failing due to difference in ordering in the suggestions, so i would like to discuss should we change the ordering inside tests or is there other way out?
one test error eg.
Fixes #2999
Test Plan
from math import |and triggered completion.mathexports are shown (for examplesqrt,sin,cos) and unrelated helper suggestions are shown at bottom.from math import s|still returns expected symbol completions.