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, ''),
: (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;
}
}
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: {
};
}
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)];