Skip to content

Commit

Permalink
add small doc for jsx --completion
Browse files Browse the repository at this point in the history
  • Loading branch information
gfx committed Sep 19, 2012
1 parent 4c95156 commit 4802cac
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
42 changes: 42 additions & 0 deletions complete/README.md
@@ -0,0 +1,42 @@
# JSX completion

The JSX compiler has the completion mode for text editors / IDEs,
triggered by `jsx --complete`.

# CAVEAT

This feature is alpha quality. Project to change.

# USAGE

`jsx --complete 15:7 complete/example.jsx` will shows the following JSON array:

```json
[
{
"word" : "window",
"definedFilename" : "/path/to/jsx/lib/js/js/web.jsx",
"definedClass" : "dom",
"doc" : "The top-level Window object.",
"type" : "Window",
"definedLineNumber" : 18
},
{
"args" : [
{
"name" : "id",
"type" : "string"
}
],
"word" : "getElementById",
"definedClass" : "dom",
"definedFilename" : "/path/to/jsx/lib/js/js/web.jsx",
"type" : "function (: string) : HTMLElement",
"doc" : "same as <code>dom.document.getElement(id)</code>, except returns <code>HTMLElement</code>.",
"returnType" : "HTMLElement",
"definedLineNumber" : 35
}
]
```

[jsx.vim](https://github.com/jsx/jsx.vim/blob/master/autoload/jsx.vim) uses this feature.
17 changes: 17 additions & 0 deletions complete/example.jsx
@@ -0,0 +1,17 @@
// usage: jsx --complete 15:7 complete/example.jsx

import "js/web.jsx";

/**
* The application main class.
*/
class _Main {
/**
* The application entry point.
* @param args arguments of process
*/
static function main(args : string[]) :void {
log "Hello, world!";
dom.
}
}

0 comments on commit 4802cac

Please sign in to comment.