Jump to content

Photo

VS Code plugin for ZScript


  • Please log in to reply
6 replies to this topic

#1 connor.clark

connor.clark

    Junior

  • ZC Developers

Posted 27 July 2023 - 08:17 PM

There is now a plugin for the VS Code editor: https://marketplace....amcl.zquest-lsp

Basic features it supports currently:

* Underline warnings/errors from the compiler, directly in the editor

* Syntax highlighting

* (very experimental) code formatting, if you have clang-format installed.

 

Here is an example: https://imgur.com/Rz4fAa3

 

 

In the future, we'll possibly add things like contextual autocompletion, and shortcuts for Test Mode / launching ZQ.


  • Anthus, Twilight Knight, Alucard648 and 3 others like this

#2 Twilight Knight

Twilight Knight

    Tell all with glee, Argon's on PureZC

  • Members
  • Real Name:Sven
  • Location:Rotterdam, NL

Posted 28 July 2023 - 08:44 AM

Amazing! I'll try it out soon

This was still on my TODO list, but you beat me to the punch :-)



#3 Matthew

Matthew

  • Administrators
  • Real Name:See above.
  • Pronouns:He / Him
  • Location:Ohio

Posted 28 July 2023 - 03:41 PM

This is wonderful to see. Now, we just need to train GitHub copilot on the entire script database and start AI-generating scripting away.



#4 connor.clark

connor.clark

    Junior

  • ZC Developers

Posted 07 April 2024 - 09:26 PM

This just got a big update for 3.0 ZC: https://zquestclassi...-code-extension

 

I'll be implementing more of VS Code's language server features. If anyone would enjoy a particular feature, let me know: https://code.visuals...eatures-listing

 

Currently I'm working on getting all internal functions (global functions, Game->/Screen->/bitmap-> etc. methods/properties) to provide a documentation comment when hovering over them (currently only have that working for stuff you define in a script yourself).


  • Jambu likes this

#5 Jambu

Jambu

    Junior

  • Members
  • Pronouns:He / Him, They / Them

Posted Yesterday, 11:34 AM

Hey Connor thought I would check this out and I am curious how do I prevent VSCode from marking functions from the std library as errors.



#6 Emily

Emily

    Scripter / Dev

  • ZC Developers
  • Pronouns:She / Her

Posted Yesterday, 02:51 PM

Hey Connor thought I would check this out and I am curious how do I prevent VSCode from marking functions from the std library as errors.

You need to set up the extension so it understands what files to look at. In the extension settings, there is a setting for `Default Include Files`. You'll want to make sure one of these is the `std.zh` file.

 

Additionally, if you have multiple script files of your own, they may mark *each other* as errors because they don't know about each other. This can be handled by having a "project entry point" file - a single file, that has nothing in it but #includes to your other files. If you then set THIS file as a `Default Include File`, it will know how to read all of your script files when checking for validity.


  • Jambu likes this

#7 Jambu

Jambu

    Junior

  • Members
  • Pronouns:He / Him, They / Them

Posted Yesterday, 08:47 PM

You need to set up the extension so it understands what files to look at. In the extension settings, there is a setting for `Default Include Files`. You'll want to make sure one of these is the `std.zh` file.

 

Additionally, if you have multiple script files of your own, they may mark *each other* as errors because they don't know about each other. This can be handled by having a "project entry point" file - a single file, that has nothing in it but #includes to your other files. If you then set THIS file as a `Default Include File`, it will know how to read all of your script files when checking for validity.

Do you have an example. I have this...

iERkRhR.png

still throwing me errors.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users