appwrite / sdk-for-web

[READ-ONLY] Official Appwrite Web SDK ๐Ÿงก
https://appwrite.io
BSD 3-Clause "New" or "Revised" License
271 stars 58 forks source link

๐Ÿ› Bug Report: JSDocstrings for functions not appearing in VSCode Intellisense thingy when using Web SDK #84

Closed RyanBaig closed 2 weeks ago

RyanBaig commented 5 months ago

๐Ÿ‘Ÿ Reproduction steps

  1. Open HTML file.
  2. Add Web SDK CDN.
  3. Initialize Appwrite Client using:
    const client = new Appwrite.Client()
  4. Set Projects, Endpoint:
    client.setProject("myProject");
    client.setEndpoint("https://cloud.appwrite.io/v1")
  5. Hover over client.setProject("myProject"); or client.setEndpoint("https://cloud.appwrite.io/v1") and see no JSDocstring.

๐Ÿ‘ Expected behavior

When I hover over the client.setProject("myProject"); or client.setEndpoint("https://cloud.appwrite.io/v1") part, it should show the JSDoc using this Docstring provided in your source code:

/**
     * Set Endpoint
     *
     * Your project endpoint
     *
     * @param {string} endpoint
     *
     * @returns {this}
*/

or

/**
     * Set Project
     *
     * Your project ID
     *
     * @param value string
     *
     * @return {this}
*/

๐Ÿ‘Ž Actual Behavior

They actually don't. I am not sure if this is a problem by the IDE or not.

๐ŸŽฒ Appwrite version

Version 0.10.x

๐Ÿ’ป Operating system

Windows

๐Ÿงฑ Your Environment

Vercel for hosting. VSCode 1.70.3 as IDE, Windows 7 for OS, HP Probook 4520s for Machine

๐Ÿ‘€ Have you spent some time to check if this issue has been raised before?

๐Ÿข Have you read the Code of Conduct?

stnguyen90 commented 1 month ago

@RyanBaig, thanks for raising this issue! ๐Ÿ™๐Ÿผ Does this work with any other package from CDN? Do you have a code sample of it working with another CDN? I tried with lodash and didn't get any typing info:

image

From my experience, your IDE knows about packages when you have a package.json and install the package so it's in your node_modules. When you add a script tag for a package, the IDE has no idea about the types and whatnot about the package.

stnguyen90 commented 2 weeks ago

Closing as stale.