Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Hang on source file search when opening $HOME #1569

Closed
brettcannon opened this issue Jul 19, 2021 · 10 comments
Closed

Hang on source file search when opening $HOME #1569

brettcannon opened this issue Jul 19, 2021 · 10 comments
Labels
enhancement New feature or request

Comments

@brettcannon
Copy link
Member

Discussed in microsoft/vscode-python#16700

Originally posted by abartlett004 July 15, 2021
Suddenly, the auto-complete and colored font features of Intellisense are no longer working for me, although it seems that pylint is still working because it has found problems in my script. I have tried closing and reopening VS code, uninstalling and reinstalling VS code, uninstalling and reinstalling the Python, Jupyter, and Pylance extensions, and changing my Python language server settings from default to Pylance to Jedi and back again with no success.

I am using VS code 1.58 and Python 3.7.9. Any ideas as to what could be causing this? I'm happy to provide any additional info.

@brettcannon brettcannon transferred this issue from microsoft/vscode-python Jul 19, 2021
@jakebailey
Copy link
Member

@abartlett004 We'd appreciate if you could fill out the info requested here: https://github.com/microsoft/pylance-release/blob/main/TROUBLESHOOTING.md#filing-an-issue

(Or, file a new issue and use the template.)

But, it's suspicious that no analysis works, even Jedi.

@jakebailey jakebailey added the waiting for user response Requires more information from user label Jul 19, 2021
@github-actions github-actions bot removed the triage label Jul 19, 2021
@abartlett004
Copy link

Here is the requested info. Please let me know if I am missing anything!

Pylance language server 2021.7.4
Python 3.7.9
conda version : 4.10.1
conda-build version : 3.20.2

Output whether Intellisense is working or not:
image

