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

Surround with tags fails when there is no root element #1395

Closed
datho7561 opened this issue Dec 8, 2022 · 4 comments · Fixed by #1398
Closed

Surround with tags fails when there is no root element #1395

datho7561 opened this issue Dec 8, 2022 · 4 comments · Fixed by #1398
Assignees
Labels
bug Something isn't working
Milestone

Comments

@datho7561
Copy link
Contributor

eg.

<?xml version="1.0" encoding="UTF-8"?>
|

Trigger surround with tags at the |. (You can also reproduce the issue in an empty file).

In the logs, I get:

[Trace - 9:48:52 a.m.] Received response 'workspace/executeCommand - (77)' in 5ms. Request failed: undefined (-32001).
Error data: {}


[Error - 9:48:52 a.m.] Request workspace/executeCommand failed.
  Message: 
  Code: -32001 
[object Object]
@datho7561 datho7561 added the bug Something isn't working label Dec 8, 2022
@datho7561
Copy link
Contributor Author

It also seems to fail if the cursor is outside of the root element

@angelozerr
Copy link
Contributor

I think this issue is when you are using file association, no?

If you create a file without file association (without grammar linked), have you this issue?

@datho7561
Copy link
Contributor Author

I'll double check...

@datho7561
Copy link
Contributor Author

Yes, you are right. It only happens when the xml is associated with a grammar through a file association.

@datho7561 datho7561 self-assigned this Dec 8, 2022
@datho7561 datho7561 added this to the 0.23.0 milestone Dec 8, 2022
datho7561 added a commit to datho7561/lemminx that referenced this issue Dec 8, 2022
- Fill in grammar when invoking surround tag in an empty document
- Fix NPE that prevented surround tags from working
  in empty documents that are linked to a grammar with
  file association

Closes eclipse#1395

Signed-off-by: David Thompson <[email protected]>
datho7561 added a commit to datho7561/lemminx that referenced this issue Dec 8, 2022
- Fill in grammar when invoking surround tag in an empty document
- Fix NPE that prevented surround tags from working
  in empty documents that are linked to a grammar with
  file association

Closes eclipse#1395

Signed-off-by: David Thompson <[email protected]>
datho7561 added a commit to datho7561/lemminx that referenced this issue Dec 8, 2022
- Fill in grammar when invoking surround tag in an empty document
- Fix NPE that prevented surround tags from working
  in empty documents that are linked to a grammar with
  file association

Closes eclipse#1395

Signed-off-by: David Thompson <[email protected]>
datho7561 added a commit to datho7561/lemminx that referenced this issue Dec 8, 2022
- Fill in grammar when invoking surround tag in an empty document
- Fix NPE that prevented surround tags from working
  in empty documents that are linked to a grammar with
  file association

Closes eclipse#1395

Signed-off-by: David Thompson <[email protected]>
datho7561 added a commit to datho7561/lemminx that referenced this issue Dec 8, 2022
- Fill in grammar when invoking surround tag in an empty document
- Fix NPE that prevented surround tags from working
  in empty documents that are linked to a grammar with
  file association

Closes eclipse#1395

Signed-off-by: David Thompson <[email protected]>
angelozerr pushed a commit that referenced this issue Dec 8, 2022
- Fill in grammar when invoking surround tag in an empty document
- Fix NPE that prevented surround tags from working
  in empty documents that are linked to a grammar with
  file association

Closes #1395

Signed-off-by: David Thompson <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants