-
-
Notifications
You must be signed in to change notification settings - Fork 932
Closed
Labels
C-bugCategory - BugCategory - Bug
Description
test('extension is not outdated when there is no local and gallery', () => {
const extension = instantiationService.createInstance(Extension, () => ExtensionState.Installed, () => undefined, undefined, undefined, undefined, undefined);
assert.strictEqual(extension.outdated, false);
});
Our fixer needs to run twice to fix this, tested on unicorn/no-useless-undefined, it needs once.
Why our fixer need to run twice
if i64::from(start) <= last_pos {
return;
}https://github.com/oxc-project/oxc/blob/main/crates/oxc_linter/src/fixer.rs#L278
I found that span is an interval that is closed on the left and open on the right. It should not be <=, which will cause the continuous interval to be skipped. It should be <.
The test case has to be modified to allow continuous interval modification, but I found that it will cause no_useless_escape test failure
https://github.com/oxc-project/oxc/blob/main/crates/oxc_linter/src/fixer.rs#L520
const REMOVE_START: Fix = Fix::delete(Span::new(0, 4));
const REPLACE_ID: Fix = Fix { span: Span::new(4, 10), content: Cow::Borrowed("foo") };
fn apply_two_fix_when_the_start_the_same_as_the_previous_end() {
let result = get_fix_result(vec![
create_message(remove_start(), Some(REMOVE_START)),
create_message(replace_id(), Some(REPLACE_ID)),
]);
assert_eq!(result.fixed_code, TEST_CODE.replace("var answer", "foo"));
assert!(result.fixed);
}Originally posted by @cblh in #4079 (comment)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
C-bugCategory - BugCategory - Bug
Type
Fields
Give feedbackPriority
None yet