Contents of .yaml file for conda environment (apologies, Github won't let me attach the file itself):

name: base
channels:

  • defaults
    dependencies:
  • _anaconda_depends=2020.07=py37_0
  • _ipyw_jlab_nb_ext_conf=0.1.0=py37_0
  • _libgcc_mutex=0.1=main
  • alabaster=0.7.12=py37_0
  • anaconda=custom=py37_1
  • anaconda-client=1.7.2=py37_0
  • anaconda-navigator=1.9.12=py37_1
  • anaconda-project=0.8.4=py_0
  • argh=0.26.2=py37_0
  • argon2-cffi=20.1.0=py37h7b6447c_1
  • asn1crypto=1.4.0=py_0
  • astroid=2.4.2=py37_0
  • astropy=4.0.1.post1=py37h7b6447c_1
  • atomicwrites=1.4.0=py_0
  • attrs=20.2.0=py_0
  • autopep8=1.5.4=py_0
  • babel=2.8.0=py_0
  • backcall=0.2.0=py_0
  • backports=1.0=py_2
  • backports.functools_lru_cache=1.6.1=py_0
  • backports.shutil_get_terminal_size=1.0.0=py37_2
  • backports.tempfile=1.0=py_1
  • backports.weakref=1.0.post1=py_1
  • beautifulsoup4=4.9.1=py37_0
  • bitarray=1.5.3=py37h7b6447c_0
  • bkcharts=0.2=py37_0
  • blas=1.0=mkl
  • bleach=3.2.1=py_0
  • blosc=1.20.0=hd408876_0
  • bokeh=2.2.1=py37_0
  • boto=2.49.0=py37_0
  • bottleneck=1.3.2=py37heb32a55_1
  • brotlipy=0.7.0=py37h7b6447c_1000
  • bzip2=1.0.8=h7b6447c_0
  • ca-certificates=2021.5.25=h06a4308_1
  • cairo=1.14.12=h8948797_3
  • certifi=2021.5.30=py37h06a4308_0
  • cffi=1.14.3=py37he30daa8_0
  • chardet=3.0.4=py37_1003
  • click=7.1.2=py_0
  • cloudpickle=1.6.0=py_0
  • clyent=1.2.2=py37_1
  • colorama=0.4.3=py_0
  • conda=4.10.1=py37h06a4308_1
  • conda-build=3.20.2=py37_0
  • conda-env=2.6.0=1
  • conda-package-handling=1.6.1=py37h7b6447c_0
  • conda-verify=3.4.2=py_1
  • contextlib2=0.6.0.post1=py_0
  • cryptography=3.1=py37h1ba5d50_0
  • curl=7.71.1=hbc83047_1
  • cycler=0.10.0=py37_0
  • cython=0.29.21=py37he6710b0_0
  • cytoolz=0.10.1=py37h7b6447c_0
  • dask=2.27.0=py_0
  • dask-core=2.27.0=py_0
  • dbus=1.13.16=hb2f20db_0
  • decorator=4.4.2=py_0
  • defusedxml=0.6.0=py_0
  • diff-match-patch=20200713=py_0
  • distributed=2.27.0=py37_0
  • docutils=0.16=py37_1
  • entrypoints=0.3=py37_0
  • et_xmlfile=1.0.1=py_1001
  • expat=2.2.9=he6710b0_2
  • fastcache=1.1.0=py37h7b6447c_0
  • filelock=3.0.12=py_0
  • flake8=3.8.3=py_0
  • flask=1.1.2=py_0
  • fontconfig=2.13.0=h9420a91_0
  • freetype=2.10.2=h5ab3b9f_0
  • fribidi=1.0.10=h7b6447c_0
  • fsspec=0.8.0=py_0
  • future=0.18.2=py37_1
  • get_terminal_size=1.0.0=haa9412d_0
  • gevent=20.6.2=py37h7b6447c_0
  • glib=2.65.0=h3eb4bd4_0
  • glob2=0.7=py_0
  • gmp=6.1.2=h6c8ec71_1
  • gmpy2=2.0.8=py37h10f8cd9_2
  • graphite2=1.3.14=h23475e2_0
  • greenlet=0.4.16=py37h7b6447c_0
  • gst-plugins-base=1.14.0=hbbd80ab_1
  • gstreamer=1.14.0=hb31296c_0
  • h5py=2.10.0=py37h7918eee_0
  • harfbuzz=2.4.0=hca77d97_1
  • hdf5=1.10.4=hb1b8bf9_0
  • heapdict=1.0.1=py_0
  • html5lib=1.1=py_0
  • icu=58.2=he6710b0_3
  • idna=2.10=py_0
  • imageio=2.9.0=py_0
  • imagesize=1.2.0=py_0
  • importlib-metadata=1.7.0=py37_0
  • importlib_metadata=1.7.0=0
  • iniconfig=1.0.1=py_0
  • intel-openmp=2020.2=254
  • intervaltree=3.1.0=py_0
  • ipykernel=5.3.4=py37h5ca1d4c_0
  • ipython=7.18.1=py37h5ca1d4c_0
  • ipython_genutils=0.2.0=py37_0
  • ipywidgets=7.5.1=py_0
  • isort=5.5.3=py37_0
  • itsdangerous=1.1.0=py37_0
  • jbig=2.1=hdba287a_0
  • jdcal=1.4.1=py_0
  • jedi=0.14.1=py37_0
  • jeepney=0.4.3=py_0
  • jinja2=2.11.2=py_0
  • joblib=0.16.0=py_0
  • jpeg=9b=h024ee3a_2
  • json5=0.9.5=py_0
  • jsonschema=3.2.0=py37_1
  • jupyter=1.0.0=py37_7
  • jupyter_client=6.1.6=py_0
  • jupyter_console=6.2.0=py_0
  • jupyter_core=4.6.3=py37_0
  • jupyterlab=2.2.6=py_0
  • jupyterlab_server=1.2.0=py_0
  • keyring=21.4.0=py37_0
  • kiwisolver=1.2.0=py37hfd86e86_0
  • krb5=1.18.2=h173b8e3_0
  • lazy-object-proxy=1.4.3=py37h7b6447c_0
  • lcms2=2.11=h396b838_0
  • ld_impl_linux-64=2.33.1=h53a641e_7
  • libarchive=3.4.2=h62408e4_0
  • libcurl=7.71.1=h20c2e04_1
  • libedit=3.1.20191231=h14c3975_1
  • libffi=3.3=he6710b0_2
  • libgcc-ng=9.1.0=hdf63c60_0
  • libgfortran-ng=7.3.0=hdf63c60_0
  • liblief=0.10.1=he6710b0_0
  • libllvm10=10.0.1=hbcb73fb_5
  • libllvm9=9.0.1=h4a3c616_1
  • libpng=1.6.37=hbc83047_0
  • libsodium=1.0.18=h7b6447c_0
  • libspatialindex=1.9.3=he6710b0_0
  • libssh2=1.9.0=h1ba5d50_1
  • libstdcxx-ng=9.1.0=hdf63c60_0
  • libtiff=4.1.0=h2733197_1
  • libtool=2.4.6=h7b6447c_5
  • libuuid=1.0.3=h1bed415_2
  • libxcb=1.14=h7b6447c_0
  • libxml2=2.9.10=he19cac6_1
  • libxslt=1.1.34=hc22bd24_0
  • llvmlite=0.34.0=py37h269e1b5_4
  • locket=0.2.0=py37_1
  • lxml=4.5.2=py37hefd8a0e_0
  • lz4-c=1.9.2=he6710b0_1
  • lzo=2.10=h7b6447c_2
  • markupsafe=1.1.1=py37h14c3975_1
  • matplotlib=3.3.1=0
  • matplotlib-base=3.3.1=py37h817c723_0
  • mccabe=0.6.1=py37_1
  • mistune=0.8.4=py37h14c3975_1001
  • mkl=2020.2=256
  • mkl-service=2.3.0=py37he904b0f_0
  • mkl_fft=1.2.0=py37h23d657b_0
  • mkl_random=1.1.1=py37h0573a6f_0
  • mock=4.0.2=py_0
  • more-itertools=8.5.0=py_0
  • mpc=1.1.0=h10f8cd9_1
  • mpfr=4.0.2=hb69a4c5_1
  • mpmath=1.1.0=py37_0
  • msgpack-python=1.0.0=py37hfd86e86_1
  • multipledispatch=0.6.0=py37_0
  • navigator-updater=0.2.1=py37_0
  • nbconvert=5.6.1=py37_1
  • nbformat=5.0.7=py_0
  • ncurses=6.2=he6710b0_1
  • networkx=2.5=py_0
  • nltk=3.5=py_0
  • nose=1.3.7=py37_1004
  • notebook=6.1.1=py37_0
  • numba=0.51.2=py37h04863e7_1
  • numexpr=2.7.1=py37h423224d_0
  • numpy=1.19.1=py37hbc911f0_0
  • numpy-base=1.19.1=py37hfa32c7d_0
  • numpydoc=1.1.0=py_0
  • olefile=0.46=py37_0
  • openpyxl=3.0.5=py_0
  • openssl=1.1.1k=h27cfd23_0
  • packaging=20.4=py_0
  • pandas=1.2.4=py37ha9443f7_0
  • pandoc=2.10.1=0
  • pandocfilters=1.4.2=py37_1
  • pango=1.45.3=hd140c19_0
  • parso=0.5.2=py_0
  • partd=1.1.0=py_0
  • patchelf=0.11=he6710b0_0
  • path=15.0.0=py37_0
  • path.py=12.5.0=0
  • pathlib2=2.3.5=py37_1
  • pathtools=0.1.2=py_1
  • patsy=0.5.1=py37_0
  • pcre=8.44=he6710b0_0
  • pep8=1.7.1=py37_0
  • pexpect=4.8.0=py37_1
  • pickleshare=0.7.5=py37_1001
  • pillow=7.2.0=py37hb39fc2d_0
  • pip=20.2.2=py37_0
  • pixman=0.40.0=h7b6447c_0
  • pkginfo=1.5.0.1=py37_0
  • pluggy=0.13.1=py37_0
  • ply=3.11=py37_0
  • prometheus_client=0.8.0=py_0
  • prompt-toolkit=3.0.7=py_0
  • prompt_toolkit=3.0.7=0
  • psutil=5.7.2=py37h7b6447c_0
  • ptyprocess=0.6.0=py37_0
  • py=1.9.0=py_0
  • py-lief=0.10.1=py37h403a769_0
  • pycodestyle=2.6.0=py_0
  • pycosat=0.6.3=py37h7b6447c_0
  • pycparser=2.20=py_2
  • pycrypto=2.6.1=py37h7b6447c_10
  • pycurl=7.43.0.5=py37h1ba5d50_0
  • pydocstyle=5.1.1=py_0
  • pyflakes=2.2.0=py_0
  • pygments=2.7.1=py_0
  • pylint=2.6.0=py37_0
  • pyodbc=4.0.30=py37he6710b0_0
  • pyopenssl=19.1.0=py_1
  • pyparsing=2.4.7=py_0
  • pyqt=5.9.2=py37h05f1152_2
  • pyrsistent=0.17.3=py37h7b6447c_0
  • pysocks=1.7.1=py37_1
  • pytables=3.6.1=py37h71ec239_0
  • pytest=6.0.2=py37_0
  • python=3.7.9=h7579374_0
  • python-dateutil=2.8.1=py_0
  • python-jsonrpc-server=0.4.0=py_0
  • python-language-server=0.31.7=py37_0
  • python-libarchive-c=2.9=py_0
  • pytz=2020.1=py_0
  • pywavelets=1.1.1=py37h7b6447c_0
  • pyxdg=0.26=py_0
  • pyyaml=5.3.1=py37h7b6447c_1
  • pyzmq=19.0.2=py37he6710b0_1
  • qdarkstyle=2.8.1=py_0
  • qt=5.9.7=h5867ecd_1
  • qtawesome=0.7.2=py_0
  • qtconsole=4.7.6=py_0
  • qtpy=1.9.0=py_0
  • readline=8.0=h7b6447c_0
  • regex=2020.7.14=py37h7b6447c_0
  • requests=2.24.0=py_0
  • ripgrep=11.0.2=he32d670_0
  • rope=0.17.0=py_0
  • rtree=0.9.4=py37_1
  • ruamel_yaml=0.15.87=py37h7b6447c_1
  • scikit-image=0.16.2=py37h0573a6f_0
  • scikit-learn=0.23.2=py37h0573a6f_0
  • scipy=1.5.2=py37h0b6359f_0
  • seaborn=0.11.0=py_0
  • secretstorage=3.1.2=py37_1
  • send2trash=1.5.0=py37_0
  • setuptools=49.6.0=py37_0
  • simplegeneric=0.8.1=py37_2
  • singledispatch=3.4.0.3=py37_1000
  • sip=4.19.8=py37hf484d3e_0
  • six=1.15.0=py_0
  • snappy=1.1.8=he6710b0_0
  • snowballstemmer=2.0.0=py_0
  • sortedcollections=1.2.1=py_0
  • sortedcontainers=2.2.2=py_0
  • soupsieve=2.0.1=py_0
  • sphinx=3.2.1=py_0
  • sphinxcontrib=1.0=py37_1
  • sphinxcontrib-applehelp=1.0.2=py_0
  • sphinxcontrib-devhelp=1.0.2=py_0
  • sphinxcontrib-htmlhelp=1.0.3=py_0
  • sphinxcontrib-jsmath=1.0.1=py_0
  • sphinxcontrib-qthelp=1.0.3=py_0
  • sphinxcontrib-serializinghtml=1.1.4=py_0
  • sphinxcontrib-websupport=1.2.4=py_0
  • spyder=4.0.1=py37_0
  • spyder-kernels=1.8.1=py37_0
  • sqlalchemy=1.3.19=py37h7b6447c_0
  • sqlite=3.33.0=h62c20be_0
  • statsmodels=0.11.1=py37h7b6447c_0
  • sympy=1.6.2=py37_0
  • tbb=2020.3=hfd86e86_0
  • tblib=1.7.0=py_0
  • terminado=0.8.3=py37_0
  • testpath=0.4.4=py_0
  • threadpoolctl=2.1.0=pyh5ca1d4c_0
  • tk=8.6.10=hbc83047_0
  • toml=0.10.1=py_0
  • toolz=0.10.0=py_0
  • tornado=6.0.4=py37h7b6447c_1
  • tqdm=4.49.0=py_0
  • traitlets=4.3.3=py37_0
  • typed-ast=1.4.1=py37h7b6447c_0
  • typing_extensions=3.7.4.3=py_0
  • ujson=3.2.0=py37he6710b0_0
  • unicodecsv=0.14.1=py37_0
  • unixodbc=2.3.7=h14c3975_0
  • urllib3=1.25.10=py_0
  • watchdog=0.10.3=py37_0
  • wcwidth=0.2.5=py_0
  • webencodings=0.5.1=py37_1
  • werkzeug=1.0.1=py_0
  • wheel=0.35.1=py_0
  • widgetsnbextension=3.5.1=py37_0
  • wrapt=1.11.2=py37h7b6447c_0
  • wurlitzer=2.0.1=py37_0
  • xlrd=1.2.0=py37_0
  • xlsxwriter=1.3.4=py_0
  • xlwt=1.3.0=py37_0
  • xmltodict=0.12.0=py_0
  • xz=5.2.5=h7b6447c_0
  • yaml=0.2.5=h7b6447c_0
  • yapf=0.30.0=py_0
  • zeromq=4.3.2=he6710b0_3
  • zict=2.0.0=py_0
  • zipp=3.1.0=py_0
  • zlib=1.2.11=h7b6447c_3
  • zope=1.0=py37_1
  • zope.event=4.4=py37_0
  • zope.interface=5.1.0=py37h7b6447c_0
  • zstd=1.4.5=h9ceee32_0
    prefix: /home/abartlett/anaconda3

@jakebailey
Copy link
Member

This aren't the trace logs the troubleshooting asked for, unfortunately. Can you set "python.analysis.logLevel": "Trace" and attach the logs in text (not a screenshot)?

@abartlett004
Copy link

Ok, I have changed that setting and attached is the new output. Is this what you mean? Also, for what it's worth, Intellisense happens to be working right now, although it has been intermittently working and not working over the past few days.

trace.txt

@jakebailey
Copy link
Member

You seem to be opening your entire home folder as your workspace, so we're getting stuck trying to scan all of the files before starting to analyze them. Can you open the specific project you are editing, rather than the entire home folder?

This is made worse by using WSL on Windows folders, as IO between WSL and Windows folders is quite slow.

@abartlett004
Copy link

Ah I understand, I didn't realize the extension was analyzing all files in the workspace rather than just the few I had open. VS code seemed to have just been defaulting to opening my entire home folder. Now that I open a more specific folder containing the code that I am editing, the extension seems to load much faster. Lesson learned!

@jakebailey
Copy link
Member

It only analyzes the ones you've opened, but at the moment, we scan for a list of files in the workspace so we can do things like distinguish library files from user files (so that you can't rename a function from the standard library, for example).

We've gotten a pretty significant number of issues lately about this; it may be worth some thought figuring out how we can avoid this work when we're not in workspace diagnostic mode (so therefore only need the list of source files for specific operations).

@erictraut
Copy link
Contributor

We still need this list to do implement features like "Go to references", "Find all references", etc. However, we may want to time-bound the scan and cut it short (perhaps with an accompanying error dialog) if it's taking a long time — say, more than 20 sec. We should probably also see what the typescript LS is doing. I thought they had similar scanning logic, but perhaps they've come up with an alternative approach to work around issues like this.

@jakebailey jakebailey added needs investigation Could be an issue - needs investigation and removed waiting for user response Requires more information from user labels Aug 19, 2021
@jakebailey jakebailey changed the title IntelliSense no longer working Hang on source file search when opening $HOME Aug 19, 2021
@heejaechang heejaechang added enhancement New feature or request and removed needs investigation Could be an issue - needs investigation labels Mar 17, 2022
@heejaechang
Copy link
Contributor

asking is basically making source scanning lazy.

we only check file tracking at the time of file open and only do full scanning when solution wide feature is executed such as find all reference, rename, workspace symbol or workspace wide diagnostic mode.

@judej
Copy link
Contributor

judej commented Apr 20, 2022

Moving this issue to discussion as an enhancement request for comments and upvotes.

@microsoft microsoft locked and limited conversation to collaborators Apr 20, 2022
@judej judej converted this issue into discussion #2710 Apr 20, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants