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

The end-tag is inserted on an incorrect location #259

Open
gkwan-ibm opened this issue Nov 22, 2022 · 6 comments
Open

The end-tag is inserted on an incorrect location #259

gkwan-ibm opened this issue Nov 22, 2022 · 6 comments
Labels
bug Something isn't working with the product enhancement New feature or request

Comments

@gkwan-ibm
Copy link
Member

Tried to fix the webApplication tag by the suggested action

Screen Shot 2022-11-16 at 5 12 07 PM

the proposed close action, paste the closing </webApplication> end-tag incorrectly at line 57

Screen Shot 2022-11-16 at 5 19 51 PM

@scottkurz scottkurz added this to the EOY 2022 GA milestone Nov 23, 2022
@scottkurz scottkurz added the bug Something isn't working with the product label Nov 23, 2022
@scottkurz
Copy link
Member

@gkwan-ibm I'm having trouble recreating this.

Could you please explain the exact sequence in more detail ?

E.g.

  • what editor are you using to open server.xml? Generic Text Editor (I think this should be the default) or XML editor?
  • Did you type "<webApplication ...>" in full? Copy/paste? Or did you use completion code assist (e.g. on Mac Command+Space) to help fill in these values (in which case I think the tool would typically fill in the end tag along with the start tag)
  • Did you save at all?

I'm not even sure these are the exact best questions but I guess I'm just trying to think of what the relevant detail could be.

@gkwan-ibm
Copy link
Member Author

gkwan-ibm commented Nov 28, 2022

The server.xml contains the following:

    <webApplication contextRoot="${default.context.root}"
                    location="inventory.war">
        <application-bnd>
            <security-role name="admin">
                <group name="admin" />
            </security-role>
            <security-role name="user">
                <group name="user" />
            </security-role>
        </application-bnd>
    </webApplication>
  • Open it up with Generic Text Editor, remove </webApplication>, hover the mouse on the <webApplication ... tag as the following screenshot
    Screen Shot 2022-11-16 at 5 12 07 PM
  • click the Close with '</webApplication>' link
  • didn't use completion code assist

@gkwan-ibm
Copy link
Member Author

Tried to open the server.xml with Text Editor and XML Editior, both editors do not propose any action.

@gkwan-ibm
Copy link
Member Author

Just tried the completion code assist, I can see the end tag suggestion

Screen Shot 2022-11-28 at 5 08 40 PM

@scottkurz scottkurz removed this from the EOY 2022 Early Release Update milestone Dec 9, 2022
@scottkurz scottkurz added this to the 1Q23 update milestone Feb 17, 2023
@scottkurz scottkurz removed this from the 23.0.6 milestone Jun 13, 2023
@scottkurz
Copy link
Member

Just confirmed this issue still exists in v0.9.2 on top of 23-0.

It looks to me like we should open a Lemminx issue for this one. In Lemminx v0.23.0 I see this relevant stack trace in the debugger

ETagRequiredCodeAction(CloseTagCodeAction).doCodeActionsForStartTagClosed(DOMElement, DOMDocument, Range, Diagnostic, List<CodeAction>) line: 209	
ETagRequiredCodeAction(CloseTagCodeAction).doCodeAction(ICodeActionRequest, List<CodeAction>, CancelChecker) line: 58	
ContentModelCodeActionParticipant.doCodeAction(ICodeActionRequest, List<CodeAction>, CancelChecker) line: 51	
XMLCodeActions.doCodeActions(CodeActionContext, Range, DOMDocument, SharedSettings, CancelChecker) line: 60	
XMLLanguageService.doCodeActions(CodeActionContext, Range, DOMDocument, SharedSettings, CancelChecker) line: 260	
XMLTextDocumentService.lambda$codeAction$23(String, CodeActionParams, DOMDocument, CancelChecker) line: 476	

@scottkurz
Copy link
Member

scottkurz commented Jun 14, 2023

Opened eclipse/lemminx#1544 . Since this would require a lemminx enhancement, I labeled this as 'enhancement'.

@scottkurz scottkurz added the enhancement New feature or request label Jun 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working with the product enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants