japhib / pico8-ls

PICO-8 Language Server
MIT License
64 stars 8 forks source link

Add some way to pick from pico-8 glyphs #30

Closed mika76 closed 1 year ago

mika76 commented 1 year ago

It's useful to use the especially when listening to buttons - so having some sort of quick-pick or something would really help

japhib commented 1 year ago

I don't understand the request. Can you provide more details? What glyphs are you referring to? And what did you have in mind for a "quick-pick"?

mika76 commented 1 year ago

I mean the icons you can place when pressing shift in pico-8 https://pico-8.fandom.com/wiki/P8SCII symbols, hashes, etc...

not sure about how - maybe snippets, or some sort of clickable window? Anything to make it easy 😊

japhib commented 1 year ago

I see. Not sure how to do this. It'd definitely be a cool feature though!

mika76 commented 1 year ago

I came up with this snippet file - maybe you can try incorporate it into the extension if you'd like. Basically you just need to start typing p8scii and the selection should popup. Also I only included the things with names, I have no idea how I would include the other japanese characters...

PS: I copy pasted the names and characters from https://pico-8.fandom.com/wiki/P8SCII and have not tested them all, but the ones I tried worked...

{
    //Symbols and Japanese punctuation
    "Vertical rectangle": {
        "prefix": "p8scii-vertical-rectangle",
        "body": [
            "▮"
        ],
    },
    "Filled square": {
        "prefix": "p8scii-filled-square",
        "body": [
            "■"
        ],
    },
    "Hollow square": {
        "prefix": "p8scii-hollow-square",
        "body": [
            "□"
        ],
    },
    "Five dot": {
        "prefix": "p8scii-five-dot",
        "body": [
            "⁙"
        ],
    },
    "Four dot": {
        "prefix": "p8scii-four-dot",
        "body": [
            "⁘"
        ],
    },
    "Pause": {
        "prefix": "p8scii-pause",
        "body": [
            "‖"
        ],
    },
    "Back": {
        "prefix": "p8scii-back",
        "body": [
            "◀"
        ],
    },
    "Forward": {
        "prefix": "p8scii-forward",
        "body": [
            "▶"
        ],
    },
    "Japanese starting quote": {
        "prefix": "p8scii-japanese-starting-quote",
        "body": [
            "「"
        ],
    },
    "Japanese ending quote": {
        "prefix": "p8scii-japanese-ending-quote",
        "body": [
            "」"
        ],
    },
    "Yen sign": {
        "prefix": "p8scii-yen-sign",
        "body": [
            "¥"
        ],
    },
    "Interpunct": {
        "prefix": "p8scii-interpunct",
        "body": [
            "•"
        ],
    },
    "Japanese comma": {
        "prefix": "p8scii-japanese-comma",
        "body": [
            "、"
        ],
    },
    "Japanese full stop": {
        "prefix": "p8scii-japanese-full stop",
        "body": [
            "。"
        ],
    },
    "Japanese dakuten": {
        "prefix": "p8scii-japanese-dakuten",
        "body": [
            "゛"
        ],
    },
    "Japanese handakuten": {
        "prefix": "p8scii-japanese-handakuten",
        "body": [
            "゜"
        ],
    },
    //Typeable symbols
    "Hollow circle": {
        "prefix": "p8scii-hollow-circle",
        "body": [
            "○"
        ]
    },
    "Rectangle": {
        "prefix": "p8scii-rectangle",
        "body": [
            "█"
        ]
    },
    "Checkerboard": {
        "prefix": "p8scii-checkerboard",
        "body": [
            "▒"
        ]
    },
    "Jelpi": {
        "prefix": "p8scii-jelpi",
        "body": [
            "🐱"
        ]
    },
    "Down key": {
        "prefix": "p8scii-down-key",
        "body": [
            "⬇️"
        ]
    },
    "Dot pattern": {
        "prefix": "p8scii-dot-pattern",
        "body": [
            "░"
        ]
    },
    "Throwing star": {
        "prefix": "p8scii-throwing-star",
        "body": [
            "✽"
        ]
    },
    "Ball": {
        "prefix": "p8scii-ball",
        "body": [
            "●"
        ]
    },
    "Heart": {
        "prefix": "p8scii-heart",
        "body": [
            "♥"
        ]
    },
    "Eye": {
        "prefix": "p8scii-eye",
        "body": [
            "☉"
        ]
    },
    "Man": {
        "prefix": "p8scii-man",
        "body": [
            "웃"
        ]
    },
    "House": {
        "prefix": "p8scii-house",
        "body": [
            "⌂"
        ]
    },
    "Left key": {
        "prefix": "p8scii-left-key",
        "body": [
            "⬅️"
        ]
    },
    "Face": {
        "prefix": "p8scii-face",
        "body": [
            "😐"
        ]
    },
    "Musical note": {
        "prefix": "p8scii-musical-note",
        "body": [
            "♪"
        ]
    },
    "O key": {
        "prefix": "p8scii-o-key",
        "body": [
            "🅾️"
        ]
    },
    "Diamond": {
        "prefix": "p8scii-diamond",
        "body": [
            "◆"
        ]
    },
    "Ellipsis": {
        "prefix": "p8scii-ellipsis",
        "body": [
            "…"
        ]
    },
    "Right key": {
        "prefix": "p8scii-right-key",
        "body": [
            "➡️"
        ]
    },
    "Five-pointed star": {
        "prefix": "p8scii-five-pointed-star",
        "body": [
            "★"
        ]
    },
    "Hourglass": {
        "prefix": "p8scii-hourglass",
        "body": [
            "⧗"
        ]
    },
    "Up key": {
        "prefix": "p8scii-up-key",
        "body": [
            "⬆️"
        ]
    },
    "Birds": {
        "prefix": "p8scii-birds",
        "body": [
            "ˇ"
        ]
    },
    "Sawtooth": {
        "prefix": "p8scii-sawtooth",
        "body": [
            "∧"
        ]
    },
    "X key": {
        "prefix": "p8scii-x-key",
        "body": [
            "❎"
        ]
    },
    "Horiz lines": {
        "prefix": "p8scii-horiz-lines",
        "body": [
            "▤"
        ]
    },
    "Vert lines": {
        "prefix": "p8scii-vert-lines",
        "body": [
            "▥"
        ]
    },
    "Left arc": {
        "prefix": "p8scii-left-arc",
        "body": [
            "◜"
        ]
    },
    "Right arc": {
        "prefix": "p8scii-right-arc",
        "body": [
            "◝"
        ]
    },
}
japhib commented 1 year ago

I like the idea of adding the snippets. If you submit a PR adding these snippets to syntaxes/snippets.json, I'll be happy to merge it.

japhib commented 1 year ago

I changed some of the shortcuts to make them shorter and then added these suggestions in https://github.com/japhib/pico8-ls/commit/c7d3f750f5afb336d6593790c03d9d299c90f379 .

Not released yet -- I'll make a comment when it is.

japhib commented 1 year ago

Fix released just now with 0.4.10