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.55k stars 899 forks source link

Intellisense not working #4817

Open Emil3001 opened 5 years ago

Emil3001 commented 5 years ago

The intellisense that that prompts column and table names isn't working for me at all, however the intellisense that prompts SQL commands is

So typing dbo. will not prompt anything (etc. etc.) but typing SELECT * F will prompt 'FROM keyword'

I'm connected to a Azure SQL Server instance. Intellisense works when I connect from SSMS and Visual Studio I've refreshed the intellisense cache It's be an issue for at least 6 weeks

Any ideas how I can fix this?

Here's my setup: Version: 1.5.2 (user setup) Commit: f74080c96310354bc92211f1826c0fdce78ca2f6 Date: 2019-03-22T06:25:26.627Z VS Code 1.30.1 Electron: 2.0.12 Chrome: 61.0.3163.100 Node.js: 8.9.3 V8: 6.1.534.41 OS: Windows_NT x64 10.0.17134

adsbot[bot] commented 5 years ago

Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

Emil3001 commented 5 years ago

Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

I have checked and it isn't

anthonydresser commented 5 years ago

Our intellisense against azure can be slow depending on the which performance level the db is. Have you experienced this against an on prem server?

Emil3001 commented 5 years ago

thanks @anthonydresser

Tried against an on prem server and Intellisense works fine. I also tried again against and it is working partially. Have also checked the DB performance and it's on the elastic pool, so presumably high performance?

A colleague tried from his machine and intellisense worked fined (using the same DB and credentials).

Could being on a VM cause an issue? I'm on a VM, he isn't. That's the only difference I can think of

anthonydresser commented 5 years ago

I'm not super familiar with the intellisense impact on azure sql server @kburtram might know more. We have a work item to implement a lower cost intellisense stack when targeting azure.

kentmaxwell commented 5 years ago

I am using Azure Data Studio with a Azure Elastic Premium pool database. Prior to the March release, Intellisense worked fine for me. Now it doesn't refresh, even if I initiate the refresh intellisense option in the application. The only way I can refresh the intellisense cache is to refresh the database objects in the object explorer. I understand that the program now manages intellisense based on the performance to the data source. Would Azure Elastic Premium pool be one of those sources with a lower cost?

kburtram commented 5 years ago

@kentmaxwell IntelliSense works by building a cache of a server's object metadata (databases, tables, sprocs, columns, etc.). This process involves running a series of SQL statements against the server's DMVs. On some servers we've seen that this process will timeout and fail (typically Azure SQL DB servers with ~10 DTUs or sometime against a "cold" Azure SQL DB instance that's been idle for a long time or against servers under very high load).

I wouldn't expect an Elastic Premium pools to typically encounter these problems. The "low cost" options @anthonydresser is referring to are things like (1) rewrite the metadata provider to run fewer queries increasing the chance of success or (2) using an offline IntelliSense cache similar to what we do with SSDT .sqlproj support.

Flaky IntelliSense against SQL DB is one of our top improvements we're planning to address in the language service over the next few months.

kentmaxwell commented 5 years ago

Thank you. That’s awesome that addressing InteliSense against SQL DB is a high priority. I do a lot of SQL development against Azure SQL DB instances and now exclusively use Azure Data Studio. If there is any way I can help you with this, please let me know.

On Apr 29, 2019, at 2:14 PM, Karl Burtram notifications@github.com wrote:

@kentmaxwell https://github.com/kentmaxwell IntelliSense works by building a cache of a server's object metadata (databases, tables, sprocs, columns, etc.). This process involves running a series of SQL statements against the server's DMVs. On some servers we've seen that this process will timeout and fail (typically Azure SQL DB servers with ~10 DTUs or sometime against a "cold" Azure SQL DB instance that's been idle for a long time or against servers under very high load).

I wouldn't expect an Elastic Premium pools to typically encounter these problems. The "low cost" options @anthonydresser https://github.com/anthonydresser is referring to are things like (1) rewrite the metadata provider to run fewer queries increasing the chance of success or (2) using an offline IntelliSense cache similar to what we do with SSDT .sqlproj support.

Flaky IntelliSense against SQL DB is one of our top improvements we're planning to address in the language service over the next few months.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Microsoft/azuredatastudio/issues/4817#issuecomment-487707120, or mute the thread https://github.com/notifications/unsubscribe-auth/ABNILJ7MSSYYC73KUWMFJ63PS5CIDANCNFSM4HDIROCQ.

Bokaii commented 4 years ago

Are there any plans on fixing the issues with Intellisense in the near future? I also only get column and table recommendations on a very "hit and miss" basis, like Emil3001. I thought this would be fixed in the most recent update, but nothing changed for me.

A non working Intellisense is currently stopping me from using Azure data studio at all.

asjones987 commented 4 years ago

Anyone seeing this bug when connected to standard SQL 2014 and not an Azure DB. There was a bug back in September with Intellisense not working but that was fixed in October but now all of a sudden ... it is not completing fields or table names as it was (even in the same version).

Version: 1.12.2 (system setup) Commit: c9bef82ace6c67190d0e83820011a2bbd1f793c1 Date: 2019-10-11T04:56:40.634Z VS Code 1.37.0 Electron: 4.2.9 Chrome: 69.0.3497.128 Node.js: 10.11.0 V8: 6.9.427.31-electron.0 OS: Windows_NT x64 10.0.17763

billwert commented 4 years ago

@kburtram Is there a way to see diagnostics for the queries that should populate the intellisense cache? I'm also failing to see intellisense against my SQL Azure instance (which is a standard instance with lots of DTUs..)

kburtram commented 4 years ago

@billwert you can use the SQL Profiler extension to observe the queries that are being used to build the intellisense cache. Assuming the reach the server successfully.

The "MSSQL: Tracing Level" user setting can also be adjusted to "Verbose" to output more diagnostic information from the tools service component. Those logs should be in [USERPROFILEROOT]\Appdata\roaming\azuredatastudio\logs[TIMESTAMP]\exthost\Microsoft.mssql\sqltools.log. This log should contain any exceptions encountered populating the cache.

dev-in-disguise commented 4 years ago

I'm having this issue with Intellisense as well. I'm just adding that I use connections with Windows Authentication. While investigating this issue a little bit I enabled debug logging and found the exception I attached. It obviously points to the fact that the connection failed but still I am able to execute statements against the DB with my Windows credentials. So maybe this is related to the Intellisense issue and helps in solving at least my case

Azure Data Studio Intellisense Exception.txt

delight-by commented 4 years ago

FYI: My Intellisense stopped working again, only this time it stopped working for a specific server and I just couldn't make it to work again... until I opened the Manage page - this fixed the issue immediately, guess it forced the cache repopulation or something. * I'm using AD auth with this specific connection in case it's relevant.