Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. | ||
} | ||
} |