rust-analyzer/editors/code/src/commands
Ryan Cumming abc0784e57 Fix cargo watch code action filtering
There are two issues with the implementation of `provideCodeActions`
introduced in #1439:

1. We're returning the code action based on the file its diagnostic is
   in; not the file the suggested fix is in. I'm not sure how often
   fixes are suggested cross-file but it's something we should handle.

2. We're not filtering code actions based on the passed range. The means
   if there is any suggestion in a file we'll show an action for every
   line of the file. I naively thought that VS Code would filter for us
   but that was wrong.

Unfortunately the VS Code `CodeAction` object is very complex - it can
handle edits across multiple files, run commands, etc. This makes it
complex to check them for equality or see if any of their edits
intersects with a specified range.

To make it easier to work with suggestions this introduces a
`SuggestedFix` model object and a `SuggestFixCollection` code action
provider. This is a layer between the raw Rust JSON and VS Code's
`CodeAction`s. I was reluctant to introduce another layer of abstraction
here but my attempt to work directly with VS Code's model objects was
worse.
2019-06-29 17:39:36 +10:00
..
analyzer_status.ts align command naming 2019-01-28 15:01:22 +03:00
apply_source_change.ts Prettier fix 2019-01-15 11:15:51 -05:00
cargo_watch.ts Fix cargo watch code action filtering 2019-06-29 17:39:36 +10:00
index.ts switch to official extend selection API 2019-04-21 12:13:48 +03:00
join_lines.ts align command naming 2019-01-28 15:01:22 +03:00
line_buffer.ts Add cargo-watch.check-arguments 2019-04-02 15:03:31 +08:00
matching_brace.ts align command naming 2019-01-28 15:01:22 +03:00
on_enter.ts align command naming 2019-01-28 15:01:22 +03:00
parent_module.ts align command naming 2019-01-28 15:01:22 +03:00
runnables.ts start cargo watch if not started interactively 2019-04-19 20:54:36 +02:00
syntaxTree.ts Rename syntaxtree text provider to SyntaxTreeContentProvider 2019-03-03 22:02:19 +02:00
watch_status.ts Fix code after "apply suggestions" 2019-06-24 13:50:34 +03:00