microsoft / microsoft/vscode-custom-data
If custom HTML tag contains uppercase then auto completion values wont show
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 240
- Forks
- 95
- PR merge metrics
- No merged PRs in 30d
Description
So I'm current;y writing an extension to bring CouchCMS custom html tag support into VSCode with hover and auto completion with snippet style attributes. All is going well until I got to this tag
<cms:excerptHTML />
I wrote the customData as I did for every other tag before, literally almost exactly the same as the tag that came before it,
<cms:excerpt />
went to test it to make sure I didn't have any typos and the auto completion "attributes" didn't show at the top of the auto completion list when triggered via "Ctrl + Space". Played around with the tag and found if I remove the uppercase from the tag and make it lower case it works as expected. Here is what I have in the customData file for that tag:
{
"name": "cms:excerptHTML",
"description": "```html \n <cms:excerptHTML count='130' ignore='img'> \n ```\n===========\n\n\nThe **excerptHTML** tag can be used to create an excerpt of any HTML content that is enclosed within its opening and closing tags. \n\nUnlike the **excerpt** tag, excerptHTML preserves the HTML formatting of the truncated contents (except for the HTML tags specified in its *ignore* parameter).\n\n\nExamples -\n\n\n\n ```html \n<cms:excerptHTML><cms:show content /></cms:excerptHTML>\n\n ``` \n\n ```html \n<cms:excerptHTML count='130' ignore='img'>\n <cms:show content />\n</cms:excerptHTML>\n\n ``` \nThe snippets are outputting an excerpt of the value contained within the *content* variable.\n\n\nParameters\n----------\n\n\n\n\n* count\n\n* ignore\n\n* trail\n\n\n\n### count\n\n\nThe maximum number of words that the excerpt can contain. The default value is 50 words.\n\n\n### ignore\n\n\nThe HTML elements to weed out of the excerpt. For example, you might not want to have any images in the excerpt. \n\nIf you wish to ignore multiple tags, separate the tagnames by using comma e.g.\n\n\n\n ```html \nignore='img, table'\n\n ``` \n### trail\n\n\nBy default the produced excerpt is appended with '...' (three ellipses). You can change this by using this parameter.\n\n\n\n ```html \n<cms:excerptHTML trail=\" (<a href=\"<cms:show k_page_link />\">read more..</a>)\"><cms:show blog_content /></cms:excerptHTML>\n\n ``` \nThe snippet above will append a '*read more..*' link leading to the page-view of the item being shown in excerpted form.\n\n\nVariables\n---------\n\n\nThis tag does not set any variables of its own.\n\n\nRelated Tags\n------------\n\n\n\n\n* [excerpt](excerpt.html)\n\n\n\n'",
"attributes": [
{
"name": "${count:count}='${1:50}'",
"description": "The maximum number of words/characters that the excerpt can contain. The default value is 50. \n By default, this parameter is applied to the number of words in the excerpt. \n By setting the 'truncate_chars' parameter (see below) to '1', it can be made to apply to the number of characters in the excerpt instead.\n\n",
"valueSet": "v"
},
{
"name": "${ignore:ignore}='${1:table, span, img}'",
"description": "The HTML elements to weed out of the excerpt. For example, you might not want to have any images in the excerpt. \n If you wish to ignore multiple tags, separate the tagnames by using comma e.g.\n\n\n ```html \nignore='img, table' \n ``` \n",
"valueSet": "v"
},
{
"name": "${trail:trail}='${1:...}'",
"description": "By default the produced excerpt is appended with '...' (three ellipses). You can change this by using this parameter.\n\n\n ```html \n<cms:excerptHTML trail=\" (<a href=\"<cms:show k_page_link />\">read more..</a>)\"><cms:show blog_content /></cms:excerptHTML> \n ``` \nThe snippet above will append a '*read more..*' link leading to the page-view of the item being shown in excerpted form.\n\nVariables\n---------\n\nThis tag does not set any variables of its own.",
"valueSet": "v"
}
]
},
Is there any way to make the uppercase work? The tag is case sensitive so I cant just make it lowercase.
Thanks.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the customData entry for cms:excerptHTML and reproduce completion in VS Code, comparing it with the lowercase cms:excerpt entry. Trace how the custom data is matched when the tag contains uppercase letters; done means attributes appear for the case-sensitive uppercase tag as they do for the lowercase tag.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- vscode
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100