-
Notifications
You must be signed in to change notification settings - Fork 10
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
feature: add bad characters to the problems pane. closes #2 #27
base: master
Are you sure you want to change the base?
Conversation
@WengerK, if you have the chance to review this PR it would be nice! |
Hey Many Many thanks for you awesome contrib ! I'm waiting on #22 to be merged before, if it's okay for you ?! We also should consider adding tests for the problems pane :) we recently had a "major" regression with all tabs to be highlighted :) I'd like to have a covering of feature to prevent futur issue of this kind ^^' |
It's perfect to me, I was just making sure you were aware of this PR 👍. Have a nice day and thanks for the response! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for doing this! It's a great PR, just a couple of minor changes :)
back merge master here to run tests & linter |
@WengerK, I'm having a problem passing the tests you wrote, it always fails with: TypeError: Cannot read property 'Error' of undefined
38 | break;
39 | default:
> 40 | errorSeverity = vscode.DiagnosticSeverity.Error;
| ^
41 | break;
42 | }
43 |
at loadConfiguration (src/extension.ts:40:55)
at activate (src/extension.ts:64:18)
at Object.<anonymous> (test/extension.test.ts:168:9) I tried adding the following lines with no luck so far: diff --git a/test/extension.test.ts b/test/extension.test.ts
index 3f6f533..e3788aa 100644
--- a/test/extension.test.ts
+++ b/test/extension.test.ts
@@ -1,5 +1,5 @@
-import type {DecorationRenderOptions} from 'vscode';
-import {contributes} from '../package.json';
+import type { DecorationRenderOptions, DiagnosticSeverity } from 'vscode';
+import { contributes } from '../package.json';
const configDefinition = contributes.configuration;
export type ExtensionConfig = {
@@ -7,6 +7,7 @@ export type ExtensionConfig = {
additionalUnicodeChars?: string[],
allowedUnicodeChars?: string[],
asciiOnly?: boolean,
+ errorSeverity?: DiagnosticSeverity,
};
/**
@@ -129,12 +130,14 @@ beforeEach(() => {
const allowedUnicodeChars = configDefinition.properties['highlight-bad-chars.allowedUnicodeChars'].default;
const badCharDecorationStyle = configDefinition.properties['highlight-bad-chars.badCharDecorationStyle'].default;
const asciiOnly = configDefinition.properties['highlight-bad-chars.asciiOnly'].default;
+ const errorSeverity = configDefinition.properties['highlight-bad-chars.severity'].default;
mockConfiguration = {
additionalUnicodeChars,
allowedUnicodeChars,
badCharDecorationStyle,
asciiOnly,
+ errorSeverity,
};
}); diff --git a/src/extension.ts b/src/extension.ts
index 29205d5..453c74a 100644
--- a/src/extension.ts
+++ b/src/extension.ts
@@ -8,6 +8,7 @@ export type ExtensionConfig = {
additionalUnicodeChars?: string[],
allowedUnicodeChars?: string[],
asciiOnly?: boolean,
+ errorSeverity?: vscode.DiagnosticSeverity,
};
function loadConfiguration(): { Could you give me a hand? |
I'll have some spare.time next week, I'll take a look |
b07dbc0
to
c13fc67
Compare
coverage added @puka-tchou. I let you re-ping me whenever the PR is ready for testing/merging. |
It is, feel free to review and merge whenever you feel like it @WengerK (and @ItalyPaleAle too I guess) 🎆 |
c13fc67
to
c624907
Compare
I'd like to have the review of @ItalyPaleAle before merging :) Many thanks for your contrib by the way 🚀 |
Hey folks, I'm on vacation this week. Will take a look next week! |
Thanks again for doing this @puka-tchou! I think this PR looks great and I'm fine with it being merged. The only question that comes to me now, and it's more of a question for @WengerK , is if at this point we should stop using decorators and just rely on the problem reporting? Example:
What do you think? |
It's a good point. I don't know. What about having a toggle for both feature ? |
I think that's a good idea. My vote (but it's your extension so you have final say) is on keeping them both on by default but making the red squares something that can be disabled. This way we introduce the new, improved format but also maintain consistency for existing users. |
I agree. I'm in favor of having gracefull enhancment, for existint user toggler for the New feature goes in this direction. @puka-tchou would you add this new config (with readme changes) ? |
I do agree but I think it's beyond the scope of this PR. Adding this new configuration option means changing the README, the code and the tests to make sure everything is OK. |
Actually, as I worked on #29, I want to take back my comments. I don't think we should offer an option to disable the red boxes. When there are zero-width characters, having the red boxes (lines, in this case) is much better: |
Well, if everything is OK for you, I would love to finally merge this :) |
I'll work on it tuesday. I think we should:
|
I did not get the chance to work on it unfortunatelly, critical issues got priorities over this. |
Hey @WengerK, I just updated the README. The image is broken for now but it will work once merged. I don't feel the need to allow to enable or disable the problems pane feature as you can filter what you see in the problem pane : Here is the image that I added in the README: I am starting to feel that this PR is taking too much time and I fear that I'm gonna lose interest in keeping it up-to-date, so the faster it's merged, the better. However, this is your repo and your call, so feel free to keep updating the PR! |
You can fix images by making all links relative (which is actually better). For example, from:
To:
|
This PR adds the bad characters to the problem pane. I hope you'll find it useful.
There are some bugs that I don't have the time to fix right now but I'll try to update this PR quickly:
Consider this a WIP and contribute to it if you want to speed it up!