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

Commas are generating warnings #347

Closed
funder7 opened this issue Jun 10, 2020 · 3 comments
Closed

Commas are generating warnings #347

funder7 opened this issue Jun 10, 2020 · 3 comments
Assignees
Labels

Comments

@funder7
Copy link

funder7 commented Jun 10, 2020

Describe the bug
When opening a JDL in VS Code, a comma inside of a comment will cause a warning to show up with "Useless commas can be removed" as the cause.
Exporting a JDL with the jhipster export-jdl command, generates comma separated fields in entities, and fields are highlighted as warnings too (same reason).

To Reproduce
Steps to reproduce the behavior:

  1. Create a JDL file
  2. Create two entities
  3. First entity: create two fields, separating them with a comma
  4. Second entity: create two fields, without the comma separating them
  5. Add a JavaDoc comment for each field, containing commas
  6. Add a normal comment (//) containing commas
  7. Comma separated fields will be highlighted as warning
  8. JavaDoc comments containing commas will be highlighted as warning

Expected behavior

  • Comments containing commas must never be highlighted as a warning
  • If fields must not be comma separated, then jhipster-generator should not export JDL files like that.
  • As the JDL seems to work with comma separated fields, letting the user choose to use them or not could be a solution.

Screenshots
immagine
Different situations that are causing warnings to show up (or not)

Desktop (please complete the following information):

  • OS: elementaryOS 5.1 (ubuntu 19.04 LTS based)
  • VS Code: 1.45.1
  • VS Code JHipster JDL extension : 2.2.0

Additional info
I suppose that comments are being parsed with the same rule-check used for comma separated fields. That souldn't happen!

@colameo colameo self-assigned this Jun 10, 2020
@colameo colameo added the bug label Jun 10, 2020
@colameo
Copy link
Member

colameo commented Jun 10, 2020

thanks for reporting this! will be fixed in the next release.

@colameo
Copy link
Member

colameo commented Jun 10, 2020

so it's fixed:

Screenshot 2020-06-10 at 22 26 39

however, if a comma appears in one field definition all fields are marked (note the last field with comments):
Screenshot 2020-06-10 at 22 27 46

please note that you can also disable linting warnings by putting at the very first line of your JDL a comment as follows:

// no-linting

or

// lint = false

one more thing, do not use commas as they will be removed in the near future (see also)

colameo added a commit that referenced this issue Jun 10, 2020
@colameo colameo closed this as completed Jun 13, 2020
colameo added a commit that referenced this issue Jun 15, 2020
* migration
* solves #347
* versioning
* fixed version and deps. fixed an npe
@funder7
Copy link
Author

funder7 commented Jun 15, 2020

That's a fast fix! :-)

I think that if commas will be removed in the next release, then there will be introduced a new warning telling to not use them in field definitions, so that would solve the last problem you reported.

But disabling linting wouldn't disable it for all rules?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants