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

Add support for linting while typing #151

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

nobodywasishere
Copy link
Contributor

@nobodywasishere nobodywasishere commented Nov 28, 2024

  • Adds settings crystal-ameba.lint-trigger:
    • none: linting will always be triggered automatically by commands
    • save: linting is only triggered when saving
    • type: linting is run for the current file every time there's a change
  • Defaults to type unless ameba is < 1.6.4

Resolves #89

Added configuration option `lint-trigger` which defaults to save or type depending on the current version of ameba in use.
This will also lint untitled files that aren't saved to disk.
src/extension.ts Outdated Show resolved Hide resolved
src/extension.ts Outdated Show resolved Hide resolved
src/extension.ts Outdated Show resolved Hide resolved
src/configuration.ts Show resolved Hide resolved
src/ameba.ts Outdated Show resolved Hide resolved
@Sija
Copy link
Member

Sija commented Nov 29, 2024

Aside of my other comments, I'm wondering is this change really needed?

@nobodywasishere
Copy link
Contributor Author

Yes? This was the entire purpose of me creating this series of PRs (and adding stdin support to ameba), to allow for running the ameba linter while typing, which significantly improves the development experience.

nobodywasishere and others added 5 commits November 29, 2024 17:03
Co-authored-by: Sijawusz Pur Rahnama <[email protected]>
Co-authored-by: Sijawusz Pur Rahnama <[email protected]>
Co-authored-by: Sijawusz Pur Rahnama <[email protected]>
Co-authored-by: Sijawusz Pur Rahnama <[email protected]>
Co-authored-by: Sijawusz Pur Rahnama <[email protected]>
@Sija
Copy link
Member

Sija commented Nov 30, 2024

@nobodywasishere My bad, I was unclear (writing on mobile...), what I really meant to ask was: why switching to enum instead of multiple choice is needed?

@nobodywasishere
Copy link
Contributor Author

Ahh okay. In my opinion, having the enum is much clearer about what is happening. Having both an "on type" and "on save" setting may get confusing, especially since there's no way to support the case of "on save" being false and "on type" being true.

@Sija
Copy link
Member

Sija commented Nov 30, 2024

I've checked other, similar-type-of extensions and they're doing the same thing (enum), so it seems that's just the way the cookie crumbles.

src/ameba.ts Outdated Show resolved Hide resolved
@Sija
Copy link
Member

Sija commented Nov 30, 2024

There are some errors that needs fixing, otherwise seems GTG.

@Sija Sija added the enhancement New feature or request label Nov 30, 2024
src/extension.ts Show resolved Hide resolved
src/extension.ts Outdated Show resolved Hide resolved
src/extension.ts Show resolved Hide resolved
src/extension.ts Outdated Show resolved Hide resolved
src/ameba.ts Outdated Show resolved Hide resolved
src/ameba.ts Outdated Show resolved Hide resolved
Co-authored-by: Sijawusz Pur Rahnama <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add option to lint while typing instead of waiting for file save
2 participants