Closed jdneo closed 3 years ago
It doesn't seem that comments in a method are correctly represented in the AST so I will change the code so that it doesn't delete the original node, and instead modifies it...
@karlvr The fix in selection
is tricky. Now I changed the the check condition to
const selection: Selection | undefined = window.activeTextEditor?.selection;
if (codeActions.length > 1 && document.uri === window.activeTextEditor?.document?.uri &&
selection && !selection.isEmpty && range.contains(selection)) {
....
}
codeActions.length > 1
- Make sure more than one code actions theredocument.uri === window.activeTextEditor?.document?.uri
- current editor is the same as that in the diagnosticselection && !selection.isEmpty
- selection is a rangerange.contains(selection)
- the range of the diagnostic contains the selectionStill have one problem in the Problem
panel. The code actions listed in the problem panel won't be updated until the document content is changed. So if it is generated with a range, users can see fix in selection
option, but when the cursor position changes, the options will still be there since the content is not changed so it will not get refreshed.
IMO, so far I think it's not a big deal, so I'll leave this behavior as a known issue. Once we address the issue about removing the comments, I'll release 1.4.0
@jdneo cool, I support that approach. I'll integrate it into my local build and take it for a spin! I haven't been able to make any progress on why the comment issue occurred. But the fix does appear to fix it.
There is a bug I've just found in the
MultipleVariableDeclarationsQuickFix
where it removes comments.e.g.