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

Visual Studio Code autocomplete does not have the automatic methods #5

Closed
shazron opened this issue Mar 9, 2020 · 6 comments
Closed
Assignees
Labels
bug Something isn't working documentation Improvements or additions to documentation help wanted Extra attention is needed

Comments

@shazron
Copy link
Member

shazron commented Mar 9, 2020

Expected Behaviour

Autocomplete is available for all methods, including the auto generated ones.

Actual Behaviour

Autocomplete is not available for all methods, e.g. listComputedAttributes is missing for example.

Steps to Reproduce

  1. Require the library in your code
  2. init to get the SDK object
  3. Try to autocomplete to list a method, like listComputedAttributes.

Investigation

Visual Studio Code is not using the types.d.ts file for autocomplete, it is using the methods it introspects from the exported module. Find out how Visual Studio Code derives its autocomplete data from, so we can fix it in the library.

@meryllblanchet meryllblanchet added bug Something isn't working documentation Improvements or additions to documentation help wanted Extra attention is needed labels Mar 9, 2020
@easingthemes
Copy link
Collaborator

easingthemes commented Mar 11, 2020

WebStorm works fine without any configuration or additional files:

  1. Methods autocomplete:

Screenshot 2020-03-11 at 17 57 09

2. Params list:

Screenshot 2020-03-11 at 18 07 39

Screenshot 2020-03-11 at 18 11 26

Params list is a bit buggy, sometimes duplicated, and sometimes missing params defined with quotes, like schema.name

@easingthemes
Copy link
Collaborator

For some parameters it works fine, eg
Screenshot 2020-03-11 at 18 13 36

So it looks like only if dot is in param name it has issues.

@shazron
Copy link
Member Author

shazron commented Mar 12, 2020

Not sure if this is related: #6 (two blank lines in the JSDoc, thus the types.d.ts file)

@shazron
Copy link
Member Author

shazron commented May 16, 2020

After reading the VS Code docs, I believe the typings file should be called index.d.ts to solve this issue.

@shazron shazron added bug Something isn't working and removed bug Something isn't working labels Jun 11, 2020
@aiojbot
Copy link
Collaborator

aiojbot commented Jun 11, 2020

JIRA issue created: https://jira.corp.adobe.com/browse/ACNA-796

@moritzraho moritzraho self-assigned this Jul 22, 2020
@moritzraho
Copy link
Member

moritzraho commented Jul 22, 2020

Ok so did some research on this, vscode intellisense picks up the d.ts file if:

  • there is a types field in package.json pointing to the d.ts file OR if the d.ts file is in the same directory and has the same name as the main file => in this case src/index.d.ts
  • the d.ts file must use export instead of the declare keyword in the tsd-jsdoc generated file, see “declare class” vs “export class” englercj/tsd-jsdoc#90

the same applies to other repos where we use a d.ts file

will raise a PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants