Skip to content

Commit

Permalink
updating vscode language pack
Browse files Browse the repository at this point in the history
  • Loading branch information
cblanquera committed Apr 13, 2024
1 parent efe4659 commit 062582f
Show file tree
Hide file tree
Showing 11 changed files with 92 additions and 656 deletions.
1 change: 1 addition & 0 deletions packages/idea-language/.vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ client/node_modules/**
!client/node_modules/{minimatch,brace-expansion,concat-map,balanced-match}/**
!client/node_modules/{semver,lru-cache,yallist}/**
archives
.DS_Store
81 changes: 77 additions & 4 deletions packages/idea-language/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,79 @@
# Idea Language Server
# 💡 Idea

Adds syntax highlighting, formatting, auto-completion, jump-to-definition
and linting for idea files.
A meta language to express and transform your ideas to reality.
It all starts with an idea...

See [https://github.com/OSSPhilippines/idea](https://github.com/OSSPhilippines/idea) for more info
## Usage

This is an example idea schema.

```js
//my.idea
model Product @label("Product" "Products") @suggested("[name]") @icon("gift") {
name String @label("Name")
@field.text
@is.required("Name is required")
@list.detail @view.text

image String @label("Image")
@field.image
@list.image({ width 20 height 20 })
@view.image({ width 100 height 100 })

description String @label("Description")
@field.textarea
@list.none @view.text

currency String @label("Currency")
@filterable @default("USD")
@field.currency
@is.ceq(3 "Should be valid currency prefix")
@list.text @view.text

srp Float? @label("SRP")
@min(0.00) @step(0.01)
@field.number({ min 0.00 step 0.01 })
@list.price @view.price

price Float? @label("Offer Price")
@min(0.00) @step(0.01)
@field.number({ min 0.00 step 0.01 })
@list.price @view.price
}
```
> "Ideas are worthless without execution" - Many People
To transform an idea, you need to plugin a transformer like the
following example.
```js
//my.idea
plugin "@ossph/idea-typescript" {
ts true
output "./src/types.ts"
}
// ... your idea ...
// model Product ...
```
You can use other ideas, just import them like the following example.
```js
//my.idea
use "./another.idea"
// ... your idea ...
// model Product ...
```
To execute an idea, you just need to run the following command.
```bash
$ npx idea -i my.idea
```
Learn more:
- [Form an Idea](//github.com/OSSPhilippines/idea/blob/main/docs/schema.md)
- [Transform an Idea](//github.com/OSSPhilippines/idea/blob/main/docs/transform.md)
- [Contribute to Idea](//github.com/OSSPhilippines/idea/blob/main/docs/contribute.md)
Loading

0 comments on commit 062582f

Please sign in to comment.