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

Symbol outline / search: Customizable display text #220

Closed
photasm opened this issue Jan 16, 2020 · 4 comments · Fixed by #346
Closed

Symbol outline / search: Customizable display text #220

photasm opened this issue Jan 16, 2020 · 4 comments · Fixed by #346
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@photasm
Copy link

photasm commented Jan 16, 2020

It would be nice to have the option to customize how symbol outline / search will be displayed.
This could be done by using the attribute on the displayed element.

<Element1>
  <Element2 id="id1" />
   <Element2 id="id2" />
   <Element2 id="id3" />
</Element1>

In my case my symbol outline looks like this:

Element1
--Element2
--Element2
--Element2

It would be nice, if it could look sth like this:

Element1
--Element2 (id1)
--Element2 (id2)
--Element2 (id3)

Thx. :)

@photasm photasm changed the title Symbol outline / search: Customizable text Symbol outline / search: Customizable display text Jan 16, 2020
@angelozerr
Copy link
Contributor

@photasm indeed it should be nice. The main reason why we have not implemented that is that when XML is too big, outline crashes the vscode.

But since we have added a symbol settings to disable it, I think it's a good idea to add a new settings to add attributes in the outline.

@photasm
Copy link
Author

photasm commented Jan 16, 2020

Great, thank you in advance.

@bmix
Copy link

bmix commented Feb 15, 2020

I would like to expand on that. There should be several attributes to configure, which get tested for in sequence.

@id, @title, @name, @class are good candidates. If none of them is available, the start of the text node could be shown.

@fbricon fbricon added the enhancement New feature or request label Oct 7, 2020
angelozerr pushed a commit to angelozerr/vscode-xml that referenced this issue Oct 14, 2020
See redhat-developer#220

Signed-off-by: azerr <azerr@redhat.com>
@angelozerr
Copy link
Contributor

I did a quick POC for this issue.

Given the test.xml XML file:

<Element1>
  <Element2 id="id1" />
   <Element2 id="id2" />
   <Element2 id="id3" name="name3"/>
   <Element2>ABCD</Element2>
</Element1>

we want to show :

  • all text node (ABCD in this case)
  • only @id attribute (not @name)

image

To manage this configuration, I introduce a new settings xml.symbols.filters:

 "xml.symbols.filters": [
      {
         "pattern": "test.xml",
         "expressions" :[
            {
               "xpath": "//text()",
               "excluded": false
            },
            {
               "xpath": "//@id",
               "excluded": false
            }
         ]
      }
   ]
  • pattern means that filters are apply only for file name which match the pattern.
  • expressions are a list of xpath node to include or exclude.

Any feedback are welcome!

angelozerr pushed a commit to angelozerr/vscode-xml that referenced this issue Oct 23, 2020
Fixes redhat-developer#220

Signed-off-by: azerr <azerr@redhat.com>
angelozerr pushed a commit to angelozerr/lemminx that referenced this issue Oct 23, 2020
angelozerr pushed a commit to angelozerr/vscode-xml that referenced this issue Oct 23, 2020
Fixes redhat-developer#220

Signed-off-by: azerr <azerr@redhat.com>
angelozerr pushed a commit to angelozerr/vscode-xml that referenced this issue Oct 23, 2020
Fixes redhat-developer#220

Signed-off-by: azerr <azerr@redhat.com>
angelozerr pushed a commit to angelozerr/vscode-xml that referenced this issue Oct 23, 2020
Fixes redhat-developer#220

Signed-off-by: azerr <azerr@redhat.com>
angelozerr pushed a commit to angelozerr/vscode-xml that referenced this issue Oct 23, 2020
Fixes redhat-developer#220

Signed-off-by: azerr <azerr@redhat.com>
angelozerr pushed a commit to angelozerr/lemminx that referenced this issue Oct 25, 2020
angelozerr pushed a commit to angelozerr/lemminx that referenced this issue Oct 25, 2020
angelozerr pushed a commit to angelozerr/lemminx that referenced this issue Oct 25, 2020
angelozerr pushed a commit to angelozerr/lemminx that referenced this issue Oct 25, 2020
angelozerr pushed a commit to angelozerr/lemminx that referenced this issue Oct 25, 2020
angelozerr pushed a commit to angelozerr/lemminx that referenced this issue Oct 25, 2020
angelozerr pushed a commit to angelozerr/lemminx that referenced this issue Oct 25, 2020
angelozerr pushed a commit to angelozerr/vscode-xml that referenced this issue Oct 25, 2020
Fixes redhat-developer#220

Signed-off-by: azerr <azerr@redhat.com>
angelozerr pushed a commit to angelozerr/lemminx that referenced this issue Oct 25, 2020
angelozerr pushed a commit to angelozerr/lemminx that referenced this issue Oct 25, 2020
angelozerr pushed a commit to angelozerr/lemminx that referenced this issue Oct 25, 2020
angelozerr pushed a commit to angelozerr/lemminx that referenced this issue Oct 25, 2020
angelozerr pushed a commit to angelozerr/vscode-xml that referenced this issue Oct 26, 2020
Fixes redhat-developer#220

Signed-off-by: azerr <azerr@redhat.com>
@angelozerr angelozerr added this to the 0.14.0 milestone Oct 26, 2020
angelozerr pushed a commit to angelozerr/vscode-xml that referenced this issue Oct 26, 2020
Fixes redhat-developer#220

Signed-off-by: azerr <azerr@redhat.com>
angelozerr pushed a commit to angelozerr/vscode-xml that referenced this issue Oct 26, 2020
Fixes redhat-developer#220

Signed-off-by: azerr <azerr@redhat.com>
angelozerr pushed a commit to angelozerr/lemminx that referenced this issue Oct 26, 2020
angelozerr pushed a commit to angelozerr/lemminx that referenced this issue Oct 26, 2020
angelozerr pushed a commit to angelozerr/vscode-xml that referenced this issue Oct 27, 2020
Fixes redhat-developer#220

Signed-off-by: azerr <azerr@redhat.com>
angelozerr pushed a commit to angelozerr/vscode-xml that referenced this issue Oct 27, 2020
Fixes redhat-developer#220

Signed-off-by: azerr <azerr@redhat.com>
angelozerr pushed a commit to angelozerr/vscode-xml that referenced this issue Oct 27, 2020
Fixes redhat-developer#220

Signed-off-by: azerr <azerr@redhat.com>
angelozerr pushed a commit to angelozerr/vscode-xml that referenced this issue Oct 27, 2020
Fixes redhat-developer#220

Signed-off-by: azerr <azerr@redhat.com>
angelozerr pushed a commit to angelozerr/lemminx that referenced this issue Oct 27, 2020
angelozerr pushed a commit to angelozerr/lemminx that referenced this issue Oct 27, 2020
angelozerr pushed a commit to angelozerr/vscode-xml that referenced this issue Oct 27, 2020
Fixes redhat-developer#220

Signed-off-by: azerr <azerr@redhat.com>
angelozerr pushed a commit to angelozerr/vscode-xml that referenced this issue Oct 27, 2020
Fixes redhat-developer#220

Signed-off-by: azerr <azerr@redhat.com>
datho7561 pushed a commit to eclipse/lemminx that referenced this issue Oct 27, 2020
datho7561 pushed a commit that referenced this issue Oct 27, 2020
Fixes #220

Signed-off-by: azerr <azerr@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants