Skip to content

Commit

Permalink
Disable snippet in code action (see #185)
Browse files Browse the repository at this point in the history
  • Loading branch information
angelozerr committed Nov 2, 2018
1 parent 5da726f commit 4b0db9c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public void doCodeAction(Diagnostic diagnostic, Range range, XMLDocument documen
}

} catch (BadLocationException e) {
// DO nothing
// Do nothing
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import org.eclipse.lsp4xml.settings.XMLFormattingOptions;

/**
* Code action to fix cvc-complex-type.2.3 error.
* Code action to fix cvc-complex-type.4 error.
*
*/
public class cvc_complex_type_4CodeAction implements ICodeActionParticipant {
Expand All @@ -54,7 +54,9 @@ public void doCodeAction(Diagnostic diagnostic, Range range, XMLDocument documen
.filter(cmAttr -> !element.hasAttribute(cmAttr.getName())) //
.collect(Collectors.toList());

XMLGenerator generator = new XMLGenerator(null, "", "", true, 0);
// CodeAction doesn't support snippet -> https://github.com/Microsoft/language-server-protocol/issues/592
boolean supportSnippet = false;
XMLGenerator generator = new XMLGenerator(null, "", "", supportSnippet, 0);
String xmlAttributes = generator.generate(requiredAttributes, element.getTagName());

// Insert required attributes
Expand Down

0 comments on commit 4b0db9c

Please sign in to comment.