GithubHelp home page GithubHelp logo

poryscript-pls's Introduction

poryscript-pls

Actions Status codecov

The language server for Poryscript.

Local Development Setup

First, install Go.

Then, build it!

go build

Testing with the Poryscript VS Code Extension

Clone the Poryscript Language Extension repository.

git clone https://github.com/SBird1337/poryscript-language

In client/src/extension.ts, replace the executable path with hardcoded paths to your Poryscript language server binary (poryscript-pls).

const debugPlsPath = "your\\path\\to\\poryscript-pls.exe";
const releasePlsPath = "your\\path\\to\\poryscript-pls.exe";

Launch the extension as usual (e.g. pressing F5) to test the poryscript-pls server. Windows Note: It doesn't seem to load properly if the project you load in the Extension Development Host is located in the WSL filesystem, so make sure you're testing in a normal Windows environment.

Notes

This project's lsp/ directory is a modified vendor copy of Sourcegraph's LSP bindings for Go. It provides all of the Go structs for the LSP specification. Sourcegraph stopped maintaining their library for some reason, but it still seems to be the best library for it.

It also makes use of Sourcegraph's jsonrpc2 library to facilitate the JSON RPC communications.

poryscript-pls's People

Contributors

huderlem avatar

Watchers

James Cloos avatar  avatar

poryscript-pls's Issues

Support `vararg` script macros

poryscript-pls currently treats it like a single argument and throws a diagnostics error if you try to pass in more. We should also pass the correct completion hints to the system, so it shows vararg as ... e.g.

Example of a vararg macro:

.macro createsprite template:req, anim_battler:req, subpriority_offset:req, argv:vararg

textDocument/didOpen Error

[DEBUG][2023-01-11 20:48:17] .../vim/lsp/rpc.lua:285	"rpc.send"	{  jsonrpc = "2.0",  method = "textDocument/didOpen",  params = {    textDocument = {      languageId = "pory",      text = "script MyScript {\n    # Show a different message, depending on the state of different flags.\n    lock\n    faceplayer\n    if (flag(FLAG_RECEIVED_TOP_PRIZE)) {\n        msgbox(\"You received the best prize!\")\n    } elif (flag(FLAG_RECEIVED_WORST_PRIZE)) {\n        msgbox(\"Ouch, you received the worst prize.\")\n    } else {\n        msgbox(\"Hmm, you didn't receive anything.\")\n    }\n    msgbox(MyString)\n    release\n    end\n\n}\n\ntext MyString {\n    format(\"helo\") \n}\n\n",      uri = "file:///home/testuser/PokemonDisassembly/pokeemerald/data/scripts/test2.pory",      version = 0    }  }}

[ERROR][2023-01-11 20:48:17] .../vim/lsp/rpc.lua:733	"rpc"	"poryscript-pls"	"stderr"	'2023/01/11 20:48:17 jsonrpc2 handler: notification "textDocument/didOpen" handling error: json: cannot unmarshal array into Go value of type string\n'

Neovim sends textDocument/didOpen as an array and seems poryscript-pls is expecting a string causing it to error.

I've added the JSON message above for an example.

[Semantic Highlighting] IntelliSense does not work correctly, probably related to certain unicode characters

reproduce:

        msgbox(format("???: Oh, hi.\p"
            "???: Who are you?\p"
            "???: Oh, so your name is {PLAYER}.\n"
            "You are the guy that played my game!\p"
            "???: Excuse me, I should introduce myself, I'm JAIZU.\p"
            "JAIZU: I'm glad to meet you {PLAYER}.\p"
            "JAIZU: You know, development isn't always easy, but the community feedback is really good and makes me continue making new releases for the game.\p"
            "JAIZU: Please, accept this POKéMON as a thank you for playing EMERALD CROSS."), MSGBOX_NPC)

result:
image

It works correctly if there is no é in the last line.

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.