Skip to content
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

Merged
merged 8 commits into from
Dec 18, 2020
Merged

Avoid processing unknown XML documents #75

merged 8 commits into from
Dec 18, 2020

Conversation

davelopez
Copy link
Collaborator

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 and macros 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

@davelopez davelopez added bug Something isn't working language server Related to the language server vscode extension Related to the VS Code extension paper-cut A trivially fixable usability bug labels Dec 17, 2020
Now the full parsing is done only if the document is supported
@@ -8,3 +8,4 @@ pytest-mock
flake8
flake8-bugbear
black
lxml-stubs
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where is this needed?

Copy link
Collaborator Author

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

Copy link
Member

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.

@davelopez davelopez merged commit 5f15992 into master Dec 18, 2020
@davelopez davelopez deleted the fix-#74 branch December 18, 2020 12:55
@davelopez davelopez added this to the v0.3.0 milestone Jan 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working language server Related to the language server paper-cut A trivially fixable usability bug vscode extension Related to the VS Code extension
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Avoid further processing when the XML file is not related to a tool wrapper file
2 participants