-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple insert required attribute
code actions shown when multiple attributes are missing
#209
Comments
@fbricon I don't know how to fix this issues, because it seems that it's a LSP issues. Indeed in your case, you have 2 diagnostics "cvc-complex-type.4" with the same "code" (but for each missing attributes): {
"jsonrpc": "2.0",
"method": "textDocument/publishDiagnostics",
"params": {
"uri": "product.xml",
"diagnostics": [{
"range": {
"start": {
"line": 6,
"character": 5
},
"end": {
"line": 6,
"character": 12
}
},
"severity": 1,
"code": "cvc-complex-type.4",
"source": "xml",
"message": "cvc-complex-type.4: Attribute \u0027price\u0027 must appear on element \u0027product\u0027."
},
{
"range": {
"start": {
"line": 6,
"character": 5
},
"end": {
"line": 6,
"character": 12
}
},
"severity": 1,
"code": "cvc-complex-type.4",
"source": "xml",
"message": "cvc-complex-type.4: Attribute \u0027description\u0027 must appear on element \u0027product\u0027."
}
]
}
} LSP call for each diangnostics a code action (you have 2 requesest) and the lsp4xml server returns a response per request. An uggly fix that I have in my mind, is to generate only one "cvc-complex-type.4-ALL" diagnostic and map code action in this cvc-complex-type.4-ALL (what do you think about this idea?) |
Im going to implement this by having a single code action insert all missing attributes |
Fixes eclipse-lemminx#209 Signed-off-by: Nikolas <[email protected]>
Fixes eclipse-lemminx#209 Signed-off-by: Nikolas <[email protected]>
Fixes #209 Signed-off-by: Nikolas <[email protected]>
Given an xml document:
with an invoice.xsd:
missing both attributes on the product tag generates duplicate code actions:
There are as many code actions as there are missing attributes. The server should not send duplicates
The text was updated successfully, but these errors were encountered: