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

Fuzzy Element name codeaction #591

Merged
merged 1 commit into from
Nov 22, 2019

Conversation

NikolasKomonen
Copy link
Contributor

Fixes #589

Refer to #589 for code to test

Signed-off-by: Nikolas Komonen [email protected]

@NikolasKomonen
Copy link
Contributor Author

@angelozerr Thanks for your implementation, I used it but had to do some modifications since the order of the CMElementDeclarations was not idempotent and tests would fail. Instead the codeactions will be in order of the element names.

@angelozerr
Copy link
Contributor

@NikolasKomonen your PR works great but not with prefix.

Given this XML file:

<beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:camel="http://camel.apache.org/schema/spring"
        xsi:schemaLocation="
           http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
           http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
    
    <camel:bea></camel:bea>
</beans>

You should have code action (similar code action with camel:bean).

Given this XML file:

<beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:camel="http://camel.apache.org/schema/spring"
        xsi:schemaLocation="
           http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
           http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
    
    <camel:XXXXX></camel:XXXXX>
</beans>

You should have a list of code action.

@NikolasKomonen NikolasKomonen force-pushed the fuzzyCodeAction branch 2 times, most recently from b68fc68 to 655e17c Compare November 11, 2019 19:38
@angelozerr
Copy link
Contributor

Sorry @NikolasKomonen my sample was not relevant. You provide bean and beans although it should provide only bean. I think you provide bean coming from spring but not from camel.

Given this XML file:

<beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:camel="http://camel.apache.org/schema/spring"
        xsi:schemaLocation="
           http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
           http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
    
    <camel:beani></camel:beani>
</beans>

You should see Did you mean camel:beanio ?

Handles regular element names and ones with prefixes

Fixes eclipse-lemminx#589

Refer to eclipse-lemminx#589 for code to test

Signed-off-by: Nikolas Komonen <[email protected]>
@NikolasKomonen
Copy link
Contributor Author

@angelozerr updated to work with 2 namespaces, will only provide codeactions for elements in the current namespace.

@angelozerr
Copy link
Contributor

It works like a charm @NikolasKomonen great job!

@angelozerr angelozerr merged commit 7e49c1c into eclipse-lemminx:master Nov 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CodeAction for cvc-complex-type.2.4.a
2 participants