massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-go / lib / utils / modify-tags.js
index cdb05e4f6ef9620df094e7f4676f4237050cd8ef..ca80186705eea02813c1807b7f35184135ed084b 100644 (file)
@@ -18,12 +18,12 @@ async function addTags(document, params = {}) {
     const skipUnexported = config.skipUnexported;
     let cursor;
     if (params.prompt) {
-        cursor = await coc_nvim_1.workspace.getCursorPosition();
-        tags = await coc_nvim_1.workspace.requestInput('Enter comma separated tag names', tags);
+        cursor = await coc_nvim_1.window.getCursorPosition();
+        tags = await coc_nvim_1.window.requestInput('Enter comma separated tag names', tags);
         if (!tags) {
             return;
         }
-        options = await coc_nvim_1.workspace.requestInput('Enter comma separated options', options);
+        options = await coc_nvim_1.window.requestInput('Enter comma separated options', options);
     }
     const args = [
         '-add-tags', tags.replace(/ +/g, ''),
@@ -45,8 +45,8 @@ async function removeTags(document, params = {}) {
         : (config.tags || 'json');
     let cursor;
     if (params.prompt) {
-        cursor = await coc_nvim_1.workspace.getCursorPosition();
-        tags = await coc_nvim_1.workspace.requestInput('Enter comma separated tag names', tags);
+        cursor = await coc_nvim_1.window.getCursorPosition();
+        tags = await coc_nvim_1.window.requestInput('Enter comma separated tag names', tags);
         if (!tags) {
             return;
         }
@@ -76,7 +76,7 @@ async function runGomodifytags(document, args) {
 }
 async function execGomodifytags(args, input) {
     try {
-        const stdout = await tools_1.execTool(binaries_1.GOMODIFYTAGS, args, input);
+        const stdout = await (0, tools_1.execTool)(binaries_1.GOMODIFYTAGS, args, input);
         const mods = JSON.parse(stdout);
         return {
             range: {
@@ -87,22 +87,22 @@ async function execGomodifytags(args, input) {
         };
     }
     catch (err) {
-        coc_nvim_1.workspace.showMessage(`Cannot modify tags: ${err}`, 'error');
+        coc_nvim_1.window.showMessage(`Cannot modify tags: ${err}`, 'error');
         throw err;
     }
 }
 function fileArchive(fileName, fileContents) {
     return fileName + '\n' + Buffer.byteLength(fileContents, 'utf8') + '\n' + fileContents;
 }
-// https://github.com/microsoft/vscode-go/blob/master/src/util.ts#L84
+// https://github.com/golang/vscode-go/blob/master/src/util.ts#L84
 function byteOffsetAt(document, position) {
     const offset = document.offsetAt(position);
     const text = document.getText();
     return Buffer.byteLength(text.substr(0, offset)).toString();
 }
 async function offsetArgs(document, selection, cursor = null) {
-    cursor = cursor || await coc_nvim_1.workspace.getCursorPosition();
-    coc_nvim_1.workspace.showMessage(`selection = ${selection}`);
+    cursor = cursor || await coc_nvim_1.window.getCursorPosition();
+    coc_nvim_1.window.showMessage(`selection = ${selection}`);
     switch (selection) {
         case "struct":
             return ['-offset', byteOffsetAt(document, cursor)];