-
Notifications
You must be signed in to change notification settings - Fork 147
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
Conversation
Monitor.TryEnter(scriptInfo.BuildingMetadataLock, LanguageService.OnConnectionWaitTimeout)) | ||
{ | ||
try | ||
{ | ||
this.BindingQueue.AddConnectionContext(connInfo, featureName: "LanguageService", overwrite: true); | ||
RemoveScriptParseInfo(rebuildParams.OwnerUri); | ||
UpdateLanguageServiceOnConnection(connInfo).Wait(); |
There was a problem hiding this comment.
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)
@@ -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 () => | |||
{ |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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.