microsoft / azuredatastudio

Azure Data Studio is a data management and development tool with connectivity to popular cloud and on-premises databases. Azure Data Studio supports Windows, macOS, and Linux, with immediate capability to connect to Azure SQL and SQL Server. Browse the extension library for more database support options including MySQL, PostgreSQL, and MongoDB.
https://learn.microsoft.com/sql/azure-data-studio
MIT License
7.57k stars 900 forks source link

Notebooks with Python : unable to get code intellisense #9067

Open EricTechcert opened 4 years ago

EricTechcert commented 4 years ago

Azure data studio with python, code IntelliSense not working code. This is a huge problem at this point. Attached screenshots are for VS code, Jupyter notebook, and Azure notebook

vs code is working: image

Jupyter notebook is working image

Azure notebook is not working: image

Reproduce the issue:

Note: Code IntelliSense can be seen with notebook with SQL queries.

chlafreniere commented 4 years ago

Hi @EricTechcert sorry to hear that you're having an issue.

I wasn't quite able to reproduce your issue: image

After you type in "df.plot.", if you press ctrl+space, does the list populate correctly, or is it empty, out of curiosity?

EricTechcert commented 4 years ago

Not getting correct IntelliSense in azure data studio. I have added sample code to try out in vs code and Azure data studio or even Jupyter notebook. Additionally added screenshots to describe the issue.

Azure Data Studio: According to below screenshot, when we enter 'dot' We did not get anything, image

After press ctrl+space, and those IntelliSense are incorrect image

compare with the above screenshot, I will enter some other value to code cell. check the value IntelliSense is provided and those are incorrect. (I assume whatever we type in code cell, its provide) image

This is we get from vs code even without press ctrl+Space. (After entering the plot[.]) this is the correct IntelliSense what we expected. image

Sample code to reproduce. Enter the below code in vs code and Azure data studio and check the IntelliSense.

Code sample:

%matplotlib inline import pandas as pd import matplotlib.pyplot as plt

grades = pd.DataFrame([[6,4,5], [7,8,8], [6,7,5], [6,5,7], [5,2,6]], index=['Mary', 'John', 'Ann', 'Pete', 'Laura',], columns = ['test_1', 'test_2', 'test_3'])

grades

grades.

VS Code with proper IntelliSense: image

Azure Data Studio with same code sample with Ctrl+space. This not what expected. image

RolandASc commented 4 years ago

I am experiencing the same problem with Python. If you look at the screenshots, you can see that the suggestions are actually just words picked up from the immediate context above within the same code cell. So not sure if that's a helpful observation, maybe there are multiple modes for the IntelliSense?

Interestingly, I noticed the same problem with an SQL-Kernel notebook earlier today, but in that one it is now back to functioning the expected way again.

abourassi commented 3 years ago

Hi, This problem still not resolved ? best regards,

chlafreniere commented 3 years ago

@lucyzhang929 you're working in this area. Can you look into this? I know we've made some changes recently but definitely want to get to the bottom of this.

lucyzhang929 commented 3 years ago

Hi @EricTechcert @RolandASc @abourassi,

Using the sample code @EricTechcert gave above, I see the same Intellisense suggestions on the latest version of Azure Data Studio (1.25.1) as VSCode after pressing ctrl+space.

Azure Data Studio: ADS VSCode: VSCode

Can someone confirm that they are also seeing the same suggestions after pressing ctrl+space?

I will investigate why the suggestions are not showing up without pressing ctrl+space.

RolandASc commented 3 years ago

Thanks for investigating @lucyzhang929.

I have upgraded Azure Data Studio (1.25.1) and tried the same code snippet in a notebook cell, but unfortunately still have the same problem (i.e. wrong context suggestions after pressing ctrl + space.

Fwiw, I am using the "Python 3" kernel and pointing to my own pre-existing Python installation (Miniconda). Under "Settings", Editor > Suggest: all the various boxes are ticked.

However, I have also tried to create a new notebook, pasted in the code snippet, and it was working fine for a moment. Once I saved the notebook (extension .ipynb), it has again stopped working though.

lucyzhang929 commented 3 years ago

@RolandASc, are the wrong context suggestions you are seeing the same as the one @EricTechcert posted above (grades. example)? I am seeing the same "wrong" suggestions list when I am using the SQL Kernel:

Screen Shot 2020-12-15 at 9 41 31 AM

I wonder if this has something to do with the kernels not switching completely from SQL to Python 3.

abourassi commented 3 years ago

Hi, In my case, it work if new notebook, but python IntelliSense not working in an existing noteook. Regards,