Comments (9)
@angelozerr The XMLLocator does not have any chance to get a correct position for certain cases since the error can be determined after the locator has passed the token it needs the location information for.
Did you have an idea on how to handle this?
A possible solution is to use the XMLDocument and guess the node from the values we have.
from lemminx.
Indeed @NikolasKomonen see https://github.com/angelozerr/lsp4xml/blob/master/org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/contentmodel/participants/diagnostics/XMLSyntaxErrorCode.java#L83 how I have started to fix it. It avoids parsing XMLDocument but perhaps it's a bad idea?
from lemminx.
A possible solution is to use the XMLDocument and guess the node from the values we have.
I have started to experiment your idea. If it's working, I will commit my work. Please wait before continue this issue.
from lemminx.
@angelozerr Alright, I have the previous implementation done but there are some minor problems with it. Hopefully your experimenting works.
from lemminx.
@NikolasKomonen you can now continue to work on this issue. I have cleaned XML diagnostics test (you will see that it's more readable).
Now I'm based on XMLDocument to adjust errors. Tell me if you like it and I think it improves the adjust.
from lemminx.
@NikolasKomonen just to say you, that I'm using https://github.com/kingargyle/wtp-sourceediting/blob/008173496f087062264ff4c77da2e7fdc36340c9/plugins/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/eclipse/XMLMessageInfoHelper.java to know which selection I must do according the error code (select attribute value, name, etc)
from lemminx.
@NikolasKomonen once you have implemented an adjust error code, it should be cool that you have the same sample that you are using in JUNit in a given file like https://github.com/angelozerr/lsp4xml/tree/master/org.eclipse.lsp4xml/src/test/resources/validation/syntax
It will help us in the future to see the result in the editor (to avoid searching again a sample)
from lemminx.
@angelozerr Do you have a recommendation on how you would want to enable multiple error ranges to be sent?
For certain cases like ETagRequired and ETagUnterminated we need to have multiple ranges. I think that it would be better to have toLSPRange return an array of Ranges instead.
from lemminx.
For certain cases like ETagRequired and ETagUnterminated we need to have multiple ranges. I think that it would be better to have toLSPRange return an array of Ranges instead.
Yes we should do that and create a Diagnostic instances per range, because LSP Diagnostic has just one range.
from lemminx.
Related Issues (20)
- `IRenameParticipant.doRename()` is not conform with LSP-defined rename result
- Could CloseTagCodeAction offer option to close and result with an empty element. HOT 3
- Request to bump LSP4J version 0.20.1 to 0.21.0 HOT 2
- PrepareRename/Rename Server Capabilities doesn't work with non dynamic registration HOT 2
- Last updates breaks pretext-tools in codespaces HOT 13
- Implement itemDefaults for CompletionList HOT 1
- Provide a Progress support API for lemminx extension
- Completion should not generate the end tag if it exists an orphan end tag
- CodeAction to generate start tag when it exists an orphan end tag
- possible cache escape HOT 9
- Let the user maintain a list of trusted hosts or resources. HOT 1
- Cannot download lemminx dependency 0.20.0 - 4.0.3 HOT 7
- Set root of document tree for XML references
- LemMinX illegally invokes `client/unregisterCapability` with empty arguments upon startup HOT 2
- SecurityException during native image compilation HOT 1
- XMLHover.getTextHover() shouldn't log CancellationExceptions HOT 1
- Getting Internal Error for "textDocument/codeAction" request HOT 5
- Document cache HOT 2
- Allow completion participants to suggest completion items inside CDATA blocks
- Cannot get didChange with incremental changes to work HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lemminx.