Giter Site home page Giter Site logo

probejs-legacy's Introduction

ProbeJS

A data dumper and typing generator for the KubeJS functions, constants and classes.

Great thanks to @DAmNRelentless, @LatvianModder and @yesterday17 for invaluable suggestions during the development!

1. Showcase

Auto-completion snippets for Items, Blocks, Fluids, Entities and Tags:

image

Auto-completion, type-hinting for most of the functions and classes:

image

2. Installation

  1. Get VSCode.
  2. Install the mod.
  3. In game, use /probejs dump and wait for the typings to be generated.
  4. Open the your game folder in VSCode, you should see snippets and typing functioning.
  5. Use /probejs dump in case of you want to refresh the generated typing. If VSCode is not responding to file changes, press F1 and execute TypeScript: Restart TS server to force a refresh in Code.

3. Event Dump

  1. Run the game, and use the /probejs dump commmand only after the events of interest are fired, then dump and regenerate typings as before.
  2. Reload your IDE if your IDE doesn't know about the changes of typings, you will see those onEvent with correct typings now.
  3. v1.4 allows dumped events to be persisted between dumps, no matter actually they're fired or not in current dump, if an event is missing (mostly from the removal of mods), cached events will be automatically remove too. If you want to clear the cache manually, use /probejs clear_cache.

4. Beaning

Bean conversions are added now, however, to make generated typing information comfort with VSCode's TS language server while applying beaning as much as possible, a few rules are added:

  1. Beans will not have naming conflicts with methods/fields existed, if a bean has a conflicted name, the bean will not be compiled to declaration.
  2. For beans with .getX() implemented, get x() will be added. For beans with .setX(arg1) implemented, set x(arg1) will be added. setX must accepts exactly one arg, otherwise such method will not be beaned.
  3. If .isX() has a .setX() or .getX() part with same name, the latter will override .isX() to prevent loss of information.
  4. Original getter and setter methods are NOT hidden by default, but this behaviour can be toggle on via command /probejs config toggle_bean.

probejs-legacy's People

Contributors

zzzank avatar prunoideae avatar

Stargazers

G_cat avatar n0099 avatar

Watchers

n0099 avatar

probejs-legacy's Issues

Incompatibility with xaero's minimap

When both mods are installed and /probejs dump is ran, a NoClassDefFoundError appears with the game not being able to find xaero/map/region/LeveledRegion. Tested on a bare 1.16.5 forge instance with only probe, xaeros, kubejs and its dependencies installed; also tried in a larger modpack with more mods. Log and crash report from the bare instance attempt attached.

To reproduce:

  1. Start the game
  2. Log into a world
  3. Run /probejs dump
  4. crash!!!!!!!11

latest.log
crash-2024-03-23_21.52.17-server.txt

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.