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

FIx intellisense cache not refreshing #831

Merged
merged 3 commits into from
Jun 27, 2019

Conversation

Charles-Gagnon
Copy link
Contributor

Fixes microsoft/azuredatastudio#4825. When refreshing we weren't clearing the cached ScriptParseInfo so it basically wasn't doing anything since we'd use that binding info next time an Intellisense query request was submitted.

Monitor.TryEnter(scriptInfo.BuildingMetadataLock, LanguageService.OnConnectionWaitTimeout))
{
try
{
this.BindingQueue.AddConnectionContext(connInfo, featureName: "LanguageService", overwrite: true);
RemoveScriptParseInfo(rebuildParams.OwnerUri);
UpdateLanguageServiceOnConnection(connInfo).Wait();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's the only actual changes. I call UpdateLanguageServiceOnConnection to immediately rebuild the cache (it would do it the next time a request came in but this frontloads it so we can start that process early for slow connections)

@coveralls
Copy link

coveralls commented Jun 26, 2019

Coverage Status

Coverage decreased (-0.1%) to 76.324% when pulling c7e7585 on fix/intellisenseCacheNotClearing into fc50913 on master.

@@ -290,17 +290,17 @@ public void InitializeService(ServiceHost serviceHost, SqlToolsContext context)
/// <param name="requestContext"></param>
/// <returns></returns>
internal async Task HandleSyntaxParseRequest(SyntaxParseParams param, RequestContext<SyntaxParseResult> requestContext)
{
await Task.Run(async () =>
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it often nice to separate non-function formatting changes from functional changes into different PRs. I see you called out the relevant changes, but it's hard to spot typos, etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah sorry about that - I have an extension that deletes whitespace on save automatically so I don't notice the changes until I'm committing them in usually and undoing them would be a pain. If there were more actual changes I'd do that to make it clearer but since this was just 2 lines I figured it'd be fine to just call it out like I did.

@Charles-Gagnon Charles-Gagnon merged commit c1f2411 into master Jun 27, 2019
@Charles-Gagnon Charles-Gagnon deleted the fix/intellisenseCacheNotClearing branch June 27, 2019 23:50
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

Successfully merging this pull request may close these issues.

Intellisense not refreshing
4 participants