Yesterday17 / ZenScript

Visual Studio Code extension/Language Server for ZenScript, includes highlight, code snippet and language server(WIP). Works with 👇
https://github.com/Yesterday17/Probe
MIT License
33 stars 4 forks source link

Extension Fails To Detect Scripts Folder #40

Open Brittank88 opened 3 years ago

Brittank88 commented 3 years ago

Hi there! I am having an issue whereby this extension refuses to detect that I have the scripts folder open as my workspace: image image

Not sure what else to do from here - I've tried running VSCode with administrator privileges, and that .minecraft folder setting appears to no longer exist...

Yesterday17 commented 3 years ago

Seems the extension cannot find .zsrc file. That's the key of most features provided by this extension.

Brittank88 commented 3 years ago

I'm still somewhat of a ZenScript newbie - this is my first time ever hearing of .zsrc files! Is there any good resource to go to that explains their purpose? I find a lot of ZS documentations to be somewhat..difficult compared to standard programming documentation.

Yesterday17 commented 3 years ago

zsrc is a file format generated by Probe, and only used by this extension to provide some advanced features.

The purpose of generating such a file is to dump information from the game to the disk, so that information in game can be used without launching Minecraft every time you want to write ZS scripts.

For example, items are only accessible in game. If you want to add a recipe to, for example, <minecraft:diamond>, you must find its id out first(using /ct hand), and put it in script(as arguments of functions). But if we can dump information of all items out, then the extension can know what item exist in this modpack. With the information provided, auto completion for items becomes possible.

e32b924c9cb35537d434d35a14b9ba66510429cb (Preview image two years ago)

If zsrc file is not found, all completion features are disabled, because the extension has no way to know what exists in game. But basic features still work, like code highlight and priority tree. But the core feature of this extension is to provide auto completion to ZenScript, so Probe is recommend(And easy to use. The only thing you need to do is to put the mod in mods folder, and launch the game once, then zsrc file will be generated in scripts folder).

ZenScript is actually not well-documented compared to other programming languages. A good way to learn ZenScript is to read scripts written by other modpackers(learn by example). Most modpacks follow this pattern: create one file for each mod and modify recipes of that mod in the file. SevTech creaters used another pattern: they write ZenScript like Java, taking great advantage of classes and callbacks in this language.

Brittank88 commented 3 years ago

Wow, thank you for explaining all this with such clarity! This will definitely aid the development process of this modpack I'm working on.

Brittank88 commented 3 years ago

Hi Yesterday,

After generating the .zsrc file, the plugin works as expected. Should I close the issue now, or would you prefer it remain open as a reminder to work on some things?

Thanks for your time!

Yesterday17 commented 3 years ago

Just keep it open. Waiting for a reproducible example when others meet the same problem :)

Brittank88 notifications@github.com 于2021年1月19日周二 下午1:37写道:

Hi Yesterday,

After generating the .zsrc file, the plugin works as expected. Should I close the issue now, or would you prefer it remain open as a reminder to work on some things?

Thanks for your time!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Yesterday17/ZenScript/issues/40#issuecomment-762613104, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACCEFLRRQ7SGGTM4HSTXMSTS2ULAXANCNFSM4WAI7DWA .

asdfghjkl403622 commented 3 years ago

Hey!

I'm having this same issue, but when I put the "probe" folder in my mods folder it does not generate the .zsrc file. what do I do?

Yesterday17 commented 3 years ago

@asdfghjkl403622 Could you please describe how did you use probe and this extension step by step?

jeengbe commented 3 years ago

@Yesterday17 I suggest you change the message a little. (Maybe even hint that a mod is missing)

Yesterday17 commented 3 years ago

@jeengbe sure.. the hint now seems confusing

cpriest commented 3 years ago

I too was left wondering what to do with the Probe mod. You might want to include some quick instructions on what to do with the Probe mod.

ie:

  1. Download latest release .jar to your packs mod folder.
  2. Start Minecraft and load into or create a world.
  3. ....
  4. Exit Minecraft, VS Code plugin should now work.
Xelbayria commented 1 year ago

Hello,

I am trying to figure out what went wrong. I used the mod probe to create the file .zsrc which is in the scripts folder. My workspace is a folder where it contains resource pack, mods, scripts so on and on. It looks like the autocompletion feature is not working. I've run a simple test on this.

Can I get more details on how it works? like does the VSCode have to have a workspace which is within the scripts folder, not the root of the Minecraft directory?

edit: I got it working by detecting the file .zsrc. It can be either within the root of the directory where it contains a scripts folder and other folders... OR it can be within the Scripts folder. There is one issue, the autocompletion doesn't show up for any items???