fossamagna / gas-webpack-plugin

Webpack plugin for Google Apps Script

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Feature Request] JS Doc Comments for custom functions

Cerlancism opened this issue · comments

I tried using this to write some custom functions for Spreadsheet

/**
 * Test Function
 * @param {any} input
 * @return "From test Function"
 * @customfunction
 */
global.testCustomFunction = (input) =>
{
    return `From test function: ${input}`
}

In the output

function testCustomFunction() {
}/******/ (function(modules) { // webpackBootstrap

// Webpack stuffs

"use strict";
/* WEBPACK VAR INJECTION */(function(global) {

/**
 * Test Func
 * @param {any} input
 * @return "From test Func"
 * @customfunction
 */
global.testCustomFunction = function (input) {
  return "From test function: " + input;
};
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))

// Webpack stuffs

It works but the JS Doc as well as the function parameters are not brought over to the exposed function and therefore can't be detected by spreadsheet for auto completion.

@Cerlancism Thank you for your feedback.
I will try add this feature at next week.

@Cerlancism I published new version. Please try to use it.