mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 11:08:51 +01:00
only select diagnostics that are contained by the code action range
This commit is contained in:
@@ -283,13 +283,13 @@ class QuickFixAdapter {
|
||||
provideCodeActions(resource: URI, range: IRange): TPromise<modes.Command[]> {
|
||||
|
||||
const doc = this._documents.getDocumentData(resource).document;
|
||||
const ran = TypeConverters.toRange(range);
|
||||
const ran = <vscode.Range>TypeConverters.toRange(range);
|
||||
const allDiagnostics: vscode.Diagnostic[] = [];
|
||||
|
||||
this._diagnostics.forEach(collection => {
|
||||
if (collection.has(resource)) {
|
||||
for (let diagnostic of collection.get(resource)) {
|
||||
if (diagnostic.range.intersection(ran)) {
|
||||
if (ran.contains(diagnostic.range)) {
|
||||
allDiagnostics.push(diagnostic);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user