Skip to content

Commit

Permalink
Merge pull request #14 from GianOrtiz/update-status-bar
Browse files Browse the repository at this point in the history
Fixes #12
  • Loading branch information
GianOrtiz committed Oct 21, 2018
2 parents bc44443 + 86bff03 commit 734e1e6
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import * as cp from 'child_process'
import * as http from 'http'
import * as vscode from 'vscode'

let loadingStatus = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Left)
loadingStatus.text = 'Loading Snippet ...'

export function activate(ctx: vscode.ExtensionContext) {
ctx.subscriptions.push(vscode.commands.registerCommand(
'snippet.find', find))
Expand Down Expand Up @@ -58,10 +61,15 @@ function findSelectedText() {

var requestCache = new Object()
function asyncRequest(queryRaw: string, callback: (data: string) => void) {
let loadingStatus = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Left)
loadingStatus.text = 'Loading Snippet ...'
loadingStatus.show()

try {
let query = encodeURI(queryRaw.replace(/ /g, '+'))
} catch(TypeError) {
loadingStatus.hide()
return
}

let query = encodeURI(queryRaw.replace(/ /g, '+'))
let language = vscode.window.activeTextEditor.document.languageId

Expand Down

0 comments on commit 734e1e6

Please sign in to comment.