Allow using a different source range for suggestions than the error message (#5442)

Signed-off-by: Nick Cameron <nrc@ncameron.org>
This commit is contained in:
Nick Cameron
2025-02-22 18:55:44 +13:00
committed by GitHub
parent cbc12559c7
commit 57f7d022ca
5 changed files with 33 additions and 17 deletions

View File

@ -285,7 +285,11 @@ export function complilationErrorsToDiagnostics(
name: suggestion.title,
apply: (view: EditorView, from: number, to: number) => {
view.dispatch({
changes: { from, to, insert: suggestion.insert },
changes: {
from: suggestion.source_range[0],
to: suggestion.source_range[1],
insert: suggestion.insert,
},
})
},
},