japhib / pico8-ls

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

Support built in globals #9

Closed Lexicality closed 2 years ago

Lexicality commented 2 years ago

All the uppercase symbols (eg πŸ…ΎοΈ) are constants, but the language server says they're undefined. Examples from demos/api.p8:

    if (btn(❎)) then
     camera(cos(t()/6)*20,0)
     clip(4,16,120,96)--x,y,w,h
    end
    fillp(β–‘)
    circfill(64,160,52,7)
    fillp() -- reset
japhib commented 2 years ago

Fixed with 0.4.0. I added all the uppercase symbols, e.g. everything you get when typing Shift + an alphabet letter. Let me know if I missed any.

joeygibson commented 1 year ago

How do you actually enter these characters? Typing Shift-L in Pico-8 gives the ⬅️ glyph, but in VSCode, it just give me an "L". I've been entering these glyphs in Pico-8, and then switching back to VSCode, but if there's a way to actually type them in VSCode, I'd love to know it.

Lexicality commented 1 year ago

How do you actually enter these characters? Typing Shift-L in Pico-8 gives the ⬅️ glyph, but in VSCode, it just give me an "L". I've been entering these glyphs in Pico-8, and then switching back to VSCode, but if there's a way to actually type them in VSCode, I'd love to know it.

When I opened the issue I was trying to edit a pre-existing script, but you should be able to add all the symbols from your OS's emoji picker, eg

joeygibson commented 1 year ago

Oh, for Pete's sake... I didn't even think about entering them that way. πŸ€¦πŸ»β€β™‚οΈ Thank you!