Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSDoc #20

Open
shmygol opened this issue May 20, 2024 · 4 comments
Open

JSDoc #20

shmygol opened this issue May 20, 2024 · 4 comments
Assignees

Comments

@shmygol
Copy link

shmygol commented May 20, 2024

It would be nice if JSDoc were preserved to enable autocompletion for custom functions.

@mahaker
Copy link
Owner

mahaker commented May 21, 2024

Generally agreed!
I'm waiting for your PullRequest!

@mahaker mahaker closed this as completed May 21, 2024
@mahaker mahaker reopened this May 21, 2024
@shmygol
Copy link
Author

shmygol commented May 25, 2024

I don't have much experience with esbuild, but it doesn't seem to be possible: evanw/esbuild#294.

@mahaker
Copy link
Owner

mahaker commented May 27, 2024

@shmygol
Sorry, I understand what you are requesting.
You want this plugin to also output JSDoc for functions implemented by the user.
Is this correct?

@shmygol
Copy link
Author

shmygol commented May 27, 2024

Correct. It is essential, because custom formulas in Google Spreadsheets need JSDoc to support auto-completion and user documentation. Instead of using esbuild-gas-plugin I ended up bundling the business logic with an esbulid parameter glabalName: 'Main' and push the bundle together with an unmodified custom index.js containing formulas and hooks required by GAS like this:

/**
 * Hello World
 *
 * @param {string} name Your name
 * @return {string}
 * 
 * @customfunction
 */
function HELLO(name) {
    return Main.hello(name);
}

@mahaker mahaker self-assigned this Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants