-
Notifications
You must be signed in to change notification settings - Fork 14
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
Avoid processing unknown XML documents #75
Conversation
Instead of passing directly the Document to the services, the parsed XmlDocument is passed now.
Now the full parsing is done only if the document is supported
@@ -8,3 +8,4 @@ pytest-mock | |||
flake8 | |||
flake8-bugbear | |||
black | |||
lxml-stubs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where is this needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not really needed, but it is really useful in development for getting linting and auto-completion in the IDE with lxml
. They are just external type annotations since the lxml
is mostly compiled code and can not be directly used by the static type linter. I found it here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, this is nifty thanks for sharing.
This PR detects the type of XML document when a request is received by the server and, if the XML is not one of the supported types (
tool
andmacros
at the moment), further processing of the request is ignored. This fixes some false positives when you are working with different kinds of XML documents and the Galaxy Language Server is installed since the server will not try to validate (or use any other galaxy tool-related feature) those files.Some refactoring was needed to simplify and unify the way XML documents are processed by some of the services. Also, additional tests were added.
This fixes #74