Skip to content

Commit

Permalink
Fix Results Panel not Refreshing Automatically
Browse files Browse the repository at this point in the history
- Fixes #669
- Ensures that TextDocumentContentProvider.provideTextDocumentContent always provides an updated string when being refreshed. In VSCode 1.9.0, it's vital to do this as there is a diff on the provided content and the document is only refreshed if this is different
  • Loading branch information
kcunnane authored and kcunnane committed Feb 3, 2017
1 parent 8d2e0df commit a95a268
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/models/SqlOutputContentProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -411,13 +411,13 @@ export class SqlOutputContentProvider implements vscode.TextDocumentContentProvi
public provideTextDocumentContent(uri: vscode.Uri): string {
// URI needs to be encoded as a component for proper inclusion in a url
let encodedUri = encodeURIComponent(uri.toString());

// return dummy html content that redirects to 'http://localhost:<port>' after the page loads
let timeNow = new Date().getTime();
return `
<html>
<head>
<script type="text/javascript">
window.onload = function(event) {
console.log('reloaded results window at time ${timeNow}ms');
var doc = document.documentElement;
var styles = window.getComputedStyle(doc);
var backgroundcolor = styles.getPropertyValue('--background-color');
Expand Down

0 comments on commit a95a268

Please sign in to comment.