
XanoScript Extension for Visual Studio Code
Xanoscript extension for Visual Studio Code (compatible with Cursor).
Design
Every object type (API endpoint, API group, function, table...) is a file. The plugin downloads and organize each object types locally as such:
Features
- Syntax Highlighting: Enjoy clear and consistent highlighting for all your XanoScript files.
- Hover Documentation: Hover over functions and keywords to get instant, detailed information.
- Code Completion: Write code faster with intelligent, context-aware suggestions.
- Error Checking and Linting: Catch mistakes early with built-in error detection.
- Debugging Support: Debug your XanoScript code seamlessly within VS Code.
- Integration: Full support for XanoScript’s database and API functions.
Installation
Getting started is easy! To install the XanoScript extension:
- Open Visual Studio Code.
- Navigate to the Extensions Marketplace (Ctrl+Shift+X or Cmd+Shift+X on Mac).
- Search for "XanoScript" and click Install.
Alternatively, you can download the .vsix
file from our GitHub repository and install it manually by following VS Code’s manual installation instructions.
Usage
Once installed, open any .xs
file in VS Code to start coding in XanoScript. The extension will automatically provide syntax highlighting, hover documentation, and code completion. Here’s a quick example to get you started:
query auth/login verb=POST {
description = "Login and retrieve an authentication token"
input {
email email? filters=trim|lower
text password?
}
stack {
db.get user {
field_name = "email"
field_value = $input.email
output = ["id", "created_at", "name", "email", "password"]
} as $user
precondition ($user != null) {
error_type = "accessdenied"
error = "Invalid Credentials."
}
security.check_password {
text_password = $input.password
hash_password = $user.password
} as $pass_result
precondition ($pass_result) {
error_type = "accessdenied"
error = "Invalid Credentials."
}
security.create_auth_token {
dbtable = "user"
extras = {}
expiration = 86400
id = $user.id
} as $authToken
}
response {
value = {authToken: $authToken}
}
history = {inherit: true}
}
Try hovering over var
or debug.log
to see its documentation or start typing to explore code completion options!
Documentation
For a deep dive into XanoScript’s syntax, functions, and capabilities, check out the syntax documentation and its function reference guide
. It’s packed with examples and guides to help you master the language.
Contributing
We’d love your help to make the XanoScript extension even better! Whether it’s reporting bugs, suggesting features, or submitting code, please see our contributing guidelines for details on how to get involved.
License
This extension is proudly released under the MIT License. Feel free to use, modify, and share it as you see fit!
This README provides everything you need to introduce the XanoScript extension: a compelling overview, key features, and clear instructions—all wrapped in a clean, user-friendly format. Happy coding!