errata-ai / vale-vscode

A Visual Studio Code extension for the Vale CLI.
https://marketplace.visualstudio.com/items?itemName=errata-ai.vale-server
MIT License
53 stars 18 forks source link

Add a setting for where readability problems are displayed #110

Closed clang13 closed 2 years ago

clang13 commented 2 years ago

Readability problems (which affect the entire file, rather than a specific matched text) were moved from the inline problems list to the status bar in https://github.com/errata-ai/vale-vscode/pull/18.

That PR calls out that a setting to control this behavior might be desirable. I prefer to have the readability problems listed inline with all the other problems, so I don't have multiple places to check for a particular file.

This adds a new setting, vale.readabilityProblemLocation with three options:

Test plan:

  1. Configured .vale.ini with Readability.ColemanLiau = YES
  2. Copied violating Markdown file file from https://github.com/errata-ai/readability/blob/main/testdata/ColemanLiau/test.md.
  3. Verified behavior with these settings in settings.json: a. none, observed current behavior (problem in status bar) b. "vale.readabilityProblemLocation": "inline", observed problem reported inline c. "vale.readabilityProblemLocation": "status", observed current behavior (problem in status bar) d. "vale.readabilityProblemLocation": "both", observed problem reported both in status bar and inline
ChrisChinchilla commented 2 years ago

Thanks @clang13 I tested it and it works, I wonder if there's a way to get the change to not need a window reload at all? That's my only real comment, but even without that it works totally fine.

clang13 commented 2 years ago

I wonder if there's a way to get the change to not need a window reload at all?

Hmm. I don't think a reload is required for a change to take effect. I'm able to change the setting via the UI and it takes effect without a reload. I do need to re-save the text file in order to trigger a new scan, but I don't need to reload the window. Is that different from your experience?

I'm not sure if it would be easy to force a re-scan after a settings change, but I think the issue applies to all the extension settings, not just this one.

ChrisChinchilla commented 2 years ago

Hmm, maybe it was just because I was in dev mode, anyway, looks good to me, thanks @clang13 !