Merge branch 'Tehnix-master'
This commit is contained in:
commit
7961206c6f
|
@ -1,6 +1,8 @@
|
|||
# Next
|
||||
- Add hindent and brittany beautifiers for haskell
|
||||
- Breaking change to `pybeautifier`: Fix typo, change `formater` to `formatter`. See [#1898](https://github.com/Glavin001/atom-beautify/pull/1898).
|
||||
- Fixes [#1773](https://github.com/Glavin001/atom-beautify/issues/1773) and [#793](https://github.com/Glavin001/atom-beautify/issues/793). ruby-beautify with Rubocop now respects `Exclude` settings, and properly loads inherited config files (like `~/.rubocop.yml`)
|
||||
- Add hindent and brittany beautifiers for haskell
|
||||
- Fix [#1862](https://github.com/Glavin001/atom-beautify/issues/1862) Add support for ocp-indent as an executable
|
||||
- See [#601](https://github.com/Glavin001/atom-beautify/issues/1862) Add support for tsx files
|
||||
- See [#1497](https://github.com/Glavin001/atom-beautify/issues/1497) and [#802](https://github.com/Glavin001/atom-beautify/issues/802)
|
||||
|
|
|
@ -91,6 +91,7 @@ Some of the supported beautifiers are developed for Node.js and are automaticall
|
|||
| align-yaml | :white_check_mark: | :ok_hand: Not necessary | :smiley: Nothing! |
|
||||
| autopep8 | :warning: 2 executables | :warning: Only 1 of 2 executables | :whale: With [Docker](https://www.docker.com/):<br/>1. Install [autopep8 (`autopep8`)](https://github.com/hhatto/autopep8) with `docker pull unibeautify/autopep8`<br/><br/>:bookmark_tabs: Manually:<br/>1. Install [autopep8 (`autopep8`)](https://github.com/hhatto/autopep8) by following https://github.com/hhatto/autopep8#installation<br/>2. Install [isort (`isort`)](https://github.com/timothycrosley/isort) by following https://github.com/timothycrosley/isort#installing-isort<br/> |
|
||||
| beautysh | :warning: 1 executable | :white_check_mark: :100:% of executables | :whale: With [Docker](https://www.docker.com/):<br/>1. Install [beautysh (`beautysh`)](https://github.com/bemeurer/beautysh) with `docker pull unibeautify/beautysh`<br/><br/>:bookmark_tabs: Manually:<br/>1. Install [beautysh (`beautysh`)](https://github.com/bemeurer/beautysh) by following https://github.com/bemeurer/beautysh#installation<br/> |
|
||||
| brittany | :warning: Manual installation | :construction: Not an executable | :page_facing_up: Go to https://github.com/lspitzner/brittany and follow the instructions. |
|
||||
| clang-format | :warning: 1 executable | :white_check_mark: :100:% of executables | :whale: With [Docker](https://www.docker.com/):<br/>1. Install [ClangFormat (`clang-format`)](https://clang.llvm.org/docs/ClangFormat.html) with `docker pull unibeautify/clang-format`<br/><br/>:bookmark_tabs: Manually:<br/>1. Install [ClangFormat (`clang-format`)](https://clang.llvm.org/docs/ClangFormat.html) by following https://clang.llvm.org/docs/ClangFormat.html<br/> |
|
||||
| cljfmt | :white_check_mark: | :ok_hand: Not necessary | :smiley: Nothing! |
|
||||
| Coffee Formatter | :white_check_mark: | :ok_hand: Not necessary | :smiley: Nothing! |
|
||||
|
@ -107,6 +108,7 @@ Some of the supported beautifiers are developed for Node.js and are automaticall
|
|||
| gofmt | :warning: Manual installation | :construction: Not an executable | :page_facing_up: Go to https://golang.org/cmd/gofmt/ and follow the instructions. |
|
||||
| goimports | :warning: 1 executable | :white_check_mark: :100:% of executables | :whale: With [Docker](https://www.docker.com/):<br/>1. Install [goimports (`goimports`)](https://godoc.org/golang.org/x/tools/cmd/goimports) with `docker pull unibeautify/goimports`<br/><br/>:bookmark_tabs: Manually:<br/>1. Install [goimports (`goimports`)](https://godoc.org/golang.org/x/tools/cmd/goimports) by following https://godoc.org/golang.org/x/tools/cmd/goimports<br/> |
|
||||
| hh_format | :warning: Manual installation | :construction: Not an executable | :page_facing_up: Go to http://hhvm.com/ and follow the instructions. |
|
||||
| hindent | :warning: Manual installation | :construction: Not an executable | :page_facing_up: Go to https://github.com/commercialhaskell/hindent and follow the instructions. |
|
||||
| HTML Beautifier | :warning: Manual installation | :construction: Not an executable | :page_facing_up: Go to https://github.com/threedaymonk/htmlbeautifier and follow the instructions. |
|
||||
| JS Beautify | :white_check_mark: | :ok_hand: Not necessary | :smiley: Nothing! |
|
||||
| JSCS Fixer | :white_check_mark: | :ok_hand: Not necessary | :smiley: Nothing! |
|
||||
|
@ -166,7 +168,7 @@ See [all supported options in the documentation at `docs/options.md`](docs/opti
|
|||
| Go | `Go` |`.go` | **[`gofmt`](https://golang.org/cmd/gofmt/)**, [`goimports`](https://godoc.org/golang.org/x/tools/cmd/goimports) |
|
||||
| Golang Template | `HTML (Go)`, `Go Template` |`.gohtml` | **[`Pretty Diff`](https://github.com/prettydiff/prettydiff)** |
|
||||
| Handlebars | `Handlebars`, `HTML (Handlebars)` |`.hbs`, `.handlebars` | **[`JS Beautify`](https://github.com/beautify-web/js-beautify)**, [`Pretty Diff`](https://github.com/prettydiff/prettydiff) |
|
||||
| Haskell | `Haskell` |`.hs` | **[`stylish-haskell`](https://github.com/jaspervdj/stylish-haskell)** |
|
||||
| Haskell | `Haskell` |`.hs` | **[`stylish-haskell`](https://github.com/jaspervdj/stylish-haskell)**, [`brittany`](https://github.com/lspitzner/brittany), [`hindent`](https://github.com/commercialhaskell/hindent) |
|
||||
| HTML | `HTML` |`.html` | **[`JS Beautify`](https://github.com/beautify-web/js-beautify)**, [`Pretty Diff`](https://github.com/prettydiff/prettydiff) |
|
||||
| Jade | `Jade`, `Pug` |`.jade`, `.pug` | **[`Pug Beautify`](https://github.com/vingorius/pug-beautify)** |
|
||||
| Java | `Java` |`.java` | **[`Uncrustify`](https://github.com/uncrustify/uncrustify)** |
|
||||
|
|
|
@ -60,6 +60,11 @@
|
|||
Beautifiers
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href='class/Brittany.html'>
|
||||
Brittany
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
<ul>
|
||||
|
@ -150,6 +155,11 @@
|
|||
HTMLBeautifier
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href='class/Hindent.html'>
|
||||
Hindent
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
<ul>
|
||||
|
@ -419,6 +429,15 @@
|
|||
(src/languages)
|
||||
</small>
|
||||
</li>
|
||||
<li>
|
||||
<a href='file/src/beautifiers/brittany.coffee.html'>
|
||||
brittany.coffee
|
||||
</a>
|
||||
<small>
|
||||
(src/beautifiers)
|
||||
</small>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</ul>
|
||||
<ul>
|
||||
|
@ -713,6 +732,15 @@
|
|||
(src/languages)
|
||||
</small>
|
||||
</li>
|
||||
<li>
|
||||
<a href='file/src/beautifiers/hindent.coffee.html'>
|
||||
hindent.coffee
|
||||
</a>
|
||||
<small>
|
||||
(src/beautifiers)
|
||||
</small>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</ul>
|
||||
<ul>
|
||||
|
@ -1412,4 +1440,4 @@
|
|||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
=
|
||||
</dt>
|
||||
<dd>
|
||||
<pre><code class='coffeescript'>['uncrustify', 'autopep8', 'coffee-formatter', 'coffee-fmt', 'cljfmt', 'clang-format', 'crystal', 'dfmt', 'elm-format', 'htmlbeautifier', 'csscomb', 'gherkin', 'gofmt', 'latex-beautify', 'fortran-beautifier', 'js-beautify', 'jscs', 'lua-beautifier', 'ocp-indent', 'perltidy', 'php-cs-fixer', 'phpcbf', 'prettydiff', 'pug-beautify', 'puppet-fix', 'remark', 'rubocop', 'ruby-beautify', 'rustfmt', 'sass-convert', 'sqlformat', 'stylish-haskell', 'tidy-markdown', 'typescript-formatter', 'vue-beautifier', 'yapf', 'erl_tidy', 'marko-beautifier', 'formatR', 'beautysh']</code></pre>
|
||||
<pre><code class='coffeescript'>['uncrustify', 'autopep8', 'brittany', 'coffee-formatter', 'coffee-fmt', 'cljfmt', 'clang-format', 'crystal', 'dfmt', 'elm-format', 'htmlbeautifier', 'csscomb', 'gherkin', 'gofmt', 'latex-beautify', 'fortran-beautifier', 'hindent', 'js-beautify', 'jscs', 'lua-beautifier', 'ocp-indent', 'perltidy', 'php-cs-fixer', 'phpcbf', 'prettydiff', 'pug-beautify', 'puppet-fix', 'remark', 'rubocop', 'ruby-beautify', 'rustfmt', 'sass-convert', 'sqlformat', 'stylish-haskell', 'tidy-markdown', 'typescript-formatter', 'vue-beautifier', 'yapf', 'erl_tidy', 'marko-beautifier', 'formatR', 'beautysh']</code></pre>
|
||||
<div class='docstring'>
|
||||
<p>List of beautifier names</p><p>To register a beautifier add its name here</p>
|
||||
</div>
|
||||
|
@ -83,7 +83,7 @@
|
|||
</dt>
|
||||
<dd>
|
||||
<pre><code class='coffeescript'>{}</code></pre>
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<h2>Instance Method Summary</h2>
|
||||
|
@ -97,7 +97,7 @@
|
|||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
From <a href="https://github.com/atom/notifications/blob/01779ade79e7196f1603b8c1fa31716aa4a33911/lib/notification-issue.coffee#L130">https://github.com/atom/notifications/blob/01779ade79e7196f1603b8c1fa31716aa4a33911/lib/notification-issue.coffee#L130</a>
|
||||
From <a href="https://github.com/atom/notifications/blob/01779ade79e7196f1603b8c1fa31716aa4a33911/lib/notification-issue.coffee#L130">https://github.com/atom/notifications/blob/01779ade79e7196f1603b8c1fa31716aa4a33911/lib/notification-issue.coffee#L130</a>
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
|
@ -208,7 +208,7 @@
|
|||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
CLI
|
||||
CLI
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
|
@ -269,7 +269,7 @@ lookups when liniting an entire project
|
|||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
Look for .jsbeautifierrc in file and home path, check env variables
|
||||
Look for .jsbeautifierrc in file and home path, check env variables
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
|
@ -345,7 +345,7 @@ lookups when liniting an entire project
|
|||
<b>getBeautifiers</b><span>(language)</span>
|
||||
<br>
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='getBeautifierForLanguage-dynamic'>
|
||||
|
@ -354,7 +354,7 @@ lookups when liniting an entire project
|
|||
<b>getBeautifierForLanguage</b><span>(language)</span>
|
||||
<br>
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='getLanguage-dynamic'>
|
||||
|
@ -363,7 +363,7 @@ lookups when liniting an entire project
|
|||
<b>getLanguage</b><span>(grammar, filePath)</span>
|
||||
<br>
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='getOptionsForLanguage-dynamic'>
|
||||
|
@ -372,7 +372,7 @@ lookups when liniting an entire project
|
|||
<b>getOptionsForLanguage</b><span>(allOptions, language)</span>
|
||||
<br>
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='transformOptions-dynamic'>
|
||||
|
@ -381,7 +381,7 @@ lookups when liniting an entire project
|
|||
<b>transformOptions</b><span>(beautifier, languageName, options)</span>
|
||||
<br>
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='trackEvent-dynamic'>
|
||||
|
@ -390,7 +390,7 @@ lookups when liniting an entire project
|
|||
<b>trackEvent</b><span>(payload)</span>
|
||||
<br>
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='trackTiming-dynamic'>
|
||||
|
@ -399,7 +399,7 @@ lookups when liniting an entire project
|
|||
<b>trackTiming</b><span>(payload)</span>
|
||||
<br>
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='track-dynamic'>
|
||||
|
@ -408,7 +408,7 @@ lookups when liniting an entire project
|
|||
<b>track</b><span>(type, payload)</span>
|
||||
<br>
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='beautify-dynamic'>
|
||||
|
@ -417,7 +417,7 @@ lookups when liniting an entire project
|
|||
<b>beautify</b><span>(text, allOptions, grammar, filePath, {onSave} = {})</span>
|
||||
<br>
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='getUserHome-dynamic'>
|
||||
|
@ -439,7 +439,7 @@ lookups when liniting an entire project
|
|||
<b>verifyExists</b><span>(fullPath)</span>
|
||||
<br>
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='findFile-dynamic'>
|
||||
|
@ -511,7 +511,7 @@ or in the home directory. Configuration files are named
|
|||
<b>getConfigOptionsFromSettings</b><span>(langs)</span>
|
||||
<br>
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='getConfig-dynamic'>
|
||||
|
@ -533,7 +533,7 @@ or in the home directory. Configuration files are named
|
|||
<b>getOptionsForPath</b><span>(editedFilePath, editor)</span>
|
||||
<br>
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='isNestedOptions-dynamic'>
|
||||
|
@ -542,7 +542,7 @@ or in the home directory. Configuration files are named
|
|||
<b>isNestedOptions</b><span>(currOptions)</span>
|
||||
<br>
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='getOptions-dynamic'>
|
||||
|
@ -552,7 +552,7 @@ or in the home directory. Configuration files are named
|
|||
<span class='bound note'>Bound</span>
|
||||
<br>
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -628,4 +628,4 @@ or in the home directory. Configuration files are named
|
|||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
|
|
@ -0,0 +1,204 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset='UTF-8'>
|
||||
<title>Atom-Beautify Documentation</title>
|
||||
<script src='../javascript/application.js'></script>
|
||||
<script src='../javascript/search.js'></script>
|
||||
<link rel='stylesheet' href='../stylesheets/application.css' type='text/css'>
|
||||
</head>
|
||||
<body>
|
||||
<div id='base' data-path='../'></div>
|
||||
<div id='header'>
|
||||
<div id='menu'>
|
||||
<a href='../extra/README.md.html' title='Atom-Beautify'>
|
||||
Atom-Beautify
|
||||
</a>
|
||||
»
|
||||
<a href='../alphabetical_index.html' title='Index'>
|
||||
Index
|
||||
</a>
|
||||
»
|
||||
<span class='title'>Brittany</span>
|
||||
</div>
|
||||
</div>
|
||||
<div id='content'>
|
||||
<h1>
|
||||
Class:
|
||||
Brittany
|
||||
</h1>
|
||||
<table class='box'>
|
||||
<tr>
|
||||
<td>Defined in:</td>
|
||||
<td>src/beautifiers/brittany.coffee</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Inherits:</td>
|
||||
<td>
|
||||
<a href='../class/Beautifier.html'>Beautifier</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2>Variables Summary</h2>
|
||||
<dl class='constants'>
|
||||
<dt id='name-variable'>
|
||||
name
|
||||
=
|
||||
</dt>
|
||||
<dd>
|
||||
<pre><code class='coffeescript'>"brittany"</code></pre>
|
||||
|
||||
</dd>
|
||||
<dt id='link-variable'>
|
||||
link
|
||||
=
|
||||
</dt>
|
||||
<dd>
|
||||
<pre><code class='coffeescript'>"https://github.com/lspitzner/brittany"</code></pre>
|
||||
|
||||
</dd>
|
||||
<dt id='options-variable'>
|
||||
options
|
||||
=
|
||||
</dt>
|
||||
<dd>
|
||||
<pre><code class='coffeescript'>{
|
||||
Haskell: true
|
||||
}</code></pre>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<h3 class='inherited'>
|
||||
Variable inherited from
|
||||
<a href='../class/Beautifier.html'>Beautifier</a>
|
||||
</h3>
|
||||
<p class='inherited'>
|
||||
<a href='../class/Beautifier.html#Promise-variable'>Promise</a>
|
||||
<a href='../class/Beautifier.html#name-variable'>name</a>
|
||||
<a href='../class/Beautifier.html#options-variable'>options</a>
|
||||
<a href='../class/Beautifier.html#languages-variable'>languages</a>
|
||||
<a href='../class/Beautifier.html#beautify-variable'>beautify</a>
|
||||
<a href='../class/Beautifier.html#_envCache-variable'>_envCache</a>
|
||||
<a href='../class/Beautifier.html#_envCacheDate-variable'>_envCacheDate</a>
|
||||
<a href='../class/Beautifier.html#_envCacheExpiry-variable'>_envCacheExpiry</a>
|
||||
<a href='../class/Beautifier.html#logger-variable'>logger</a>
|
||||
</p>
|
||||
<h2>Instance Method Summary</h2>
|
||||
<ul class='summary'>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#beautify-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>beautify</b><span>(text, language, options)</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
<h2>
|
||||
<small>Inherited Method Summary</small>
|
||||
<h3 class='inherited'>
|
||||
Methods inherited from
|
||||
<a href='../class/Beautifier.html'>Beautifier</a>
|
||||
</h3>
|
||||
<p class='inherited'>
|
||||
<a href='../class/Beautifier.html#deprecate-dynamic'>#deprecate</a>
|
||||
<a href='../class/Beautifier.html#tempFile-dynamic'>#tempFile</a>
|
||||
<a href='../class/Beautifier.html#readFile-dynamic'>#readFile</a>
|
||||
<a href='../class/Beautifier.html#findFile-dynamic'>#findFile</a>
|
||||
<a href='../class/Beautifier.html#getShellEnvironment-dynamic'>#getShellEnvironment</a>
|
||||
<a href='../class/Beautifier.html#which-dynamic'>#which</a>
|
||||
<a href='../class/Beautifier.html#commandNotFoundError-dynamic'>#commandNotFoundError</a>
|
||||
<a href='../class/Beautifier.html#run-dynamic'>#run</a>
|
||||
<a href='../class/Beautifier.html#spawn-dynamic'>#spawn</a>
|
||||
<a href='../class/Beautifier.html#setupLogger-dynamic'>#setupLogger</a>
|
||||
</p>
|
||||
</h2>
|
||||
<h2>Instance Method Details</h2>
|
||||
<div class='methods'>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='beautify-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>beautify</b><span>(text, language, options)</span>
|
||||
<br>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id='footer'>
|
||||
By
|
||||
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
|
||||
Codo
|
||||
</a>
|
||||
2.1.2
|
||||
✲
|
||||
Press H to see the keyboard shortcuts
|
||||
✲
|
||||
<a href='http://twitter.com/netzpirat' target='_parent'>@netzpirat</a>
|
||||
✲
|
||||
<a href='http://twitter.com/_inossidabile' target='_parent'>@_inossidabile</a>
|
||||
</div>
|
||||
<iframe id='search_frame'></iframe>
|
||||
<div id='fuzzySearch'>
|
||||
<input type='text'>
|
||||
<ol></ol>
|
||||
</div>
|
||||
<div id='help'>
|
||||
<p>
|
||||
Quickly fuzzy find classes, mixins, methods, file:
|
||||
</p>
|
||||
<ul>
|
||||
<li>
|
||||
<span>T</span>
|
||||
Open fuzzy finder dialog
|
||||
</li>
|
||||
</ul>
|
||||
<p>
|
||||
Control the navigation frame:
|
||||
</p>
|
||||
<ul>
|
||||
<li>
|
||||
<span>L</span>
|
||||
Toggle list view
|
||||
</li>
|
||||
<li>
|
||||
<span>C</span>
|
||||
Show class list
|
||||
</li>
|
||||
<li>
|
||||
<span>I</span>
|
||||
Show mixin list
|
||||
</li>
|
||||
<li>
|
||||
<span>F</span>
|
||||
Show file list
|
||||
</li>
|
||||
<li>
|
||||
<span>M</span>
|
||||
Show method list
|
||||
</li>
|
||||
<li>
|
||||
<span>E</span>
|
||||
Show extras list
|
||||
</li>
|
||||
</ul>
|
||||
<p>
|
||||
You can focus and blur the search input:
|
||||
</p>
|
||||
<ul>
|
||||
<li>
|
||||
<span>S</span>
|
||||
Focus search input
|
||||
</li>
|
||||
<li>
|
||||
<span>Esc</span>
|
||||
Blur search input
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,204 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset='UTF-8'>
|
||||
<title>Atom-Beautify Documentation</title>
|
||||
<script src='../javascript/application.js'></script>
|
||||
<script src='../javascript/search.js'></script>
|
||||
<link rel='stylesheet' href='../stylesheets/application.css' type='text/css'>
|
||||
</head>
|
||||
<body>
|
||||
<div id='base' data-path='../'></div>
|
||||
<div id='header'>
|
||||
<div id='menu'>
|
||||
<a href='../extra/README.md.html' title='Atom-Beautify'>
|
||||
Atom-Beautify
|
||||
</a>
|
||||
»
|
||||
<a href='../alphabetical_index.html' title='Index'>
|
||||
Index
|
||||
</a>
|
||||
»
|
||||
<span class='title'>Hindent</span>
|
||||
</div>
|
||||
</div>
|
||||
<div id='content'>
|
||||
<h1>
|
||||
Class:
|
||||
Hindent
|
||||
</h1>
|
||||
<table class='box'>
|
||||
<tr>
|
||||
<td>Defined in:</td>
|
||||
<td>src/beautifiers/hindent.coffee</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Inherits:</td>
|
||||
<td>
|
||||
<a href='../class/Beautifier.html'>Beautifier</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2>Variables Summary</h2>
|
||||
<dl class='constants'>
|
||||
<dt id='name-variable'>
|
||||
name
|
||||
=
|
||||
</dt>
|
||||
<dd>
|
||||
<pre><code class='coffeescript'>"hindent"</code></pre>
|
||||
|
||||
</dd>
|
||||
<dt id='link-variable'>
|
||||
link
|
||||
=
|
||||
</dt>
|
||||
<dd>
|
||||
<pre><code class='coffeescript'>"https://github.com/commercialhaskell/hindent"</code></pre>
|
||||
|
||||
</dd>
|
||||
<dt id='options-variable'>
|
||||
options
|
||||
=
|
||||
</dt>
|
||||
<dd>
|
||||
<pre><code class='coffeescript'>{
|
||||
Haskell: true
|
||||
}</code></pre>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<h3 class='inherited'>
|
||||
Variable inherited from
|
||||
<a href='../class/Beautifier.html'>Beautifier</a>
|
||||
</h3>
|
||||
<p class='inherited'>
|
||||
<a href='../class/Beautifier.html#Promise-variable'>Promise</a>
|
||||
<a href='../class/Beautifier.html#name-variable'>name</a>
|
||||
<a href='../class/Beautifier.html#options-variable'>options</a>
|
||||
<a href='../class/Beautifier.html#languages-variable'>languages</a>
|
||||
<a href='../class/Beautifier.html#beautify-variable'>beautify</a>
|
||||
<a href='../class/Beautifier.html#_envCache-variable'>_envCache</a>
|
||||
<a href='../class/Beautifier.html#_envCacheDate-variable'>_envCacheDate</a>
|
||||
<a href='../class/Beautifier.html#_envCacheExpiry-variable'>_envCacheExpiry</a>
|
||||
<a href='../class/Beautifier.html#logger-variable'>logger</a>
|
||||
</p>
|
||||
<h2>Instance Method Summary</h2>
|
||||
<ul class='summary'>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#beautify-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>beautify</b><span>(text, language, options)</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
<h2>
|
||||
<small>Inherited Method Summary</small>
|
||||
<h3 class='inherited'>
|
||||
Methods inherited from
|
||||
<a href='../class/Beautifier.html'>Beautifier</a>
|
||||
</h3>
|
||||
<p class='inherited'>
|
||||
<a href='../class/Beautifier.html#deprecate-dynamic'>#deprecate</a>
|
||||
<a href='../class/Beautifier.html#tempFile-dynamic'>#tempFile</a>
|
||||
<a href='../class/Beautifier.html#readFile-dynamic'>#readFile</a>
|
||||
<a href='../class/Beautifier.html#findFile-dynamic'>#findFile</a>
|
||||
<a href='../class/Beautifier.html#getShellEnvironment-dynamic'>#getShellEnvironment</a>
|
||||
<a href='../class/Beautifier.html#which-dynamic'>#which</a>
|
||||
<a href='../class/Beautifier.html#commandNotFoundError-dynamic'>#commandNotFoundError</a>
|
||||
<a href='../class/Beautifier.html#run-dynamic'>#run</a>
|
||||
<a href='../class/Beautifier.html#spawn-dynamic'>#spawn</a>
|
||||
<a href='../class/Beautifier.html#setupLogger-dynamic'>#setupLogger</a>
|
||||
</p>
|
||||
</h2>
|
||||
<h2>Instance Method Details</h2>
|
||||
<div class='methods'>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='beautify-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>beautify</b><span>(text, language, options)</span>
|
||||
<br>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id='footer'>
|
||||
By
|
||||
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
|
||||
Codo
|
||||
</a>
|
||||
2.1.2
|
||||
✲
|
||||
Press H to see the keyboard shortcuts
|
||||
✲
|
||||
<a href='http://twitter.com/netzpirat' target='_parent'>@netzpirat</a>
|
||||
✲
|
||||
<a href='http://twitter.com/_inossidabile' target='_parent'>@_inossidabile</a>
|
||||
</div>
|
||||
<iframe id='search_frame'></iframe>
|
||||
<div id='fuzzySearch'>
|
||||
<input type='text'>
|
||||
<ol></ol>
|
||||
</div>
|
||||
<div id='help'>
|
||||
<p>
|
||||
Quickly fuzzy find classes, mixins, methods, file:
|
||||
</p>
|
||||
<ul>
|
||||
<li>
|
||||
<span>T</span>
|
||||
Open fuzzy finder dialog
|
||||
</li>
|
||||
</ul>
|
||||
<p>
|
||||
Control the navigation frame:
|
||||
</p>
|
||||
<ul>
|
||||
<li>
|
||||
<span>L</span>
|
||||
Toggle list view
|
||||
</li>
|
||||
<li>
|
||||
<span>C</span>
|
||||
Show class list
|
||||
</li>
|
||||
<li>
|
||||
<span>I</span>
|
||||
Show mixin list
|
||||
</li>
|
||||
<li>
|
||||
<span>F</span>
|
||||
Show file list
|
||||
</li>
|
||||
<li>
|
||||
<span>M</span>
|
||||
Show method list
|
||||
</li>
|
||||
<li>
|
||||
<span>E</span>
|
||||
Show extras list
|
||||
</li>
|
||||
</ul>
|
||||
<p>
|
||||
You can focus and blur the search input:
|
||||
</p>
|
||||
<ul>
|
||||
<li>
|
||||
<span>S</span>
|
||||
Focus search input
|
||||
</li>
|
||||
<li>
|
||||
<span>Esc</span>
|
||||
Blur search input
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,123 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset='UTF-8'>
|
||||
<title>Atom-Beautify Documentation</title>
|
||||
<script src='../../../javascript/application.js'></script>
|
||||
<script src='../../../javascript/search.js'></script>
|
||||
<link rel='stylesheet' href='../../../stylesheets/application.css' type='text/css'>
|
||||
</head>
|
||||
<body>
|
||||
<div id='base' data-path='../../../'></div>
|
||||
<div id='header'>
|
||||
<div id='menu'>
|
||||
<a href='../../../extra/README.md.html' title='Atom-Beautify'>
|
||||
Atom-Beautify
|
||||
</a>
|
||||
»
|
||||
<a href='../../../alphabetical_index.html' title='Index'>
|
||||
Index
|
||||
</a>
|
||||
»
|
||||
<span class='title'>src</span>
|
||||
»
|
||||
<span class='title'>beautifiers</span>
|
||||
»
|
||||
<span class='title'>brittany.coffee</span>
|
||||
</div>
|
||||
</div>
|
||||
<div id='content'>
|
||||
<h1>
|
||||
File:
|
||||
brittany.coffee
|
||||
</h1>
|
||||
<table class='box'>
|
||||
<tr>
|
||||
<td>Defined in:</td>
|
||||
<td>src/beautifiers</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
Classes:
|
||||
</td>
|
||||
<td>
|
||||
<a href='../../../class/Brittany.html'>
|
||||
StylishHaskell
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div id='footer'>
|
||||
By
|
||||
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
|
||||
Codo
|
||||
</a>
|
||||
2.1.2
|
||||
✲
|
||||
Press H to see the keyboard shortcuts
|
||||
✲
|
||||
<a href='http://twitter.com/netzpirat' target='_parent'>@netzpirat</a>
|
||||
✲
|
||||
<a href='http://twitter.com/_inossidabile' target='_parent'>@_inossidabile</a>
|
||||
</div>
|
||||
<iframe id='search_frame'></iframe>
|
||||
<div id='fuzzySearch'>
|
||||
<input type='text'>
|
||||
<ol></ol>
|
||||
</div>
|
||||
<div id='help'>
|
||||
<p>
|
||||
Quickly fuzzy find classes, mixins, methods, file:
|
||||
</p>
|
||||
<ul>
|
||||
<li>
|
||||
<span>T</span>
|
||||
Open fuzzy finder dialog
|
||||
</li>
|
||||
</ul>
|
||||
<p>
|
||||
Control the navigation frame:
|
||||
</p>
|
||||
<ul>
|
||||
<li>
|
||||
<span>L</span>
|
||||
Toggle list view
|
||||
</li>
|
||||
<li>
|
||||
<span>C</span>
|
||||
Show class list
|
||||
</li>
|
||||
<li>
|
||||
<span>I</span>
|
||||
Show mixin list
|
||||
</li>
|
||||
<li>
|
||||
<span>F</span>
|
||||
Show file list
|
||||
</li>
|
||||
<li>
|
||||
<span>M</span>
|
||||
Show method list
|
||||
</li>
|
||||
<li>
|
||||
<span>E</span>
|
||||
Show extras list
|
||||
</li>
|
||||
</ul>
|
||||
<p>
|
||||
You can focus and blur the search input:
|
||||
</p>
|
||||
<ul>
|
||||
<li>
|
||||
<span>S</span>
|
||||
Focus search input
|
||||
</li>
|
||||
<li>
|
||||
<span>Esc</span>
|
||||
Blur search input
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,123 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset='UTF-8'>
|
||||
<title>Atom-Beautify Documentation</title>
|
||||
<script src='../../../javascript/application.js'></script>
|
||||
<script src='../../../javascript/search.js'></script>
|
||||
<link rel='stylesheet' href='../../../stylesheets/application.css' type='text/css'>
|
||||
</head>
|
||||
<body>
|
||||
<div id='base' data-path='../../../'></div>
|
||||
<div id='header'>
|
||||
<div id='menu'>
|
||||
<a href='../../../extra/README.md.html' title='Atom-Beautify'>
|
||||
Atom-Beautify
|
||||
</a>
|
||||
»
|
||||
<a href='../../../alphabetical_index.html' title='Index'>
|
||||
Index
|
||||
</a>
|
||||
»
|
||||
<span class='title'>src</span>
|
||||
»
|
||||
<span class='title'>beautifiers</span>
|
||||
»
|
||||
<span class='title'>hindent.coffee</span>
|
||||
</div>
|
||||
</div>
|
||||
<div id='content'>
|
||||
<h1>
|
||||
File:
|
||||
hindent.coffee
|
||||
</h1>
|
||||
<table class='box'>
|
||||
<tr>
|
||||
<td>Defined in:</td>
|
||||
<td>src/beautifiers</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
Classes:
|
||||
</td>
|
||||
<td>
|
||||
<a href='../../../class/Hindent.html'>
|
||||
StylishHaskell
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div id='footer'>
|
||||
By
|
||||
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
|
||||
Codo
|
||||
</a>
|
||||
2.1.2
|
||||
✲
|
||||
Press H to see the keyboard shortcuts
|
||||
✲
|
||||
<a href='http://twitter.com/netzpirat' target='_parent'>@netzpirat</a>
|
||||
✲
|
||||
<a href='http://twitter.com/_inossidabile' target='_parent'>@_inossidabile</a>
|
||||
</div>
|
||||
<iframe id='search_frame'></iframe>
|
||||
<div id='fuzzySearch'>
|
||||
<input type='text'>
|
||||
<ol></ol>
|
||||
</div>
|
||||
<div id='help'>
|
||||
<p>
|
||||
Quickly fuzzy find classes, mixins, methods, file:
|
||||
</p>
|
||||
<ul>
|
||||
<li>
|
||||
<span>T</span>
|
||||
Open fuzzy finder dialog
|
||||
</li>
|
||||
</ul>
|
||||
<p>
|
||||
Control the navigation frame:
|
||||
</p>
|
||||
<ul>
|
||||
<li>
|
||||
<span>L</span>
|
||||
Toggle list view
|
||||
</li>
|
||||
<li>
|
||||
<span>C</span>
|
||||
Show class list
|
||||
</li>
|
||||
<li>
|
||||
<span>I</span>
|
||||
Show mixin list
|
||||
</li>
|
||||
<li>
|
||||
<span>F</span>
|
||||
Show file list
|
||||
</li>
|
||||
<li>
|
||||
<span>M</span>
|
||||
Show method list
|
||||
</li>
|
||||
<li>
|
||||
<span>E</span>
|
||||
Show extras list
|
||||
</li>
|
||||
</ul>
|
||||
<p>
|
||||
You can focus and blur the search input:
|
||||
</p>
|
||||
<ul>
|
||||
<li>
|
||||
<span>S</span>
|
||||
Focus search input
|
||||
</li>
|
||||
<li>
|
||||
<span>Esc</span>
|
||||
Blur search input
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -65,6 +65,14 @@
|
|||
src/beautifiers
|
||||
</small>
|
||||
</li>
|
||||
<li>
|
||||
<a href='file/src/beautifiers/brittany.coffee.html' target='main'>
|
||||
brittany.coffee
|
||||
</a>
|
||||
<small class='namespace'>
|
||||
src/beautifiers
|
||||
</small>
|
||||
</li>
|
||||
<li>
|
||||
<a href='file/src/beautifiers/clang-format.coffee.html' target='main'>
|
||||
clang-format.coffee
|
||||
|
@ -88,7 +96,7 @@
|
|||
</small>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href='file/src/beautifiers/coffee-fmt.coffee.html' target='main'>
|
||||
coffee-fmt.coffee
|
||||
|
@ -160,7 +168,7 @@
|
|||
</small>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<li>
|
||||
<span>
|
||||
fortran-beautifier
|
||||
|
@ -176,7 +184,7 @@
|
|||
</small>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href='file/src/beautifiers/gherkin.coffee.html' target='main'>
|
||||
gherkin.coffee
|
||||
|
@ -193,6 +201,14 @@
|
|||
src/beautifiers
|
||||
</small>
|
||||
</li>
|
||||
<li>
|
||||
<a href='file/src/beautifiers/hindent.coffee.html' target='main'>
|
||||
hindent.coffee
|
||||
</a>
|
||||
<small class='namespace'>
|
||||
src/beautifiers
|
||||
</small>
|
||||
</li>
|
||||
<li>
|
||||
<a href='file/src/beautifiers/htmlbeautifier.coffee.html' target='main'>
|
||||
htmlbeautifier.coffee
|
||||
|
@ -248,7 +264,7 @@
|
|||
</small>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href='file/src/beautifiers/marko-beautifier.coffee.html' target='main'>
|
||||
marko-beautifier.coffee
|
||||
|
@ -408,7 +424,7 @@
|
|||
</small>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href='file/src/beautifiers/vue-beautifier.coffee.html' target='main'>
|
||||
vue-beautifier.coffee
|
||||
|
@ -426,7 +442,7 @@
|
|||
</small>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<li>
|
||||
<a href='file/src/beautify.coffee.html' target='main'>
|
||||
beautify.coffee
|
||||
|
@ -946,7 +962,7 @@
|
|||
</small>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<li>
|
||||
<span>
|
||||
views
|
||||
|
@ -970,11 +986,11 @@
|
|||
</small>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
|
|
@ -4315,13 +4315,13 @@ Maximum characters per line (0 disables) (Supported by JS Beautify, Pretty Diff)
|
|||
|
||||
#### [Haskell](#haskell)
|
||||
|
||||
**Supported Beautifiers**: [`stylish-haskell`](#stylish-haskell)
|
||||
**Supported Beautifiers**: [`brittany`](#brittany) [`hindent`](#hindent) [`stylish-haskell`](#stylish-haskell)
|
||||
|
||||
| Option | stylish-haskell |
|
||||
| --- | --- |
|
||||
| `disabled` | :white_check_mark: |
|
||||
| `default_beautifier` | :white_check_mark: |
|
||||
| `beautify_on_save` | :white_check_mark: |
|
||||
| Option | brittany | hindent | stylish-haskell |
|
||||
| --- | --- | --- | --- |
|
||||
| `disabled` | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|
||||
| `default_beautifier` | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|
||||
| `beautify_on_save` | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|
||||
|
||||
**Description**:
|
||||
|
||||
|
@ -4352,7 +4352,7 @@ Disable Haskell Beautification
|
|||
|
||||
**Type**: `string`
|
||||
|
||||
**Enum**: `stylish-haskell`
|
||||
**Enum**: `brittany` `hindent` `stylish-haskell`
|
||||
|
||||
**Description**:
|
||||
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
{-# LANGUAGE Wat #-}
|
||||
import Bar
|
||||
import Foo
|
||||
|
||||
import qualified Baz as Bang
|
||||
|
||||
data Person = Person {
|
||||
name :: String,
|
||||
address :: String
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
{-# LANGUAGE OverloadedStrings #-}
|
||||
module TypeFun where
|
||||
import Foo
|
||||
import Bar
|
||||
import qualified Baz as Bang
|
||||
import Data.Typeable
|
||||
|
||||
data Person = Person {
|
||||
name :: String,
|
||||
address :: String
|
||||
}
|
||||
|
||||
main :: IO ()
|
||||
main = do
|
||||
doSomethingOnType 'c'
|
||||
doSomethingOnType (35 :: Integer)
|
||||
doSomethingOnType "a string"
|
||||
|
||||
doSomethingOnType :: Typeable a => a -> IO ()
|
||||
doSomethingOnType a = case show (typeOf a) of
|
||||
"Char" -> print $ performActionOnChar a
|
||||
"Integer" -> print $ performActionOnInt a
|
||||
_ -> print "undefined!"
|
||||
|
||||
performActionOnChar :: Typeable a => a -> String
|
||||
performActionOnChar a = case cast a :: Maybe Char of
|
||||
Just c -> "Concatenating with string: " ++ [c]
|
||||
Nothing -> "Cast went wrong..."
|
||||
|
||||
performActionOnInt :: Typeable a => a -> String
|
||||
performActionOnInt a = case cast a :: Maybe Integer of
|
||||
Just i -> "Concatenating with string: " ++ show (i + 10)
|
||||
Nothing -> "Cast went wrong..."
|
|
@ -0,0 +1,38 @@
|
|||
{-# LANGUAGE OverloadedStrings #-}
|
||||
|
||||
module TypeFun where
|
||||
|
||||
import Bar
|
||||
import qualified Baz as Bang
|
||||
import Data.Typeable
|
||||
import Foo
|
||||
|
||||
data Person = Person
|
||||
{ name :: String
|
||||
, address :: String
|
||||
}
|
||||
|
||||
main :: IO ()
|
||||
main = do
|
||||
doSomethingOnType 'c'
|
||||
doSomethingOnType (35 :: Integer)
|
||||
doSomethingOnType "a string"
|
||||
|
||||
doSomethingOnType :: Typeable a => a -> IO ()
|
||||
doSomethingOnType a =
|
||||
case show (typeOf a) of
|
||||
"Char" -> print $ performActionOnChar a
|
||||
"Integer" -> print $ performActionOnInt a
|
||||
_ -> print "undefined!"
|
||||
|
||||
performActionOnChar :: Typeable a => a -> String
|
||||
performActionOnChar a =
|
||||
case cast a :: Maybe Char of
|
||||
Just c -> "Concatenating with string: " ++ [c]
|
||||
Nothing -> "Cast went wrong..."
|
||||
|
||||
performActionOnInt :: Typeable a => a -> String
|
||||
performActionOnInt a =
|
||||
case cast a :: Maybe Integer of
|
||||
Just i -> "Concatenating with string: " ++ show (i + 10)
|
||||
Nothing -> "Cast went wrong..."
|
|
@ -0,0 +1,36 @@
|
|||
{-# LANGUAGE OverloadedStrings #-}
|
||||
module TypeFun where
|
||||
import Bar
|
||||
import qualified Baz as Bang
|
||||
import Data.Typeable
|
||||
import Foo
|
||||
|
||||
data Person = Person {
|
||||
name :: String,
|
||||
address :: String
|
||||
}
|
||||
|
||||
main :: IO ()
|
||||
main = do
|
||||
doSomethingOnType 'c'
|
||||
doSomethingOnType (35 :: Integer)
|
||||
doSomethingOnType "a string"
|
||||
|
||||
doSomethingOnType :: Typeable a => a -> IO ()
|
||||
doSomethingOnType a =
|
||||
case show (typeOf a) of
|
||||
"Char" -> print $ performActionOnChar a
|
||||
"Integer" -> print $ performActionOnInt a
|
||||
_ -> print "undefined!"
|
||||
|
||||
performActionOnChar :: Typeable a => a -> String
|
||||
performActionOnChar a =
|
||||
case cast a :: Maybe Char of
|
||||
Just c -> "Concatenating with string: " ++ [c]
|
||||
Nothing -> "Cast went wrong..."
|
||||
|
||||
performActionOnInt :: Typeable a => a -> String
|
||||
performActionOnInt a =
|
||||
case cast a :: Maybe Integer of
|
||||
Just i -> "Concatenating with string: " ++ show (i + 10)
|
||||
Nothing -> "Cast went wrong..."
|
|
@ -1,10 +1,36 @@
|
|||
{-# LANGUAGE Wat #-}
|
||||
{-# LANGUAGE OverloadedStrings #-}
|
||||
module TypeFun where
|
||||
import Foo
|
||||
import Bar
|
||||
|
||||
import qualified Baz as Bang
|
||||
import Data.Typeable
|
||||
|
||||
data Person = Person {
|
||||
name :: String,
|
||||
address :: String
|
||||
}
|
||||
|
||||
main :: IO ()
|
||||
main = do
|
||||
doSomethingOnType 'c'
|
||||
doSomethingOnType (35 :: Integer)
|
||||
doSomethingOnType "a string"
|
||||
|
||||
doSomethingOnType :: Typeable a => a -> IO ()
|
||||
doSomethingOnType a =
|
||||
case show (typeOf a) of
|
||||
"Char" -> print $ performActionOnChar a
|
||||
"Integer" -> print $ performActionOnInt a
|
||||
_ -> print "undefined!"
|
||||
|
||||
performActionOnChar :: Typeable a => a -> String
|
||||
performActionOnChar a =
|
||||
case cast a :: Maybe Char of
|
||||
Just c -> "Concatenating with string: " ++ [c]
|
||||
Nothing -> "Cast went wrong..."
|
||||
|
||||
performActionOnInt :: Typeable a => a -> String
|
||||
performActionOnInt a =
|
||||
case cast a :: Maybe Integer of
|
||||
Just i -> "Concatenating with string: " ++ show (i + 10)
|
||||
Nothing -> "Cast went wrong..."
|
||||
|
|
|
@ -150,6 +150,11 @@
|
|||
{
|
||||
"name": "Steven Zeck",
|
||||
"url": "https://github.com/szeck87"
|
||||
},
|
||||
{
|
||||
"name": "Christian Kjær Laustsen",
|
||||
"email": "ckl@codetalk.io",
|
||||
"url": "https://github.com/Tehnix"
|
||||
}
|
||||
],
|
||||
"engines": {
|
||||
|
@ -344,6 +349,8 @@
|
|||
"gherkin",
|
||||
"fortran",
|
||||
"haskell",
|
||||
"hindent",
|
||||
"brittany",
|
||||
"jade",
|
||||
"jsx",
|
||||
"latex",
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
###
|
||||
Requires https://github.com/lspitzner/brittany
|
||||
###
|
||||
|
||||
"use strict"
|
||||
Beautifier = require('./beautifier')
|
||||
|
||||
module.exports = class Brittany extends Beautifier
|
||||
name: "brittany"
|
||||
link: "https://github.com/lspitzner/brittany"
|
||||
isPreInstalled: false
|
||||
|
||||
options: {
|
||||
Haskell: true
|
||||
}
|
||||
|
||||
beautify: (text, language, options) ->
|
||||
@run("brittany", [
|
||||
@tempFile("input", text)
|
||||
], {
|
||||
help: {
|
||||
link: "https://github.com/lspitzner/brittany"
|
||||
}
|
||||
})
|
|
@ -0,0 +1,27 @@
|
|||
###
|
||||
Requires https://github.com/commercialhaskell/hindent
|
||||
###
|
||||
|
||||
"use strict"
|
||||
Beautifier = require('./beautifier')
|
||||
|
||||
module.exports = class Hindent extends Beautifier
|
||||
name: "hindent"
|
||||
link: "https://github.com/commercialhaskell/hindent"
|
||||
isPreInstalled: false
|
||||
|
||||
options: {
|
||||
Haskell: true
|
||||
}
|
||||
|
||||
beautify: (text, language, options) ->
|
||||
@run("hindent", [
|
||||
tempFile = @tempFile("temp", text)
|
||||
], {
|
||||
help: {
|
||||
link: "https://github.com/commercialhaskell/hindent"
|
||||
}
|
||||
})
|
||||
.then(=>
|
||||
@readFile(tempFile)
|
||||
)
|
|
@ -37,6 +37,7 @@ module.exports = class Beautifiers extends EventEmitter
|
|||
'uncrustify'
|
||||
'align-yaml'
|
||||
'autopep8'
|
||||
'brittany'
|
||||
'coffee-formatter'
|
||||
'coffee-fmt'
|
||||
'cljfmt'
|
||||
|
@ -52,6 +53,7 @@ module.exports = class Beautifiers extends EventEmitter
|
|||
'goimports'
|
||||
'latex-beautify'
|
||||
'fortran-beautifier'
|
||||
'hindent'
|
||||
'js-beautify'
|
||||
'jscs'
|
||||
'eslint'
|
||||
|
|
|
@ -17,6 +17,8 @@ module.exports = {
|
|||
"hs"
|
||||
]
|
||||
|
||||
defaultBeautifier: "stylish-haskell"
|
||||
|
||||
options: []
|
||||
|
||||
}
|
||||
|
|
|
@ -2395,6 +2395,8 @@
|
|||
"description": "Options for language Haskell",
|
||||
"collapsed": true,
|
||||
"beautifiers": [
|
||||
"brittany",
|
||||
"hindent",
|
||||
"stylish-haskell"
|
||||
],
|
||||
"grammars": [
|
||||
|
@ -2418,6 +2420,8 @@
|
|||
"default": "stylish-haskell",
|
||||
"description": "Default Beautifier to be used for Haskell",
|
||||
"enum": [
|
||||
"brittany",
|
||||
"hindent",
|
||||
"stylish-haskell"
|
||||
]
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue