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

Missing IntelliSense or code auto completion #30

Open
rinkist opened this issue Aug 18, 2023 · 2 comments
Open

Missing IntelliSense or code auto completion #30

rinkist opened this issue Aug 18, 2023 · 2 comments

Comments

@rinkist
Copy link

rinkist commented Aug 18, 2023

Hi,

We followed the tutorial and set up a working code-server instance running on Sagemaker Studio.
One very crucial part is to have IntelliSense or code auto completion when working with packages like pandas, etc.

However, this code completion seems not to work with loaded modules/packages like pandas or numpy but with internal defined functions/method/classes only.

Since code-server can not use pylance as a LSP, I made the change to "Jedi" as the default language server.
In my local set up (running code-server on a local machine) the auto-completion works out.

However, in my Sagemaker Studio hosted environment it does not. Code completion is quite essential for us (otherwise we can also stick to a text editor).

Therefore, I wanted to ask if you faced similar issues? The problem could be the environment code-server is running in (e.g., no access to the installed packages to make suggestions)

P.S. I ensured that the pandas package is installed in the used python interpreter as well as in the conda env the shell is running in

@giuseppeporcelli
Copy link
Contributor

Hi,
can you please share your current configuration (code-server version, extension versions, networking, etc.)?

As you can see in this screenshot, IntelliSense was working well:
https://github.com/aws-samples/amazon-sagemaker-codeserver/blob/main/images/code-server-intellisense-sm.png

As a consequence, we need to investigate when and were this regression was introduced.

@rinkist
Copy link
Author

rinkist commented Aug 19, 2023

Hi,
Thank you for your fast answer!

I have done further investigations in this direction and have to rephrase my original statement.

IntelliSense works for packages that are (pre-) installed in the conda environment studio but not in any other.

When I install code-server (4.15.0) on Sagemaker Studio, I have the following conda environments available:

  • base (3.9.15)
  • code_server_py39 (3.9.17) (source)
  • jumpstart-env (3.10.12)
  • studio (3.9.12)

The code_server_py39 (3.9.17) is automatically selected when starting code-server.

However, if I install new packages (i.e., pandas) in this environment I would not get any IntelliSense support for it.

It only works if I install new packages in studio (3.9.12) and select this environment at least once in code-server so (my hypothesis) code-server can make a connection to the packages installed in studio (3.9.12). After that I can switch to any other env in code-server. However, I would only get IntelliSense support for packages installed in the mentioned studio env.

I can for now live with it. However, in best case code-server would read the packages of the current selected env so that one does not have to "pollute" the studio env with packages.

Setup:

  • Installed code-server on Sagemaker Studio (not the Notebook Version)
  • Tried it in internet and no-internet domains - Results are the same

Versions:

  • Code-server version 4.15.0
  • python extension version v2023.13.12091005

settings.json:

{
   "workbench.colorTheme":"Monokai",
   "[python]":{
      "editor.defaultFormatter":"ms-python.black-formatter",
      "editor.formatOnSave":true,
      "editor.codeActionsOnSave":{
         "source.organizeImports":true
      }
   },
   "isort.args":[
      "--profile",
      "black"
   ],
   "python.languageServer": "Jedi"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants