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

analyzer class issues #1556

Open
aomarks opened this issue Jun 1, 2017 · 5 comments
Open

analyzer class issues #1556

aomarks opened this issue Jun 1, 2017 · 5 comments

Comments

@aomarks
Copy link
Member

aomarks commented Jun 1, 2017

Found some issues with the analyzer output for classes in the Polymer 2.0 core library:

$ git clone [email protected]:Polymer/polymer
$ cd polymer
$ polymer analyze > analysis.json
  1. The Debouncer class (https://github.com/Polymer/polymer/blob/master/lib/utils/debounce.html) is in top level classes, but I expected it to be in namespaces.Polymer.classes. Interesting that it has a @memberof Polymer annotation. The only class that does make it into the Polymer namespace is FlattenedNodesObserver (https://github.com/Polymer/polymer/blob/master/lib/utils/flattened-nodes-observer.html) and it does not have that annotation.

  2. The description for Debouncer is eslint-disable-line no-unused-vars, which is a standalone comment on the line before the class declaration. The class declaration has no jsdoc block.

  3. There's a top-level public class with no name from https://github.com/Polymer/polymer/blob/master/lib/utils/templatize.html. Line 46 is actually just a comment, so I wonder if there's also an issue with source offset?

    {
      "description": "",
      "summary": "",
      "path": "lib/utils/templatize.html",
      "properties": [],
      "methods": [],
      "demos": [],
      "metadata": {},
      "sourceRange": {
        "start": {
          "line": 46,
          "column": 41
        },
        "end": {
          "line": 46,
          "column": 49
        }
      },
      "privacy": "public"
    },
  1. There are 2x top-level public klass classes generated again from https://github.com/Polymer/polymer/blob/master/lib/utils/templatize.html.
@rictic
Copy link
Contributor

rictic commented Jun 1, 2017

Hm, 1, 3, and 4 seem like bugs. #2 strikes me as working as intended, and the solution is to write a line or two of documentation for the Debouncer class.

@aomarks
Copy link
Member Author

aomarks commented Jun 1, 2017

On #2, the comment seems fairly clearly not attached to the class declaration because it's an end of line comment for another symbol's declaration, and also there's a line break inbetween:

  let AsyncModule; // eslint-disable-line no-unused-vars

  class Debouncer {

https://github.com/Polymer/polymer/blob/master/lib/utils/debounce.html

@web-padawan
Copy link
Contributor

web-padawan commented Jun 8, 2017

I confirm that placing the block ending with comment causes error in #674:

/* eslint-disable camelcase */
var DESTINATION_MAP = {
    google_analytics: 'selectAnalyticsAccess',
    click_house: 'selectClickHouseAccess'
};
/* eslint-enable camelcase */

Polymer({
    is: 'my-element',

So, analyzer treats eslint comments as meaningful, which produces a LOT of output (all of the element code gets printed to console and underlined, oops).

This bug does not exist as of [email protected].

@aomarks aomarks self-assigned this Jun 8, 2017
@homerjonathan
Copy link

homerjonathan commented Jun 16, 2017

I have also had commenting errors.

ScannedPolymerElement has both HTML doc and JSDoc comments.

I managed to remove the errors I have this at the top

<!--
   Top Documentation
->

Then in the <script> section I have

// Script Notes

This returns the above error. Remove the line with two forward slashes comments, and it no longer shows the errors.

@aomarks aomarks removed their assignment May 1, 2018
@aomarks aomarks transferred this issue from Polymer/polymer-analyzer Jan 3, 2019
@stale
Copy link

stale bot commented Mar 3, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Mar 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants