Giter VIP home page Giter VIP logo

Comments (3)

sikwitcarts avatar sikwitcarts commented on September 1, 2024

really though I've been searching everywhere on how to do this. ultimately trying to have the attributes for the autocompleted tag and only that tag be suggested as well as a default value for that attribute.

from vscode-custom-data.

nickisghosty avatar nickisghosty commented on September 1, 2024

@andreasRu
You can use snippets and doing so makes the suggested values stay at the top of the list. For example:

{
    "version": 1.1,
    "tags": [
        {
            "name": "cms:add",
            "description": "```html \n <cms:add my_count '1' /> \n ``` \n===\n\n\nThe **add** tag accepts two parameters and returns as its output the value obtained after adding together the two parameters.  \n\nThe parameters may be literal strings, variables or output of other tags.\n\n\n\n ```html \n<cms:add my_count '1' />\n\n ``` \nThe snippet above adds 1 to what ever value is contained within *my_count* variable and outputs the resulting value.\n\n\nParameters\n----------\n\n\nThe tag expects two parameters as the values to be added.\n\n\nVariables\n---------\n\n\nThis tag is self-closing and does not set any variables of its own.\n\n\nRelated Tags\n------------\n\n\n\n\n* [sub](sub.html)\n\n* [mul](mul.html)\n\n* [div](div.html)\n\n* [mod](mod.html)\n\n* [incr](incr.html)\n\n* [decr](decr.html)\n\n\n\n'",
            "attributes": [
                {
                    "name": "${couchVar:${1:variableName}} ",
                    "description": "Value may be a Couch system variable Such as k_page_id or k_template_id or k_user_id etc.\n Eg. \n > <cms:add **k_page_id** '1' />",
                    "valueSet": "v"
                },
                {
                    "name": "${userVar:${1:variableName}} ",
                    "description": "Value may be a previously set variable name. Such as if you've used a code similar to \n```html\n <cms:set myvar='1' />\n ```  \n Eg.\n > <cms:add **myvar** '1' />",
                    "valueSet": "v"
                },
                {
                    "name": "${number:'$1'} ",
                    "description": "Value may be the number you wish to add to the other value.\n Eg.\n > <cms:add myvar **'1'** />",
                    "valueSet": "v"
                }
            ]
        }
    ]
}

from vscode-custom-data.

kevinlieser avatar kevinlieser commented on September 1, 2024

@nickisghosty Thanks – that works. With that the attributes are on Top of all other attributes. But do not answer the question to limit the attributes of an element just to the custom defined attributes – that would be great if it would work as @andreasRu suggested with suggestOnlyPrivatAttr = true.

Now with the snippet style the selection in autocompletion list do look a bit ugly in my opinion.
Bildschirmfoto 2021-03-15 um 11 46 54

from vscode-custom-data.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.