id stringlengths 34 124 | type stringclasses 4
values | prompt stringlengths 0 4.95k | response stringlengths 21 4.89k | source_lang stringclasses 3
values | target_lang stringclasses 2
values | repo stringclasses 75
values | path stringlengths 10 88 | license stringclasses 1
value | commit stringlengths 40 40 | stars int64 431 18.7k | source_url stringlengths 86 176 | line_start int64 1 214 | line_end int64 3 253 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
jianliaoim/talk-os:talk-web/client/guest-app/landing.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
React = require 'react'
lang = require '../locales/lang'
div = React.createFactory 'div'
module.exports = React.createClass
displayName: 'app-loading'
render: ->
div id: 'app-view',
div className: 'app-loading',
div className: 'talk-lo... | var React, div, lang;
React = require('react');
lang = require('../locales/lang');
div = React.createFactory('div');
module.exports = React.createClass({
displayName: 'app-loading',
render: function() {
return div({
id: 'app-view'
}, div({
className: 'app-loading'
}, div({
classNam... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/guest-app/landing.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/guest-app/landing.coffee | 1 | 15 |
jianliaoim/talk-os:talk-web/client/guest-app/landing.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var React, div, lang;
React = require('react');
lang = require('../locales/lang');
div = React.createFactory('div');
module.exports = React.createClass({
displayName: 'app-loading',
render: function() {
return div({
id: 'app-view'
}, div({
... | React = require 'react'
lang = require '../locales/lang'
div = React.createFactory 'div'
module.exports = React.createClass
displayName: 'app-loading'
render: ->
div id: 'app-view',
div className: 'app-loading',
div className: 'talk-logo'
div className: 'muted', lang.getText('landing... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/guest-app/landing.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/guest-app/landing.coffee | 1 | 15 |
jianliaoim/talk-os:talk-web/client/guest-app/landing.coffee:1:completion | completion | React = require 'react'
lang = require '../locales/lang'
div = React.createFactory 'div'
module.exports = React.createClass | displayName: 'app-loading'
render: ->
div id: 'app-view',
div className: 'app-loading',
div className: 'talk-logo'
div className: 'muted', lang.getText('landing-app') | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/guest-app/landing.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/guest-app/landing.coffee | 1 | 15 |
js2coffee/js2coffee:test/setup.coffee:1:raw_corpus | raw_corpus | before ->
global.expect = require('chai').expect
global.js2coffee = require('../index') | CoffeeScript | js2coffee/js2coffee | test/setup.coffee | MIT | 47d3159aba94ffd4377138f7837717d8628eef9f | 2,082 | https://github.com/js2coffee/js2coffee/blob/47d3159aba94ffd4377138f7837717d8628eef9f/test/setup.coffee | 1 | 3 | ||
js2coffee/js2coffee:test/setup.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
before ->
global.expect = require('chai').expect
global.js2coffee = require('../index')
``` | before(function() {
global.expect = require('chai').expect;
return global.js2coffee = require('../index');
}); | CoffeeScript | JavaScript | js2coffee/js2coffee | test/setup.coffee | MIT | 47d3159aba94ffd4377138f7837717d8628eef9f | 2,082 | https://github.com/js2coffee/js2coffee/blob/47d3159aba94ffd4377138f7837717d8628eef9f/test/setup.coffee | 1 | 3 |
js2coffee/js2coffee:test/setup.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
before(function() {
global.expect = require('chai').expect;
return global.js2coffee = require('../index');
});
``` | before ->
global.expect = require('chai').expect
global.js2coffee = require('../index') | JavaScript | CoffeeScript | js2coffee/js2coffee | test/setup.coffee | MIT | 47d3159aba94ffd4377138f7837717d8628eef9f | 2,082 | https://github.com/js2coffee/js2coffee/blob/47d3159aba94ffd4377138f7837717d8628eef9f/test/setup.coffee | 1 | 3 |
orktes/atom-react:index.coffee:1:raw_corpus | raw_corpus | isJSX = (text) ->
docblock = require 'jstransform/src/docblock'
doc = docblock.parse text;
for b in doc
return true if b[0] == 'jsx'
false | CoffeeScript | orktes/atom-react | index.coffee | MIT | 0565a0f5b987f8ac853367e1fd74bba13c7c5a4f | 473 | https://github.com/orktes/atom-react/blob/0565a0f5b987f8ac853367e1fd74bba13c7c5a4f/index.coffee | 5 | 10 | ||
orktes/atom-react:index.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
isJSX = (text) ->
docblock = require 'jstransform/src/docblock'
doc = docblock.parse text;
for b in doc
return true if b[0] == 'jsx'
false
``` | var isJSX;
isJSX = function(text) {
var b, doc, docblock, i, len;
docblock = require('jstransform/src/docblock');
doc = docblock.parse(text);
for (i = 0, len = doc.length; i < len; i++) {
b = doc[i];
if (b[0] === 'jsx') {
return true;
}
}
return false;
}; | CoffeeScript | JavaScript | orktes/atom-react | index.coffee | MIT | 0565a0f5b987f8ac853367e1fd74bba13c7c5a4f | 473 | https://github.com/orktes/atom-react/blob/0565a0f5b987f8ac853367e1fd74bba13c7c5a4f/index.coffee | 5 | 10 |
orktes/atom-react:index.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var isJSX;
isJSX = function(text) {
var b, doc, docblock, i, len;
docblock = require('jstransform/src/docblock');
doc = docblock.parse(text);
for (i = 0, len = doc.length; i < len; i++) {
b = doc[i];
if (b[0] === 'jsx') {
return true;
}
... | isJSX = (text) ->
docblock = require 'jstransform/src/docblock'
doc = docblock.parse text;
for b in doc
return true if b[0] == 'jsx'
false | JavaScript | CoffeeScript | orktes/atom-react | index.coffee | MIT | 0565a0f5b987f8ac853367e1fd74bba13c7c5a4f | 473 | https://github.com/orktes/atom-react/blob/0565a0f5b987f8ac853367e1fd74bba13c7c5a4f/index.coffee | 5 | 10 |
orktes/atom-react:index.coffee:1:completion | completion | isJSX = (text) ->
docblock = require 'jstransform/src/docblock'
doc = docblock.parse text; | for b in doc
return true if b[0] == 'jsx'
false | CoffeeScript | CoffeeScript | orktes/atom-react | index.coffee | MIT | 0565a0f5b987f8ac853367e1fd74bba13c7c5a4f | 473 | https://github.com/orktes/atom-react/blob/0565a0f5b987f8ac853367e1fd74bba13c7c5a4f/index.coffee | 5 | 10 |
orktes/atom-react:index.coffee:3:raw_corpus | raw_corpus | return indent if not precedingLine?
indent += 1 if tagStartRegex.testSync(precedingLine) and complexAttributeRegex.testSync(precedingLine)
indent -= 1 if precedingLine and decreaseNextLineIndentRegex.testSync(precedingLine)
return Math.max(indent, 0)
patchEditorLangMode: (editor) ->
@patchEdi... | CoffeeScript | orktes/atom-react | index.coffee | MIT | 0565a0f5b987f8ac853367e1fd74bba13c7c5a4f | 473 | https://github.com/orktes/atom-react/blob/0565a0f5b987f8ac853367e1fd74bba13c7c5a4f/index.coffee | 62 | 111 | ||
orktes/atom-react:index.coffee:3:completion | completion | return indent if not precedingLine?
indent += 1 if tagStartRegex.testSync(precedingLine) and complexAttributeRegex.testSync(precedingLine)
indent -= 1 if precedingLine and decreaseNextLineIndentRegex.testSync(precedingLine)
return Math.max(indent, 0)
patchEditorLangMode: (editor) ->
@patchEdi... | selections = editor.getSelections()
editor.transact =>
for selection in selections
try
selectionText = selection.getText()
jsxOutput = converter.convert(selectionText)
try
jsxformat.setOptions({});
jsxOutput = jsxformat.format(jsxOutput)
... | CoffeeScript | CoffeeScript | orktes/atom-react | index.coffee | MIT | 0565a0f5b987f8ac853367e1fd74bba13c7c5a4f | 473 | https://github.com/orktes/atom-react/blob/0565a0f5b987f8ac853367e1fd74bba13c7c5a4f/index.coffee | 62 | 111 |
orktes/atom-react:index.coffee:4:raw_corpus | raw_corpus | result = jsxformat.format(selection.getText())
selection.insertText(result, {autoIndent: true});
editor.setCursorBufferPosition(bufStart)
catch err
# Parsing/formatting the selection failed lets try to parse the whole file but format the selection only
range = selection.g... | CoffeeScript | orktes/atom-react | index.coffee | MIT | 0565a0f5b987f8ac853367e1fd74bba13c7c5a4f | 473 | https://github.com/orktes/atom-react/blob/0565a0f5b987f8ac853367e1fd74bba13c7c5a4f/index.coffee | 112 | 161 | ||
orktes/atom-react:index.coffee:4:completion | completion | result = jsxformat.format(selection.getText())
selection.insertText(result, {autoIndent: true});
editor.setCursorBufferPosition(bufStart)
catch err
# Parsing/formatting the selection failed lets try to parse the whole file but format the selection only
range = selection.g... | editor.autoIndentBufferRows(firstChangedLine, lastChangedLine)
# return back
editor.setCursorBufferPosition([firstChangedLine, range[0][1]])
processEditor: (editor) ->
@patchEditorLangMode(editor)
@autoSetGrammar(editor)
activate: ->
jsxTagStartPattern = '(?x)((^|=|return)\\s... | CoffeeScript | CoffeeScript | orktes/atom-react | index.coffee | MIT | 0565a0f5b987f8ac853367e1fd74bba13c7c5a4f | 473 | https://github.com/orktes/atom-react/blob/0565a0f5b987f8ac853367e1fd74bba13c7c5a4f/index.coffee | 112 | 161 |
orktes/atom-react:index.coffee:5:raw_corpus | raw_corpus | @processEditor(editor) for editor in atom.workspace.getTextEditors()
@subscribe atom.workspace.onDidAddTextEditor (event) =>
editor = event.textEditor
@processEditor(editor) | CoffeeScript | orktes/atom-react | index.coffee | MIT | 0565a0f5b987f8ac853367e1fd74bba13c7c5a4f | 473 | https://github.com/orktes/atom-react/blob/0565a0f5b987f8ac853367e1fd74bba13c7c5a4f/index.coffee | 162 | 166 | ||
orktes/atom-react:index.coffee:5:completion | completion | @processEditor(editor) for editor in atom.workspace.getTextEditors() | @subscribe atom.workspace.onDidAddTextEditor (event) =>
editor = event.textEditor
@processEditor(editor) | CoffeeScript | CoffeeScript | orktes/atom-react | index.coffee | MIT | 0565a0f5b987f8ac853367e1fd74bba13c7c5a4f | 473 | https://github.com/orktes/atom-react/blob/0565a0f5b987f8ac853367e1fd74bba13c7c5a4f/index.coffee | 162 | 166 |
orktes/atom-react:index.coffee:4:raw_corpus | raw_corpus | result = jsxformat.format(selection.getText())
selection.insertText(result, {autoIndent: true});
editor.setCursorBufferPosition(bufStart)
catch err
# Parsing/formatting the selection failed lets try to parse the whole file but format the selection only
range = selection.g... | CoffeeScript | orktes/atom-react | index.coffee | MIT | ee6efbc894a1b36901136d62303ee51d57ef00bb | 473 | https://github.com/orktes/atom-react/blob/ee6efbc894a1b36901136d62303ee51d57ef00bb/index.coffee | 112 | 161 | ||
orktes/atom-react:index.coffee:4:completion | completion | result = jsxformat.format(selection.getText())
selection.insertText(result, {autoIndent: true});
editor.setCursorBufferPosition(bufStart)
catch err
# Parsing/formatting the selection failed lets try to parse the whole file but format the selection only
range = selection.g... | editor.autoIndentBufferRows(firstChangedLine, lastChangedLine)
# return back
editor.setCursorBufferPosition([firstChangedLine, range[0][1]])
processEditor: (editor) ->
@patchEditorLangMode(editor)
@autoSetGrammar(editor)
activate: ->
jsxTagStartPattern = '(?x)((^|=|return)\\s... | CoffeeScript | CoffeeScript | orktes/atom-react | index.coffee | MIT | ee6efbc894a1b36901136d62303ee51d57ef00bb | 473 | https://github.com/orktes/atom-react/blob/ee6efbc894a1b36901136d62303ee51d57ef00bb/index.coffee | 112 | 161 |
orktes/atom-react:index.coffee:3:raw_corpus | raw_corpus | return indent if not precedingLine?
indent += 1 if tagStartRegex.testSync(precedingLine) and complexAttributeRegex.testSync(precedingLine)
indent -= 1 if precedingLine and decreaseNextLineIndentRegex.testSync(precedingLine)
return Math.max(indent, 0)
patchEditorLangMode: (editor) ->
@patchEdi... | CoffeeScript | orktes/atom-react | index.coffee | MIT | 08981b61257087f3794fd2a299ec13b539e51764 | 473 | https://github.com/orktes/atom-react/blob/08981b61257087f3794fd2a299ec13b539e51764/index.coffee | 62 | 111 | ||
orktes/atom-react:index.coffee:3:completion | completion | return indent if not precedingLine?
indent += 1 if tagStartRegex.testSync(precedingLine) and complexAttributeRegex.testSync(precedingLine)
indent -= 1 if precedingLine and decreaseNextLineIndentRegex.testSync(precedingLine)
return Math.max(indent, 0)
patchEditorLangMode: (editor) ->
@patchEdi... | selections = editor.getSelections()
editor.transact =>
for selection in selections
try
selectionText = selection.getText()
jsxOutput = converter.convert(selectionText)
try
jsxformat.setOptions({});
jsxOutput = jsxformat.format(jsxOutput)
... | CoffeeScript | CoffeeScript | orktes/atom-react | index.coffee | MIT | 08981b61257087f3794fd2a299ec13b539e51764 | 473 | https://github.com/orktes/atom-react/blob/08981b61257087f3794fd2a299ec13b539e51764/index.coffee | 62 | 111 |
orktes/atom-react:index.coffee:4:raw_corpus | raw_corpus | selection.insertText(result, {autoIndent: true});
catch err
# Parsing/formatting the selection failed lets try to parse the whole file but format the selection only
range = selection.getBufferRange().serialize()
# esprima ast line count starts for 1
range[0][0]++
... | CoffeeScript | orktes/atom-react | index.coffee | MIT | 08981b61257087f3794fd2a299ec13b539e51764 | 473 | https://github.com/orktes/atom-react/blob/08981b61257087f3794fd2a299ec13b539e51764/index.coffee | 112 | 161 | ||
orktes/atom-react:index.coffee:4:completion | completion | selection.insertText(result, {autoIndent: true});
catch err
# Parsing/formatting the selection failed lets try to parse the whole file but format the selection only
range = selection.getBufferRange().serialize()
# esprima ast line count starts for 1
range[0][0]++
... | editor.autoIndentBufferRows(firstChangedLine, lastChangedLine)
# return back
editor.setCursorBufferPosition([firstChangedLine, range[0][1]])
processEditor: (editor) ->
@patchEditorLangMode(editor)
@autoSetGrammar(editor)
activate: ->
jsxTagStartPattern = '(?x)((^|=|return)\\s... | CoffeeScript | CoffeeScript | orktes/atom-react | index.coffee | MIT | 08981b61257087f3794fd2a299ec13b539e51764 | 473 | https://github.com/orktes/atom-react/blob/08981b61257087f3794fd2a299ec13b539e51764/index.coffee | 112 | 161 |
orktes/atom-react:index.coffee:5:raw_corpus | raw_corpus | @subscribe atom.workspace.onDidAddTextEditor (event) =>
editor = event.textEditor
@processEditor(editor) | CoffeeScript | orktes/atom-react | index.coffee | MIT | 08981b61257087f3794fd2a299ec13b539e51764 | 473 | https://github.com/orktes/atom-react/blob/08981b61257087f3794fd2a299ec13b539e51764/index.coffee | 162 | 164 | ||
orktes/atom-react:index.coffee:5:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
@subscribe atom.workspace.onDidAddTextEditor (event) =>
editor = event.textEditor
@processEditor(editor)
``` | this.subscribe(atom.workspace.onDidAddTextEditor((event) => {
var editor;
editor = event.textEditor;
return this.processEditor(editor);
})); | CoffeeScript | JavaScript | orktes/atom-react | index.coffee | MIT | 08981b61257087f3794fd2a299ec13b539e51764 | 473 | https://github.com/orktes/atom-react/blob/08981b61257087f3794fd2a299ec13b539e51764/index.coffee | 162 | 164 |
orktes/atom-react:index.coffee:5:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
this.subscribe(atom.workspace.onDidAddTextEditor((event) => {
var editor;
editor = event.textEditor;
return this.processEditor(editor);
}));
``` | @subscribe atom.workspace.onDidAddTextEditor (event) =>
editor = event.textEditor
@processEditor(editor) | JavaScript | CoffeeScript | orktes/atom-react | index.coffee | MIT | 08981b61257087f3794fd2a299ec13b539e51764 | 473 | https://github.com/orktes/atom-react/blob/08981b61257087f3794fd2a299ec13b539e51764/index.coffee | 162 | 164 |
orktes/atom-react:index.coffee:3:raw_corpus | raw_corpus | return indent if not precedingLine?
indent += 1 if tagStartRegex.testSync(precedingLine) and complexAttributeRegex.testSync(precedingLine)
indent -= 1 if precedingLine and decreaseNextLineIndentRegex.testSync(precedingLine)
return Math.max(indent, 0)
patchEditorLangMode: (editor) ->
@patchEdi... | CoffeeScript | orktes/atom-react | index.coffee | MIT | 5a21df8af6f79d3606e33962f807ca975a9bdf5d | 473 | https://github.com/orktes/atom-react/blob/5a21df8af6f79d3606e33962f807ca975a9bdf5d/index.coffee | 62 | 111 | ||
orktes/atom-react:index.coffee:3:completion | completion | return indent if not precedingLine?
indent += 1 if tagStartRegex.testSync(precedingLine) and complexAttributeRegex.testSync(precedingLine)
indent -= 1 if precedingLine and decreaseNextLineIndentRegex.testSync(precedingLine)
return Math.max(indent, 0)
patchEditorLangMode: (editor) ->
@patchEdi... | selections = editor.getSelections()
for selection in selections
try
selectionText = selection.getText()
jsxOutput = converter.convert(selectionText)
try
jsxformat.setOptions({});
jsxOutput = jsxformat.format(jsxOutput)
selection.insertText(jsxOutput, {aut... | CoffeeScript | CoffeeScript | orktes/atom-react | index.coffee | MIT | 5a21df8af6f79d3606e33962f807ca975a9bdf5d | 473 | https://github.com/orktes/atom-react/blob/5a21df8af6f79d3606e33962f807ca975a9bdf5d/index.coffee | 62 | 111 |
orktes/atom-react:index.coffee:4:raw_corpus | raw_corpus | catch err
# Parsing/formatting the selection failed lets try to parse the whole file but format the selection only
range = selection.getBufferRange().serialize()
# esprima ast line count starts for 1
range[0][0]++
range[1][0]++
jsxformat.setOptions({range: range});
... | CoffeeScript | orktes/atom-react | index.coffee | MIT | 5a21df8af6f79d3606e33962f807ca975a9bdf5d | 473 | https://github.com/orktes/atom-react/blob/5a21df8af6f79d3606e33962f807ca975a9bdf5d/index.coffee | 112 | 161 | ||
orktes/atom-react:index.coffee:4:completion | completion | catch err
# Parsing/formatting the selection failed lets try to parse the whole file but format the selection only
range = selection.getBufferRange().serialize()
# esprima ast line count starts for 1
range[0][0]++
range[1][0]++
jsxformat.setOptions({range: range});
... | # return back
editor.setCursorBufferPosition([firstChangedLine, range[0][1]])
processEditor: (editor) ->
@patchEditorLangMode(editor)
@autoSetGrammar(editor)
activate: ->
jsxTagStartPattern = '(?x)((^|=|return)\\s*<([^!/?](?!.+?(</.+?>))))'
jsxComplexAttributePattern = '(?x)\\{ [^}"\']*... | CoffeeScript | CoffeeScript | orktes/atom-react | index.coffee | MIT | 5a21df8af6f79d3606e33962f807ca975a9bdf5d | 473 | https://github.com/orktes/atom-react/blob/5a21df8af6f79d3606e33962f807ca975a9bdf5d/index.coffee | 112 | 161 |
orktes/atom-react:index.coffee:3:raw_corpus | raw_corpus | return indent if not precedingLine?
indent += 1 if tagStartRegex.testSync(precedingLine) and complexAttributeRegex.testSync(precedingLine)
indent -= 1 if precedingLine and decreaseNextLineIndentRegex.testSync(precedingLine)
return Math.max(indent, 0)
patchEditorLangMode: (editor) ->
@patchEdi... | CoffeeScript | orktes/atom-react | index.coffee | MIT | 759a0a902162d15370e0d1bc8aaab76f744f699a | 473 | https://github.com/orktes/atom-react/blob/759a0a902162d15370e0d1bc8aaab76f744f699a/index.coffee | 62 | 111 | ||
orktes/atom-react:index.coffee:3:completion | completion | return indent if not precedingLine?
indent += 1 if tagStartRegex.testSync(precedingLine) and complexAttributeRegex.testSync(precedingLine)
indent -= 1 if precedingLine and decreaseNextLineIndentRegex.testSync(precedingLine)
return Math.max(indent, 0)
patchEditorLangMode: (editor) ->
@patchEdi... | try
jsxformat.setOptions({});
result = jsxformat.format(selection.getText())
selection.insertText(result, {autoIndent: true});
catch err
# Parsing/formatting the selection failed lets try to parse the whole file but format the selection only
range = selection.getBufferRange... | CoffeeScript | CoffeeScript | orktes/atom-react | index.coffee | MIT | 759a0a902162d15370e0d1bc8aaab76f744f699a | 473 | https://github.com/orktes/atom-react/blob/759a0a902162d15370e0d1bc8aaab76f744f699a/index.coffee | 62 | 111 |
orktes/atom-react:index.coffee:4:raw_corpus | raw_corpus | lastChangedLine = range[1][0] - 1 + (newLineCount - originalLineCount)
if lastChangedLine > firstChangedLine
for row in [firstChangedLine...(lastChangedLine + 1)]
editor.autoIndentBufferRow(row)
# return back
editor.setCursorBufferPosition([firstChangedLine, ran... | CoffeeScript | orktes/atom-react | index.coffee | MIT | 759a0a902162d15370e0d1bc8aaab76f744f699a | 473 | https://github.com/orktes/atom-react/blob/759a0a902162d15370e0d1bc8aaab76f744f699a/index.coffee | 112 | 143 | ||
orktes/atom-react:index.coffee:4:completion | completion | lastChangedLine = range[1][0] - 1 + (newLineCount - originalLineCount)
if lastChangedLine > firstChangedLine
for row in [firstChangedLine...(lastChangedLine + 1)]
editor.autoIndentBufferRow(row)
# return back
editor.setCursorBufferPosition([firstChangedLine, ran... | jsxComplexAttributePattern = '(?x)\\{ [^}"\']* $|\\( [^)"\']* $'
decreaseIndentForNextLinePattern = '/>\\s*,?\\s*$'
atom.config.set("react.jsxTagStartPattern", jsxTagStartPattern)
atom.config.set("react.jsxComplexAttributePattern", jsxComplexAttributePattern)
atom.config.set("react.decreaseIndentForNex... | CoffeeScript | CoffeeScript | orktes/atom-react | index.coffee | MIT | 759a0a902162d15370e0d1bc8aaab76f744f699a | 473 | https://github.com/orktes/atom-react/blob/759a0a902162d15370e0d1bc8aaab76f744f699a/index.coffee | 112 | 143 |
orktes/atom-react:index.coffee:1:raw_corpus | raw_corpus | isJSX = (text) ->
doc = docblock.parse text;
for b in doc
return true if b[0] == 'jsx'
false | CoffeeScript | orktes/atom-react | index.coffee | MIT | 5979973997c840598cffcdd4f4c67f589bc4ded9 | 473 | https://github.com/orktes/atom-react/blob/5979973997c840598cffcdd4f4c67f589bc4ded9/index.coffee | 9 | 13 | ||
orktes/atom-react:index.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
isJSX = (text) ->
doc = docblock.parse text;
for b in doc
return true if b[0] == 'jsx'
false
``` | var isJSX;
isJSX = function(text) {
var b, doc, i, len;
doc = docblock.parse(text);
for (i = 0, len = doc.length; i < len; i++) {
b = doc[i];
if (b[0] === 'jsx') {
return true;
}
}
return false;
}; | CoffeeScript | JavaScript | orktes/atom-react | index.coffee | MIT | 5979973997c840598cffcdd4f4c67f589bc4ded9 | 473 | https://github.com/orktes/atom-react/blob/5979973997c840598cffcdd4f4c67f589bc4ded9/index.coffee | 9 | 13 |
orktes/atom-react:index.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var isJSX;
isJSX = function(text) {
var b, doc, i, len;
doc = docblock.parse(text);
for (i = 0, len = doc.length; i < len; i++) {
b = doc[i];
if (b[0] === 'jsx') {
return true;
}
}
return false;
};
``` | isJSX = (text) ->
doc = docblock.parse text;
for b in doc
return true if b[0] == 'jsx'
false | JavaScript | CoffeeScript | orktes/atom-react | index.coffee | MIT | 5979973997c840598cffcdd4f4c67f589bc4ded9 | 473 | https://github.com/orktes/atom-react/blob/5979973997c840598cffcdd4f4c67f589bc4ded9/index.coffee | 9 | 13 |
orktes/atom-react:index.coffee:1:completion | completion | isJSX = (text) ->
doc = docblock.parse text; | for b in doc
return true if b[0] == 'jsx'
false | CoffeeScript | CoffeeScript | orktes/atom-react | index.coffee | MIT | 5979973997c840598cffcdd4f4c67f589bc4ded9 | 473 | https://github.com/orktes/atom-react/blob/5979973997c840598cffcdd4f4c67f589bc4ded9/index.coffee | 9 | 13 |
orktes/atom-react:index.coffee:3:raw_corpus | raw_corpus | return indent if not precedingLine?
indent += 1 if tagStartRegex.testSync(precedingLine) and complexAttributeRegex.testSync(precedingLine)
indent -= 1 if precedingLine and decreaseNextLineIndentRegex.testSync(precedingLine)
return Math.max(indent, 0)
patchEditorLangMode: (editor) ->
@patchEdi... | CoffeeScript | orktes/atom-react | index.coffee | MIT | 5979973997c840598cffcdd4f4c67f589bc4ded9 | 473 | https://github.com/orktes/atom-react/blob/5979973997c840598cffcdd4f4c67f589bc4ded9/index.coffee | 65 | 114 | ||
orktes/atom-react:index.coffee:3:completion | completion | return indent if not precedingLine?
indent += 1 if tagStartRegex.testSync(precedingLine) and complexAttributeRegex.testSync(precedingLine)
indent -= 1 if precedingLine and decreaseNextLineIndentRegex.testSync(precedingLine)
return Math.max(indent, 0)
patchEditorLangMode: (editor) ->
@patchEdi... | selection.insertText(result, {autoIndent: true});
catch err
# Parsing/formatting the selection failed lets try to parse the whole file but format the selection only
range = selection.getBufferRange().serialize()
# esprima ast line count starts for 1
range[0][0]++
range[1][0... | CoffeeScript | CoffeeScript | orktes/atom-react | index.coffee | MIT | 5979973997c840598cffcdd4f4c67f589bc4ded9 | 473 | https://github.com/orktes/atom-react/blob/5979973997c840598cffcdd4f4c67f589bc4ded9/index.coffee | 65 | 114 |
orktes/atom-react:index.coffee:4:raw_corpus | raw_corpus | for row in [firstChangedLine...(lastChangedLine + 1)]
editor.autoIndentBufferRow(row)
# return back
editor.setCursorBufferPosition([firstChangedLine, range[0][1]])
processEditor: (editor) ->
@patchEditorLangMode(editor)
@autoSetGrammar(editor)
activate: ->
jsxTagSta... | CoffeeScript | orktes/atom-react | index.coffee | MIT | 5979973997c840598cffcdd4f4c67f589bc4ded9 | 473 | https://github.com/orktes/atom-react/blob/5979973997c840598cffcdd4f4c67f589bc4ded9/index.coffee | 115 | 143 | ||
orktes/atom-react:index.coffee:4:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
for row in [firstChangedLine...(lastChangedLine + 1)]
editor.autoIndentBufferRow(row)
# return back
editor.setCursorBufferPosition([firstChangedLine, range[0][1]])
processEditor: (editor) ->
@patchEditorLangMode(editor)
... | var i, ref, ref1, row;
for (row = i = ref = firstChangedLine, ref1 = lastChangedLine + 1; (ref <= ref1 ? i < ref1 : i > ref1); row = ref <= ref1 ? ++i : --i) {
editor.autoIndentBufferRow(row);
}
// return back
editor.setCursorBufferPosition([firstChangedLine, range[0][1]]);
({
processEditor: function(editor) {
... | CoffeeScript | JavaScript | orktes/atom-react | index.coffee | MIT | 5979973997c840598cffcdd4f4c67f589bc4ded9 | 473 | https://github.com/orktes/atom-react/blob/5979973997c840598cffcdd4f4c67f589bc4ded9/index.coffee | 115 | 143 |
orktes/atom-react:index.coffee:4:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var i, ref, ref1, row;
for (row = i = ref = firstChangedLine, ref1 = lastChangedLine + 1; (ref <= ref1 ? i < ref1 : i > ref1); row = ref <= ref1 ? ++i : --i) {
editor.autoIndentBufferRow(row);
}
// return back
editor.setCursorBufferPosition([firstChangedLine, r... | for row in [firstChangedLine...(lastChangedLine + 1)]
editor.autoIndentBufferRow(row)
# return back
editor.setCursorBufferPosition([firstChangedLine, range[0][1]])
processEditor: (editor) ->
@patchEditorLangMode(editor)
@autoSetGrammar(editor)
activate: ->
jsxTagSta... | JavaScript | CoffeeScript | orktes/atom-react | index.coffee | MIT | 5979973997c840598cffcdd4f4c67f589bc4ded9 | 473 | https://github.com/orktes/atom-react/blob/5979973997c840598cffcdd4f4c67f589bc4ded9/index.coffee | 115 | 143 |
orktes/atom-react:index.coffee:4:completion | completion | for row in [firstChangedLine...(lastChangedLine + 1)]
editor.autoIndentBufferRow(row)
# return back
editor.setCursorBufferPosition([firstChangedLine, range[0][1]])
processEditor: (editor) ->
@patchEditorLangMode(editor)
@autoSetGrammar(editor)
activate: ->
jsxTagSta... | decreaseIndentForNextLinePattern = '/>\\s*,?\\s*$'
atom.config.set("react.jsxTagStartPattern", jsxTagStartPattern)
atom.config.set("react.jsxComplexAttributePattern", jsxComplexAttributePattern)
atom.config.set("react.decreaseIndentForNextLinePattern", decreaseIndentForNextLinePattern)
# Bind events
... | CoffeeScript | CoffeeScript | orktes/atom-react | index.coffee | MIT | 5979973997c840598cffcdd4f4c67f589bc4ded9 | 473 | https://github.com/orktes/atom-react/blob/5979973997c840598cffcdd4f4c67f589bc4ded9/index.coffee | 115 | 143 |
orktes/atom-react:index.coffee:3:raw_corpus | raw_corpus | return indent if not precedingLine?
indent += 1 if tagStartRegex.testSync(precedingLine) and complexAttributeRegex.testSync(precedingLine)
indent -= 1 if precedingLine and decreaseNextLineIndentRegex.testSync(precedingLine)
return Math.max(indent, 0)
patchEditorLangMode: (editor) ->
@patchEdi... | CoffeeScript | orktes/atom-react | index.coffee | MIT | 1c750043cbf7962e84c25030d0bfd772fed61272 | 473 | https://github.com/orktes/atom-react/blob/1c750043cbf7962e84c25030d0bfd772fed61272/index.coffee | 65 | 114 | ||
orktes/atom-react:index.coffee:3:completion | completion | return indent if not precedingLine?
indent += 1 if tagStartRegex.testSync(precedingLine) and complexAttributeRegex.testSync(precedingLine)
indent -= 1 if precedingLine and decreaseNextLineIndentRegex.testSync(precedingLine)
return Math.max(indent, 0)
patchEditorLangMode: (editor) ->
@patchEdi... | selection.insertText(result, {autoIndent: true});
catch err
# Parsing/formatting the selection failed lets try to parse the whole file but format the selection only
range = selection.getBufferRange().serialize()
# esprima ast line count starts for 1
range[0][0]++
range[1][0... | CoffeeScript | CoffeeScript | orktes/atom-react | index.coffee | MIT | 1c750043cbf7962e84c25030d0bfd772fed61272 | 473 | https://github.com/orktes/atom-react/blob/1c750043cbf7962e84c25030d0bfd772fed61272/index.coffee | 65 | 114 |
orktes/atom-react:index.coffee:4:raw_corpus | raw_corpus | lastChangedLine = range[1][0] - 1 + (newLineCount - originalLineCount)
if lastChangedLine > firstChangedLine
for row in [firstChangedLine...(lastChangedLine + 1)]
editor.autoIndentBufferRow(row)
# return back
editor.setCursorBufferPosition([firstChangedLine, ran... | CoffeeScript | orktes/atom-react | index.coffee | MIT | 1c750043cbf7962e84c25030d0bfd772fed61272 | 473 | https://github.com/orktes/atom-react/blob/1c750043cbf7962e84c25030d0bfd772fed61272/index.coffee | 115 | 148 | ||
orktes/atom-react:index.coffee:4:completion | completion | lastChangedLine = range[1][0] - 1 + (newLineCount - originalLineCount)
if lastChangedLine > firstChangedLine
for row in [firstChangedLine...(lastChangedLine + 1)]
editor.autoIndentBufferRow(row)
# return back
editor.setCursorBufferPosition([firstChangedLine, ran... | jsxTagStartPattern = '(?x)((^|=|return)\\s*<([^!/?](?!.+?(</.+?>))))'
jsxComplexAttributePattern = '(?x)\\{ [^}"\']* $|\\( [^)"\']* $'
decreaseIndentForNextLinePattern = '/>\\s*,?\\s*$'
atom.config.set("react.jsxTagStartPattern", jsxTagStartPattern)
atom.config.set("react.jsxComplexAttributePattern", j... | CoffeeScript | CoffeeScript | orktes/atom-react | index.coffee | MIT | 1c750043cbf7962e84c25030d0bfd772fed61272 | 473 | https://github.com/orktes/atom-react/blob/1c750043cbf7962e84c25030d0bfd772fed61272/index.coffee | 115 | 148 |
orktes/atom-react:index.coffee:3:raw_corpus | raw_corpus | return indent if not precedingLine?
indent += 1 if tagStartRegex.testSync(precedingLine) and complexAttributeRegex.testSync(precedingLine)
indent -= 1 if precedingLine and decreaseNextLineIndentRegex.testSync(precedingLine)
return Math.max(indent, 0)
patchEditorLangMode: (editor) ->
@patchEdi... | CoffeeScript | orktes/atom-react | index.coffee | MIT | 585566af2129ddd187202830ed11811198e8d97e | 473 | https://github.com/orktes/atom-react/blob/585566af2129ddd187202830ed11811198e8d97e/index.coffee | 65 | 114 | ||
orktes/atom-react:index.coffee:3:completion | completion | return indent if not precedingLine?
indent += 1 if tagStartRegex.testSync(precedingLine) and complexAttributeRegex.testSync(precedingLine)
indent -= 1 if precedingLine and decreaseNextLineIndentRegex.testSync(precedingLine)
return Math.max(indent, 0)
patchEditorLangMode: (editor) ->
@patchEdi... | result = jsxformat.format(selection.getText())
selection.insertText(result, {autoIndent: true});
catch err
# Parsing/formatting the selection failed lets try to parse the whole file but format the selection only
range = selection.getBufferRange().serialize()
# esprima ast line coun... | CoffeeScript | CoffeeScript | orktes/atom-react | index.coffee | MIT | 585566af2129ddd187202830ed11811198e8d97e | 473 | https://github.com/orktes/atom-react/blob/585566af2129ddd187202830ed11811198e8d97e/index.coffee | 65 | 114 |
orktes/atom-react:index.coffee:4:raw_corpus | raw_corpus | i = 0
# TODO: use sourcemaps for this
_.findLast resultLines, (newline, index) ->
orgline = originalLines[originalLines.length - 1 - i]
i++
if newline != orgline
lastChangedLine = index
return true
if lastChangedLine > firs... | CoffeeScript | orktes/atom-react | index.coffee | MIT | 585566af2129ddd187202830ed11811198e8d97e | 473 | https://github.com/orktes/atom-react/blob/585566af2129ddd187202830ed11811198e8d97e/index.coffee | 115 | 155 | ||
orktes/atom-react:index.coffee:4:completion | completion | i = 0
# TODO: use sourcemaps for this
_.findLast resultLines, (newline, index) ->
orgline = originalLines[originalLines.length - 1 - i]
i++
if newline != orgline
lastChangedLine = index
return true
if lastChangedLine > firs... | @patchEditorLangMode(editor)
@autoSetGrammar(editor)
activate: ->
jsxTagStartPattern = '(?x)((^|=|return)\\s*<([^!/?](?!.+?(</.+?>))))'
jsxComplexAttributePattern = '(?x)\\{ [^}"\']* $|\\( [^)"\']* $'
decreaseIndentForNextLinePattern = '/>\\s*,?\\s*$'
atom.config.set("react.jsxTagStartPattern", ... | CoffeeScript | CoffeeScript | orktes/atom-react | index.coffee | MIT | 585566af2129ddd187202830ed11811198e8d97e | 473 | https://github.com/orktes/atom-react/blob/585566af2129ddd187202830ed11811198e8d97e/index.coffee | 115 | 155 |
orktes/atom-react:index.coffee:3:raw_corpus | raw_corpus | return indent if not precedingLine?
indent += 1 if tagStartRegex.testSync(precedingLine) and complexAttributeRegex.testSync(precedingLine)
indent -= 1 if precedingLine and decreaseNextLineIndentRegex.testSync(precedingLine)
return Math.max(indent, 0)
patchEditorLangMode: (editor) ->
@patchEdi... | CoffeeScript | orktes/atom-react | index.coffee | MIT | 320b5d8d2b694403025879c37588b3b284c8073f | 473 | https://github.com/orktes/atom-react/blob/320b5d8d2b694403025879c37588b3b284c8073f/index.coffee | 63 | 97 | ||
orktes/atom-react:index.coffee:3:completion | completion | return indent if not precedingLine?
indent += 1 if tagStartRegex.testSync(precedingLine) and complexAttributeRegex.testSync(precedingLine)
indent -= 1 if precedingLine and decreaseNextLineIndentRegex.testSync(precedingLine)
return Math.max(indent, 0)
patchEditorLangMode: (editor) ->
@patchEdi... | activate: ->
jsxTagStartPattern = '(?x)((^|=|return)\\s*<([^!/?](?!.+?(</.+?>))))'
jsxComplexAttributePattern = '(?x)\\{ [^}"\']* $|\\( [^)"\']* $'
decreaseIndentForNextLinePattern = '/>\\s*,?\\s*$'
atom.config.set("react.jsxTagStartPattern", jsxTagStartPattern)
atom.config.set("react.jsxComplexAtt... | CoffeeScript | CoffeeScript | orktes/atom-react | index.coffee | MIT | 320b5d8d2b694403025879c37588b3b284c8073f | 473 | https://github.com/orktes/atom-react/blob/320b5d8d2b694403025879c37588b3b284c8073f/index.coffee | 63 | 97 |
orktes/atom-react:index.coffee:3:raw_corpus | raw_corpus | indent += 1 if tagStartRegex.testSync(precedingLine) and complexAttributeRegex.testSync(precedingLine)
indent -= 1 if precedingLine and decreaseNextLineIndentRegex.testSync(precedingLine)
return Math.max(indent, 0)
patchEditorLangMode: (editor) ->
@patchEditorLangModeSuggestedIndentForBufferRow(edit... | CoffeeScript | orktes/atom-react | index.coffee | MIT | b488b7e6b7c6c264b1c5ab78e84c02e6141e819f | 473 | https://github.com/orktes/atom-react/blob/b488b7e6b7c6c264b1c5ab78e84c02e6141e819f/index.coffee | 63 | 95 | ||
orktes/atom-react:index.coffee:3:completion | completion | indent += 1 if tagStartRegex.testSync(precedingLine) and complexAttributeRegex.testSync(precedingLine)
indent -= 1 if precedingLine and decreaseNextLineIndentRegex.testSync(precedingLine)
return Math.max(indent, 0)
patchEditorLangMode: (editor) ->
@patchEditorLangModeSuggestedIndentForBufferRow(edit... | jsxTagStartPattern = '(?x)((^|=|return)\\s*<([^!/?](?!.+?(</.+?>))))'
jsxComplexAttributePattern = '(?x)\\{ [^}"\']* $|\\( [^)"\']* $'
decreaseIndentForNextLinePattern = '/>\\s*,?\\s*$'
atom.config.set("react.jsxTagStartPattern", jsxTagStartPattern)
atom.config.set("react.jsxComplexAttributePattern", j... | CoffeeScript | CoffeeScript | orktes/atom-react | index.coffee | MIT | b488b7e6b7c6c264b1c5ab78e84c02e6141e819f | 473 | https://github.com/orktes/atom-react/blob/b488b7e6b7c6c264b1c5ab78e84c02e6141e819f/index.coffee | 63 | 95 |
orktes/atom-react:index.coffee:2:raw_corpus | raw_corpus | class AtomReact
Subscriber.includeInto(this)
constructor: ->
patchEditorLangModeAutoDecreaseIndentForBufferRow: (editor) ->
self = this
fn = editor.languageMode.autoDecreaseIndentForBufferRow
editor.languageMode.autoDecreaseIndentForBufferRow = (bufferRow, options) ->
return fn.call(editor.langu... | CoffeeScript | orktes/atom-react | index.coffee | MIT | 22544b1caa0aa3b350f7cc36979ab610da999e75 | 473 | https://github.com/orktes/atom-react/blob/22544b1caa0aa3b350f7cc36979ab610da999e75/index.coffee | 13 | 62 | ||
orktes/atom-react:index.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
class AtomReact
Subscriber.includeInto(this)
constructor: ->
patchEditorLangModeAutoDecreaseIndentForBufferRow: (editor) ->
self = this
fn = editor.languageMode.autoDecreaseIndentForBufferRow
editor.languageMode.autoDecreaseIndentForBufferRow = ... | var AtomReact;
AtomReact = (function() {
class AtomReact {
constructor() {}
patchEditorLangModeAutoDecreaseIndentForBufferRow(editor) {
var fn, self;
self = this;
fn = editor.languageMode.autoDecreaseIndentForBufferRow;
return editor.languageMode.autoDecreaseIndentForBufferRow = func... | CoffeeScript | JavaScript | orktes/atom-react | index.coffee | MIT | 22544b1caa0aa3b350f7cc36979ab610da999e75 | 473 | https://github.com/orktes/atom-react/blob/22544b1caa0aa3b350f7cc36979ab610da999e75/index.coffee | 13 | 62 |
orktes/atom-react:index.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var AtomReact;
AtomReact = (function() {
class AtomReact {
constructor() {}
patchEditorLangModeAutoDecreaseIndentForBufferRow(editor) {
var fn, self;
self = this;
fn = editor.languageMode.autoDecreaseIndentForBufferRow;
return ed... | class AtomReact
Subscriber.includeInto(this)
constructor: ->
patchEditorLangModeAutoDecreaseIndentForBufferRow: (editor) ->
self = this
fn = editor.languageMode.autoDecreaseIndentForBufferRow
editor.languageMode.autoDecreaseIndentForBufferRow = (bufferRow, options) ->
return fn.call(editor.langu... | JavaScript | CoffeeScript | orktes/atom-react | index.coffee | MIT | 22544b1caa0aa3b350f7cc36979ab610da999e75 | 473 | https://github.com/orktes/atom-react/blob/22544b1caa0aa3b350f7cc36979ab610da999e75/index.coffee | 13 | 62 |
orktes/atom-react:index.coffee:2:completion | completion | class AtomReact
Subscriber.includeInto(this)
constructor: ->
patchEditorLangModeAutoDecreaseIndentForBufferRow: (editor) ->
self = this
fn = editor.languageMode.autoDecreaseIndentForBufferRow
editor.languageMode.autoDecreaseIndentForBufferRow = (bufferRow, options) ->
return fn.call(editor.langu... | currentIndentLevel -= 1 if decreaseIndentRegex and decreaseIndentRegex.testSync(line)
desiredIndentLevel = currentIndentLevel - 1
if desiredIndentLevel >= 0 and desiredIndentLevel < currentIndentLevel
@editor.setIndentationForBufferRow(bufferRow, desiredIndentLevel)
else
fn.call(... | CoffeeScript | CoffeeScript | orktes/atom-react | index.coffee | MIT | 22544b1caa0aa3b350f7cc36979ab610da999e75 | 473 | https://github.com/orktes/atom-react/blob/22544b1caa0aa3b350f7cc36979ab610da999e75/index.coffee | 13 | 62 |
orktes/atom-react:index.coffee:3:raw_corpus | raw_corpus | indent += 1 if tagStartRegex.testSync(precedingLine) and complexAttributeRegex.testSync(precedingLine)
indent -= 1 if precedingLine and decreaseNextLineIndentRegex.testSync(precedingLine)
return Math.max(indent, 0)
patchEditorLangMode: (editor) ->
@patchEditorLangModeSuggestedIndentForBufferRow(edit... | CoffeeScript | orktes/atom-react | index.coffee | MIT | 22544b1caa0aa3b350f7cc36979ab610da999e75 | 473 | https://github.com/orktes/atom-react/blob/22544b1caa0aa3b350f7cc36979ab610da999e75/index.coffee | 63 | 95 | ||
orktes/atom-react:index.coffee:3:completion | completion | indent += 1 if tagStartRegex.testSync(precedingLine) and complexAttributeRegex.testSync(precedingLine)
indent -= 1 if precedingLine and decreaseNextLineIndentRegex.testSync(precedingLine)
return Math.max(indent, 0)
patchEditorLangMode: (editor) ->
@patchEditorLangModeSuggestedIndentForBufferRow(edit... | jsxTagStartPattern = '(?x)((^|=|return)\\s*<([^!/?](?!.+?(</.+?>))))'
jsxComplexAttributePattern = '(?x)\\{ [^}"\']* $|\\( [^)"\']* $'
decreaseIndentForNextLinePattern = '/>\\s*,?\\s*$'
atom.config.set("jsxTagStartPattern", jsxTagStartPattern)
atom.config.set("jsxComplexAttributePattern", jsxComplexAtt... | CoffeeScript | CoffeeScript | orktes/atom-react | index.coffee | MIT | 22544b1caa0aa3b350f7cc36979ab610da999e75 | 473 | https://github.com/orktes/atom-react/blob/22544b1caa0aa3b350f7cc36979ab610da999e75/index.coffee | 63 | 95 |
orktes/atom-react:index.coffee:2:raw_corpus | raw_corpus | class AtomReact
Subscriber.includeInto(this)
constructor: ->
patchEditorLangModeAutoDecreaseIndentForBufferRow: (editor) ->
self = this
fn = editor.languageMode.autoDecreaseIndentForBufferRow
editor.languageMode.autoDecreaseIndentForBufferRow = (bufferRow, options) ->
return fn.call(editor.langu... | CoffeeScript | orktes/atom-react | index.coffee | MIT | d33bbce9600e3f97dc105bae6cc0f0d717c5fff9 | 473 | https://github.com/orktes/atom-react/blob/d33bbce9600e3f97dc105bae6cc0f0d717c5fff9/index.coffee | 13 | 62 | ||
orktes/atom-react:index.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
class AtomReact
Subscriber.includeInto(this)
constructor: ->
patchEditorLangModeAutoDecreaseIndentForBufferRow: (editor) ->
self = this
fn = editor.languageMode.autoDecreaseIndentForBufferRow
editor.languageMode.autoDecreaseIndentForBufferRow = ... | var AtomReact;
AtomReact = (function() {
class AtomReact {
constructor() {}
patchEditorLangModeAutoDecreaseIndentForBufferRow(editor) {
var fn, self;
self = this;
fn = editor.languageMode.autoDecreaseIndentForBufferRow;
return editor.languageMode.autoDecreaseIndentForBufferRow = func... | CoffeeScript | JavaScript | orktes/atom-react | index.coffee | MIT | d33bbce9600e3f97dc105bae6cc0f0d717c5fff9 | 473 | https://github.com/orktes/atom-react/blob/d33bbce9600e3f97dc105bae6cc0f0d717c5fff9/index.coffee | 13 | 62 |
orktes/atom-react:index.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var AtomReact;
AtomReact = (function() {
class AtomReact {
constructor() {}
patchEditorLangModeAutoDecreaseIndentForBufferRow(editor) {
var fn, self;
self = this;
fn = editor.languageMode.autoDecreaseIndentForBufferRow;
return ed... | class AtomReact
Subscriber.includeInto(this)
constructor: ->
patchEditorLangModeAutoDecreaseIndentForBufferRow: (editor) ->
self = this
fn = editor.languageMode.autoDecreaseIndentForBufferRow
editor.languageMode.autoDecreaseIndentForBufferRow = (bufferRow, options) ->
return fn.call(editor.langu... | JavaScript | CoffeeScript | orktes/atom-react | index.coffee | MIT | d33bbce9600e3f97dc105bae6cc0f0d717c5fff9 | 473 | https://github.com/orktes/atom-react/blob/d33bbce9600e3f97dc105bae6cc0f0d717c5fff9/index.coffee | 13 | 62 |
orktes/atom-react:index.coffee:2:completion | completion | class AtomReact
Subscriber.includeInto(this)
constructor: ->
patchEditorLangModeAutoDecreaseIndentForBufferRow: (editor) ->
self = this
fn = editor.languageMode.autoDecreaseIndentForBufferRow
editor.languageMode.autoDecreaseIndentForBufferRow = (bufferRow, options) ->
return fn.call(editor.langu... | currentIndentLevel -= 1 if decreaseIndentRegex and decreaseIndentRegex.testSync(line)
desiredIndentLevel = currentIndentLevel - 1
if desiredIndentLevel >= 0 and desiredIndentLevel < currentIndentLevel
@editor.setIndentationForBufferRow(bufferRow, desiredIndentLevel)
else
fn.call(... | CoffeeScript | CoffeeScript | orktes/atom-react | index.coffee | MIT | d33bbce9600e3f97dc105bae6cc0f0d717c5fff9 | 473 | https://github.com/orktes/atom-react/blob/d33bbce9600e3f97dc105bae6cc0f0d717c5fff9/index.coffee | 13 | 62 |
orktes/atom-react:index.coffee:3:raw_corpus | raw_corpus | indent += 1 if tagStartRegex.testSync(precedingLine) and complexAttributeRegex.testSync(precedingLine)
indent -= 1 if precedingLine and decreaseNextLineIndentRegex.testSync(precedingLine)
return Math.max(indent, 0)
patchEditorLangMode: (editor) ->
@patchEditorLangModeSuggestedIndentForBufferRow(edit... | CoffeeScript | orktes/atom-react | index.coffee | MIT | d33bbce9600e3f97dc105bae6cc0f0d717c5fff9 | 473 | https://github.com/orktes/atom-react/blob/d33bbce9600e3f97dc105bae6cc0f0d717c5fff9/index.coffee | 63 | 87 | ||
orktes/atom-react:index.coffee:3:completion | completion | indent += 1 if tagStartRegex.testSync(precedingLine) and complexAttributeRegex.testSync(precedingLine)
indent -= 1 if precedingLine and decreaseNextLineIndentRegex.testSync(precedingLine)
return Math.max(indent, 0)
patchEditorLangMode: (editor) ->
@patchEditorLangModeSuggestedIndentForBufferRow(edit... | jsxGrammar = atom.syntax.grammarsByScopeName["source.js.jsx"]
editor.setGrammar jsxGrammar if jsxGrammar
activate: ->
# Patch edtiors language mode to get proper indention
@patchEditorLangMode(editor) for editor in atom.workspace.getTextEditors()
@autoSetGrammar(editor) for editor in atom.workspace... | CoffeeScript | CoffeeScript | orktes/atom-react | index.coffee | MIT | d33bbce9600e3f97dc105bae6cc0f0d717c5fff9 | 473 | https://github.com/orktes/atom-react/blob/d33bbce9600e3f97dc105bae6cc0f0d717c5fff9/index.coffee | 63 | 87 |
orktes/atom-react:index.coffee:2:raw_corpus | raw_corpus | class AtomReact
Subscriber.includeInto(this)
tagStartRegex: new OnigRegExp('(?x)((^|=|return)\\s*<([^!/?](?!.+?(</.+?>))))')
complexAttributeRegex: new OnigRegExp('(?x)\\{ [^}"\']* $|\\( [^)"\']* $')
decreaseNextLineIndentRegex: new OnigRegExp('/>\\s*$')
constructor: ->
patchEditorLangModeAutoDecreaseIndent... | CoffeeScript | orktes/atom-react | index.coffee | MIT | 41aba69c75a02fb641c92ac43ee5ace400c4fe94 | 473 | https://github.com/orktes/atom-react/blob/41aba69c75a02fb641c92ac43ee5ace400c4fe94/index.coffee | 14 | 63 | ||
orktes/atom-react:index.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
class AtomReact
Subscriber.includeInto(this)
tagStartRegex: new OnigRegExp('(?x)((^|=|return)\\s*<([^!/?](?!.+?(</.+?>))))')
complexAttributeRegex: new OnigRegExp('(?x)\\{ [^}"\']* $|\\( [^)"\']* $')
decreaseNextLineIndentRegex: new OnigRegExp('/>\\s*$')
... | var AtomReact;
AtomReact = (function() {
class AtomReact {
constructor() {}
patchEditorLangModeAutoDecreaseIndentForBufferRow(editor) {
var fn, self;
self = this;
fn = editor.languageMode.autoDecreaseIndentForBufferRow;
return editor.languageMode.autoDecreaseIndentForBufferRow = func... | CoffeeScript | JavaScript | orktes/atom-react | index.coffee | MIT | 41aba69c75a02fb641c92ac43ee5ace400c4fe94 | 473 | https://github.com/orktes/atom-react/blob/41aba69c75a02fb641c92ac43ee5ace400c4fe94/index.coffee | 14 | 63 |
orktes/atom-react:index.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var AtomReact;
AtomReact = (function() {
class AtomReact {
constructor() {}
patchEditorLangModeAutoDecreaseIndentForBufferRow(editor) {
var fn, self;
self = this;
fn = editor.languageMode.autoDecreaseIndentForBufferRow;
return ed... | class AtomReact
Subscriber.includeInto(this)
tagStartRegex: new OnigRegExp('(?x)((^|=|return)\\s*<([^!/?](?!.+?(</.+?>))))')
complexAttributeRegex: new OnigRegExp('(?x)\\{ [^}"\']* $|\\( [^)"\']* $')
decreaseNextLineIndentRegex: new OnigRegExp('/>\\s*$')
constructor: ->
patchEditorLangModeAutoDecreaseIndent... | JavaScript | CoffeeScript | orktes/atom-react | index.coffee | MIT | 41aba69c75a02fb641c92ac43ee5ace400c4fe94 | 473 | https://github.com/orktes/atom-react/blob/41aba69c75a02fb641c92ac43ee5ace400c4fe94/index.coffee | 14 | 63 |
orktes/atom-react:index.coffee:2:completion | completion | class AtomReact
Subscriber.includeInto(this)
tagStartRegex: new OnigRegExp('(?x)((^|=|return)\\s*<([^!/?](?!.+?(</.+?>))))')
complexAttributeRegex: new OnigRegExp('(?x)\\{ [^}"\']* $|\\( [^)"\']* $')
decreaseNextLineIndentRegex: new OnigRegExp('/>\\s*$')
constructor: ->
patchEditorLangModeAutoDecreaseIndent... | not (increaseIndentRegex and increaseIndentRegex.testSync(precedingLine))
currentIndentLevel = @editor.indentationForBufferRow(precedingRow)
currentIndentLevel -= 1 if decreaseIndentRegex and decreaseIndentRegex.testSync(line)
desiredIndentLevel = currentIndentLevel - 1
if desiredIndentL... | CoffeeScript | CoffeeScript | orktes/atom-react | index.coffee | MIT | 41aba69c75a02fb641c92ac43ee5ace400c4fe94 | 473 | https://github.com/orktes/atom-react/blob/41aba69c75a02fb641c92ac43ee5ace400c4fe94/index.coffee | 14 | 63 |
orktes/atom-react:index.coffee:3:raw_corpus | raw_corpus | indent += 1 if self.tagStartRegex.testSync(precedingLine) and self.complexAttributeRegex.testSync(precedingLine)
indent -= 1 if precedingLine and decreaseNextLineIndentRegex.testSync(precedingLine)
return Math.max(indent, 0)
patchEditorLangMode: (editor) ->
@patchEditorLangModeSuggestedIndentForBuff... | CoffeeScript | orktes/atom-react | index.coffee | MIT | 41aba69c75a02fb641c92ac43ee5ace400c4fe94 | 473 | https://github.com/orktes/atom-react/blob/41aba69c75a02fb641c92ac43ee5ace400c4fe94/index.coffee | 64 | 89 | ||
orktes/atom-react:index.coffee:3:completion | completion | indent += 1 if self.tagStartRegex.testSync(precedingLine) and self.complexAttributeRegex.testSync(precedingLine)
indent -= 1 if precedingLine and decreaseNextLineIndentRegex.testSync(precedingLine)
return Math.max(indent, 0)
patchEditorLangMode: (editor) ->
@patchEditorLangModeSuggestedIndentForBuff... | jsxGrammar = atom.syntax.grammarsByScopeName["source.js.jsx"]
editor.setGrammar jsxGrammar if jsxGrammar
activate: ->
# Patch edtiors language mode to get proper indention
@patchEditorLangMode(editor) for editor in atom.workspace.getTextEditors()
@autoSetGrammar(editor) for editor in atom.workspace... | CoffeeScript | CoffeeScript | orktes/atom-react | index.coffee | MIT | 41aba69c75a02fb641c92ac43ee5ace400c4fe94 | 473 | https://github.com/orktes/atom-react/blob/41aba69c75a02fb641c92ac43ee5ace400c4fe94/index.coffee | 64 | 89 |
orktes/atom-react:index.coffee:3:raw_corpus | raw_corpus | indent += 1 if self.tagStartRegex.testSync(precedingLine) and self.complexAttributeRegex.testSync(precedingLine)
indent -= 1 if precedingLine and decreaseNextLineIndentRegex.testSync(precedingLine)
return Math.max(indent, 0)
patchEditorLangMode: (editor) ->
@patchEditorLangModeSuggestedIndentForBuff... | CoffeeScript | orktes/atom-react | index.coffee | MIT | b7190fcab8d6f3fc3010a0704fe35abc17f45a57 | 473 | https://github.com/orktes/atom-react/blob/b7190fcab8d6f3fc3010a0704fe35abc17f45a57/index.coffee | 64 | 86 | ||
orktes/atom-react:index.coffee:3:completion | completion | indent += 1 if self.tagStartRegex.testSync(precedingLine) and self.complexAttributeRegex.testSync(precedingLine)
indent -= 1 if precedingLine and decreaseNextLineIndentRegex.testSync(precedingLine)
return Math.max(indent, 0)
patchEditorLangMode: (editor) ->
@patchEditorLangModeSuggestedIndentForBuff... | @patchEditorLangMode(editor) for editor in atom.workspace.getTextEditors()
@subscribe atom.workspace.onDidAddTextEditor (event) =>
editor = event.textEditor
@patchEditorLangMode(editor)
# Check if file extension is .jsx or the file has the old JSX notation
if path.extname(editor.getPath()... | CoffeeScript | CoffeeScript | orktes/atom-react | index.coffee | MIT | b7190fcab8d6f3fc3010a0704fe35abc17f45a57 | 473 | https://github.com/orktes/atom-react/blob/b7190fcab8d6f3fc3010a0704fe35abc17f45a57/index.coffee | 64 | 86 |
orktes/atom-react:index.coffee:2:raw_corpus | raw_corpus | class AtomReact
Subscriber.includeInto(this)
tagStartRegex: new OnigRegExp('(?x)((^|=|return)\\s*<([^!/?](?!.+?(</.+?>))))')
complexAttributeRegex: new OnigRegExp('(?x)\\{ [^}"\']* $|\\( [^)"\']* $')
constructor: ->
patchEditorLangModeAutoDecreaseIndentForBufferRow: (editor) ->
self = this
fn = edito... | CoffeeScript | orktes/atom-react | index.coffee | MIT | b92973729dc12e59b4cea91886cafa2c886e242a | 473 | https://github.com/orktes/atom-react/blob/b92973729dc12e59b4cea91886cafa2c886e242a/index.coffee | 14 | 63 | ||
orktes/atom-react:index.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
class AtomReact
Subscriber.includeInto(this)
tagStartRegex: new OnigRegExp('(?x)((^|=|return)\\s*<([^!/?](?!.+?(</.+?>))))')
complexAttributeRegex: new OnigRegExp('(?x)\\{ [^}"\']* $|\\( [^)"\']* $')
constructor: ->
patchEditorLangModeAutoDecreaseInden... | var AtomReact;
AtomReact = (function() {
class AtomReact {
constructor() {}
patchEditorLangModeAutoDecreaseIndentForBufferRow(editor) {
var fn, self;
self = this;
fn = editor.languageMode.autoDecreaseIndentForBufferRow;
return editor.languageMode.autoDecreaseIndentForBufferRow = func... | CoffeeScript | JavaScript | orktes/atom-react | index.coffee | MIT | b92973729dc12e59b4cea91886cafa2c886e242a | 473 | https://github.com/orktes/atom-react/blob/b92973729dc12e59b4cea91886cafa2c886e242a/index.coffee | 14 | 63 |
orktes/atom-react:index.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var AtomReact;
AtomReact = (function() {
class AtomReact {
constructor() {}
patchEditorLangModeAutoDecreaseIndentForBufferRow(editor) {
var fn, self;
self = this;
fn = editor.languageMode.autoDecreaseIndentForBufferRow;
return ed... | class AtomReact
Subscriber.includeInto(this)
tagStartRegex: new OnigRegExp('(?x)((^|=|return)\\s*<([^!/?](?!.+?(</.+?>))))')
complexAttributeRegex: new OnigRegExp('(?x)\\{ [^}"\']* $|\\( [^)"\']* $')
constructor: ->
patchEditorLangModeAutoDecreaseIndentForBufferRow: (editor) ->
self = this
fn = edito... | JavaScript | CoffeeScript | orktes/atom-react | index.coffee | MIT | b92973729dc12e59b4cea91886cafa2c886e242a | 473 | https://github.com/orktes/atom-react/blob/b92973729dc12e59b4cea91886cafa2c886e242a/index.coffee | 14 | 63 |
orktes/atom-react:index.coffee:2:completion | completion | class AtomReact
Subscriber.includeInto(this)
tagStartRegex: new OnigRegExp('(?x)((^|=|return)\\s*<([^!/?](?!.+?(</.+?>))))')
complexAttributeRegex: new OnigRegExp('(?x)\\{ [^}"\']* $|\\( [^)"\']* $')
constructor: ->
patchEditorLangModeAutoDecreaseIndentForBufferRow: (editor) ->
self = this
fn = edito... | not (increaseIndentRegex and increaseIndentRegex.testSync(precedingLine))
currentIndentLevel = @editor.indentationForBufferRow(precedingRow)
currentIndentLevel -= 1 if decreaseIndentRegex and decreaseIndentRegex.testSync(line)
desiredIndentLevel = currentIndentLevel - 1
if desiredIndentL... | CoffeeScript | CoffeeScript | orktes/atom-react | index.coffee | MIT | b92973729dc12e59b4cea91886cafa2c886e242a | 473 | https://github.com/orktes/atom-react/blob/b92973729dc12e59b4cea91886cafa2c886e242a/index.coffee | 14 | 63 |
orktes/atom-react:index.coffee:3:raw_corpus | raw_corpus | indent += 1 if self.tagStartRegex.testSync(precedingLine) and self.complexAttributeRegex.testSync(precedingLine)
indent -= 1 if precedingLine and decreaseNextLineIndentRegex.testSync(precedingLine)
return Math.max(indent, 0)
patchEditorLangMode: (editor) ->
@patchEditorLangModeSuggestedIndentForBuff... | CoffeeScript | orktes/atom-react | index.coffee | MIT | b92973729dc12e59b4cea91886cafa2c886e242a | 473 | https://github.com/orktes/atom-react/blob/b92973729dc12e59b4cea91886cafa2c886e242a/index.coffee | 64 | 89 | ||
orktes/atom-react:index.coffee:3:completion | completion | indent += 1 if self.tagStartRegex.testSync(precedingLine) and self.complexAttributeRegex.testSync(precedingLine)
indent -= 1 if precedingLine and decreaseNextLineIndentRegex.testSync(precedingLine)
return Math.max(indent, 0)
patchEditorLangMode: (editor) ->
@patchEditorLangModeSuggestedIndentForBuff... | activate: ->
# Patch edtiors language mode to get proper indention
@patchEditorLangMode(editor) for editor in atom.workspace.getTextEditors()
@subscribe atom.workspace.onDidAddTextEditor (event) =>
editor = event.textEditor
@patchEditorLangMode(editor)
# Check if file extension is .jsx ... | CoffeeScript | CoffeeScript | orktes/atom-react | index.coffee | MIT | b92973729dc12e59b4cea91886cafa2c886e242a | 473 | https://github.com/orktes/atom-react/blob/b92973729dc12e59b4cea91886cafa2c886e242a/index.coffee | 64 | 89 |
orktes/atom-react:index.coffee:2:raw_corpus | raw_corpus | class AtomReact
Subscriber.includeInto(this)
constructor: ->
patchEditorLangModeAutoDecreaseIndentForBufferRow: (editor) ->
self = this
fn = editor.languageMode.autoDecreaseIndentForBufferRow
editor.languageMode.autoDecreaseIndentForBufferRow = (bufferRow, options) ->
return fn.call(editor.langu... | CoffeeScript | orktes/atom-react | index.coffee | MIT | 730728b9709216be1f4f51fa4880b204b3d4638b | 473 | https://github.com/orktes/atom-react/blob/730728b9709216be1f4f51fa4880b204b3d4638b/index.coffee | 14 | 63 | ||
orktes/atom-react:index.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
class AtomReact
Subscriber.includeInto(this)
constructor: ->
patchEditorLangModeAutoDecreaseIndentForBufferRow: (editor) ->
self = this
fn = editor.languageMode.autoDecreaseIndentForBufferRow
editor.languageMode.autoDecreaseIndentForBufferRow = ... | var AtomReact;
AtomReact = (function() {
class AtomReact {
constructor() {}
patchEditorLangModeAutoDecreaseIndentForBufferRow(editor) {
var fn, self;
self = this;
fn = editor.languageMode.autoDecreaseIndentForBufferRow;
return editor.languageMode.autoDecreaseIndentForBufferRow = func... | CoffeeScript | JavaScript | orktes/atom-react | index.coffee | MIT | 730728b9709216be1f4f51fa4880b204b3d4638b | 473 | https://github.com/orktes/atom-react/blob/730728b9709216be1f4f51fa4880b204b3d4638b/index.coffee | 14 | 63 |
orktes/atom-react:index.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var AtomReact;
AtomReact = (function() {
class AtomReact {
constructor() {}
patchEditorLangModeAutoDecreaseIndentForBufferRow(editor) {
var fn, self;
self = this;
fn = editor.languageMode.autoDecreaseIndentForBufferRow;
return ed... | class AtomReact
Subscriber.includeInto(this)
constructor: ->
patchEditorLangModeAutoDecreaseIndentForBufferRow: (editor) ->
self = this
fn = editor.languageMode.autoDecreaseIndentForBufferRow
editor.languageMode.autoDecreaseIndentForBufferRow = (bufferRow, options) ->
return fn.call(editor.langu... | JavaScript | CoffeeScript | orktes/atom-react | index.coffee | MIT | 730728b9709216be1f4f51fa4880b204b3d4638b | 473 | https://github.com/orktes/atom-react/blob/730728b9709216be1f4f51fa4880b204b3d4638b/index.coffee | 14 | 63 |
orktes/atom-react:index.coffee:2:completion | completion | class AtomReact
Subscriber.includeInto(this)
constructor: ->
patchEditorLangModeAutoDecreaseIndentForBufferRow: (editor) ->
self = this
fn = editor.languageMode.autoDecreaseIndentForBufferRow
editor.languageMode.autoDecreaseIndentForBufferRow = (bufferRow, options) ->
return fn.call(editor.langu... | desiredIndentLevel = currentIndentLevel - 1
if desiredIndentLevel >= 0 and desiredIndentLevel < currentIndentLevel
@editor.setIndentationForBufferRow(bufferRow, desiredIndentLevel)
else
fn.call(editor.languageMode, bufferRow, options)
patchEditorLangModeSuggestedIndentForBufferRow: (e... | CoffeeScript | CoffeeScript | orktes/atom-react | index.coffee | MIT | 730728b9709216be1f4f51fa4880b204b3d4638b | 473 | https://github.com/orktes/atom-react/blob/730728b9709216be1f4f51fa4880b204b3d4638b/index.coffee | 14 | 63 |
orktes/atom-react:index.coffee:3:raw_corpus | raw_corpus | patchEditorLangMode: (editor) ->
@patchEditorLangModeSuggestedIndentForBufferRow(editor)
@patchEditorLangModeAutoDecreaseIndentForBufferRow(editor)
decreaseNextLineIndentRegex: (editor) ->
new OnigRegExp('/>\\s*$')
activate: ->
# Patch edtiors language mode to get proper indention
@patchEditor... | CoffeeScript | orktes/atom-react | index.coffee | MIT | 730728b9709216be1f4f51fa4880b204b3d4638b | 473 | https://github.com/orktes/atom-react/blob/730728b9709216be1f4f51fa4880b204b3d4638b/index.coffee | 64 | 84 | ||
orktes/atom-react:index.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
patchEditorLangMode: (editor) ->
@patchEditorLangModeSuggestedIndentForBufferRow(editor)
@patchEditorLangModeAutoDecreaseIndentForBufferRow(editor)
decreaseNextLineIndentRegex: (editor) ->
new OnigRegExp('/>\\s*$')
activate: ->
# Patch edtio... | ({
patchEditorLangMode: function(editor) {
this.patchEditorLangModeSuggestedIndentForBufferRow(editor);
return this.patchEditorLangModeAutoDecreaseIndentForBufferRow(editor);
},
decreaseNextLineIndentRegex: function(editor) {
return new OnigRegExp('/>\\s*$');
},
activate: function() {
var edit... | CoffeeScript | JavaScript | orktes/atom-react | index.coffee | MIT | 730728b9709216be1f4f51fa4880b204b3d4638b | 473 | https://github.com/orktes/atom-react/blob/730728b9709216be1f4f51fa4880b204b3d4638b/index.coffee | 64 | 84 |
orktes/atom-react:index.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
({
patchEditorLangMode: function(editor) {
this.patchEditorLangModeSuggestedIndentForBufferRow(editor);
return this.patchEditorLangModeAutoDecreaseIndentForBufferRow(editor);
},
decreaseNextLineIndentRegex: function(editor) {
return new OnigRegExp... | patchEditorLangMode: (editor) ->
@patchEditorLangModeSuggestedIndentForBufferRow(editor)
@patchEditorLangModeAutoDecreaseIndentForBufferRow(editor)
decreaseNextLineIndentRegex: (editor) ->
new OnigRegExp('/>\\s*$')
activate: ->
# Patch edtiors language mode to get proper indention
@patchEditor... | JavaScript | CoffeeScript | orktes/atom-react | index.coffee | MIT | 730728b9709216be1f4f51fa4880b204b3d4638b | 473 | https://github.com/orktes/atom-react/blob/730728b9709216be1f4f51fa4880b204b3d4638b/index.coffee | 64 | 84 |
orktes/atom-react:index.coffee:3:completion | completion | patchEditorLangMode: (editor) ->
@patchEditorLangModeSuggestedIndentForBufferRow(editor)
@patchEditorLangModeAutoDecreaseIndentForBufferRow(editor)
decreaseNextLineIndentRegex: (editor) ->
new OnigRegExp('/>\\s*$')
activate: ->
# Patch edtiors language mode to get proper indention
@patchEditor... | @subscribe atom.workspace.onDidAddTextEditor (event) =>
editor = event.textEditor
@patchEditorLangMode(editor)
# Check if file extension is .jsx or the file has the old JSX notation
if path.extname(editor.getPath()) is ".jsx" or isJSX(editor.getText())
jsxGrammar = atom.syntax.grammars... | CoffeeScript | CoffeeScript | orktes/atom-react | index.coffee | MIT | 730728b9709216be1f4f51fa4880b204b3d4638b | 473 | https://github.com/orktes/atom-react/blob/730728b9709216be1f4f51fa4880b204b3d4638b/index.coffee | 64 | 84 |
orktes/atom-react:index.coffee:2:raw_corpus | raw_corpus | class AtomReact
Subscriber.includeInto(this)
constructor: ->
patchEditorLangModeAutoDecreaseIndentForBufferRow: (editor) ->
self = this
fn = editor.languageMode.autoDecreaseIndentForBufferRow
editor.languageMode.autoDecreaseIndentForBufferRow = (bufferRow, options) ->
return fn.call(editor.langu... | CoffeeScript | orktes/atom-react | index.coffee | MIT | f051060c48b9d2662f9348cc84747e3f9e644895 | 473 | https://github.com/orktes/atom-react/blob/f051060c48b9d2662f9348cc84747e3f9e644895/index.coffee | 14 | 63 | ||
orktes/atom-react:index.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
class AtomReact
Subscriber.includeInto(this)
constructor: ->
patchEditorLangModeAutoDecreaseIndentForBufferRow: (editor) ->
self = this
fn = editor.languageMode.autoDecreaseIndentForBufferRow
editor.languageMode.autoDecreaseIndentForBufferRow = ... | var AtomReact;
AtomReact = (function() {
class AtomReact {
constructor() {}
patchEditorLangModeAutoDecreaseIndentForBufferRow(editor) {
var fn, self;
self = this;
fn = editor.languageMode.autoDecreaseIndentForBufferRow;
return editor.languageMode.autoDecreaseIndentForBufferRow = func... | CoffeeScript | JavaScript | orktes/atom-react | index.coffee | MIT | f051060c48b9d2662f9348cc84747e3f9e644895 | 473 | https://github.com/orktes/atom-react/blob/f051060c48b9d2662f9348cc84747e3f9e644895/index.coffee | 14 | 63 |
orktes/atom-react:index.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var AtomReact;
AtomReact = (function() {
class AtomReact {
constructor() {}
patchEditorLangModeAutoDecreaseIndentForBufferRow(editor) {
var fn, self;
self = this;
fn = editor.languageMode.autoDecreaseIndentForBufferRow;
return ed... | class AtomReact
Subscriber.includeInto(this)
constructor: ->
patchEditorLangModeAutoDecreaseIndentForBufferRow: (editor) ->
self = this
fn = editor.languageMode.autoDecreaseIndentForBufferRow
editor.languageMode.autoDecreaseIndentForBufferRow = (bufferRow, options) ->
return fn.call(editor.langu... | JavaScript | CoffeeScript | orktes/atom-react | index.coffee | MIT | f051060c48b9d2662f9348cc84747e3f9e644895 | 473 | https://github.com/orktes/atom-react/blob/f051060c48b9d2662f9348cc84747e3f9e644895/index.coffee | 14 | 63 |
orktes/atom-react:index.coffee:2:completion | completion | class AtomReact
Subscriber.includeInto(this)
constructor: ->
patchEditorLangModeAutoDecreaseIndentForBufferRow: (editor) ->
self = this
fn = editor.languageMode.autoDecreaseIndentForBufferRow
editor.languageMode.autoDecreaseIndentForBufferRow = (bufferRow, options) ->
return fn.call(editor.langu... | desiredIndentLevel = currentIndentLevel - 1
if desiredIndentLevel >= 0 and desiredIndentLevel < currentIndentLevel
@editor.setIndentationForBufferRow(bufferRow, desiredIndentLevel)
else
fn.call(editor.languageMode, bufferRow, options)
patchEditorLangModeSuggestedIndentForBufferRow: (e... | CoffeeScript | CoffeeScript | orktes/atom-react | index.coffee | MIT | f051060c48b9d2662f9348cc84747e3f9e644895 | 473 | https://github.com/orktes/atom-react/blob/f051060c48b9d2662f9348cc84747e3f9e644895/index.coffee | 14 | 63 |
orktes/atom-react:index.coffee:3:raw_corpus | raw_corpus | indent -= 1 if precedingLine and decreaseNextLineIndentRegex.testSync(precedingLine)
return Math.max(indent, 0)
patchEditorLangMode: (editor) ->
@patchEditorLangModeSuggestedIndentForBufferRow(editor)
@patchEditorLangModeAutoDecreaseIndentForBufferRow(editor)
decreaseNextLineIndentRegex: (editor) -... | CoffeeScript | orktes/atom-react | index.coffee | MIT | f051060c48b9d2662f9348cc84747e3f9e644895 | 473 | https://github.com/orktes/atom-react/blob/f051060c48b9d2662f9348cc84747e3f9e644895/index.coffee | 64 | 87 | ||
orktes/atom-react:index.coffee:3:completion | completion | indent -= 1 if precedingLine and decreaseNextLineIndentRegex.testSync(precedingLine)
return Math.max(indent, 0)
patchEditorLangMode: (editor) ->
@patchEditorLangModeSuggestedIndentForBufferRow(editor)
@patchEditorLangModeAutoDecreaseIndentForBufferRow(editor)
decreaseNextLineIndentRegex: (editor) -... | # Patch edtiors language mode to get proper indention
@patchEditorLangMode(editor) for editor in atom.workspace.getTextEditors()
@subscribe atom.workspace.onDidAddTextEditor (event) =>
editor = event.textEditor
@patchEditorLangMode(editor)
# Check if file extension is .jsx or the file has t... | CoffeeScript | CoffeeScript | orktes/atom-react | index.coffee | MIT | f051060c48b9d2662f9348cc84747e3f9e644895 | 473 | https://github.com/orktes/atom-react/blob/f051060c48b9d2662f9348cc84747e3f9e644895/index.coffee | 64 | 87 |
orktes/atom-react:index.coffee:2:raw_corpus | raw_corpus | class AtomReact
Subscriber.includeInto(this)
constructor: ->
patchEditorLangModeAutoDecreaseIndentForBufferRow: (editor) ->
self = this
fn = editor.languageMode.autoDecreaseIndentForBufferRow
editor.languageMode.autoDecreaseIndentForBufferRow = (bufferRow, options) ->
return fn.call(editor.langu... | CoffeeScript | orktes/atom-react | index.coffee | MIT | 2870e6ac702ff8ef114c31a8255df8321b7824b4 | 473 | https://github.com/orktes/atom-react/blob/2870e6ac702ff8ef114c31a8255df8321b7824b4/index.coffee | 14 | 63 | ||
orktes/atom-react:index.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
class AtomReact
Subscriber.includeInto(this)
constructor: ->
patchEditorLangModeAutoDecreaseIndentForBufferRow: (editor) ->
self = this
fn = editor.languageMode.autoDecreaseIndentForBufferRow
editor.languageMode.autoDecreaseIndentForBufferRow = ... | var AtomReact;
AtomReact = (function() {
class AtomReact {
constructor() {}
patchEditorLangModeAutoDecreaseIndentForBufferRow(editor) {
var fn, self;
self = this;
fn = editor.languageMode.autoDecreaseIndentForBufferRow;
return editor.languageMode.autoDecreaseIndentForBufferRow = func... | CoffeeScript | JavaScript | orktes/atom-react | index.coffee | MIT | 2870e6ac702ff8ef114c31a8255df8321b7824b4 | 473 | https://github.com/orktes/atom-react/blob/2870e6ac702ff8ef114c31a8255df8321b7824b4/index.coffee | 14 | 63 |
orktes/atom-react:index.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var AtomReact;
AtomReact = (function() {
class AtomReact {
constructor() {}
patchEditorLangModeAutoDecreaseIndentForBufferRow(editor) {
var fn, self;
self = this;
fn = editor.languageMode.autoDecreaseIndentForBufferRow;
return ed... | class AtomReact
Subscriber.includeInto(this)
constructor: ->
patchEditorLangModeAutoDecreaseIndentForBufferRow: (editor) ->
self = this
fn = editor.languageMode.autoDecreaseIndentForBufferRow
editor.languageMode.autoDecreaseIndentForBufferRow = (bufferRow, options) ->
return fn.call(editor.langu... | JavaScript | CoffeeScript | orktes/atom-react | index.coffee | MIT | 2870e6ac702ff8ef114c31a8255df8321b7824b4 | 473 | https://github.com/orktes/atom-react/blob/2870e6ac702ff8ef114c31a8255df8321b7824b4/index.coffee | 14 | 63 |
orktes/atom-react:index.coffee:2:completion | completion | class AtomReact
Subscriber.includeInto(this)
constructor: ->
patchEditorLangModeAutoDecreaseIndentForBufferRow: (editor) ->
self = this
fn = editor.languageMode.autoDecreaseIndentForBufferRow
editor.languageMode.autoDecreaseIndentForBufferRow = (bufferRow, options) ->
return fn.call(editor.langu... | @editor.setIndentationForBufferRow(bufferRow, desiredIndentLevel)
else
fn.call(editor.languageMode, bufferRow, options)
patchEditorLangModeSuggestedIndentForBufferRow: (editor) ->
self = this
fn = editor.languageMode.suggestedIndentForBufferRow
editor.languageMode.suggestedIndentForBufferRo... | CoffeeScript | CoffeeScript | orktes/atom-react | index.coffee | MIT | 2870e6ac702ff8ef114c31a8255df8321b7824b4 | 473 | https://github.com/orktes/atom-react/blob/2870e6ac702ff8ef114c31a8255df8321b7824b4/index.coffee | 14 | 63 |
orktes/atom-react:index.coffee:3:raw_corpus | raw_corpus | return Math.max(indent, 0)
patchEditorLangMode: (editor) ->
@patchEditorLangModeSuggestedIndentForBufferRow(editor)
@patchEditorLangModeAutoDecreaseIndentForBufferRow(editor)
decreaseNextLineIndentRegex: (editor) ->
new OnigRegExp('/>\\s*$')
activate: ->
# Patch edtiors language mode to get pro... | CoffeeScript | orktes/atom-react | index.coffee | MIT | 2870e6ac702ff8ef114c31a8255df8321b7824b4 | 473 | https://github.com/orktes/atom-react/blob/2870e6ac702ff8ef114c31a8255df8321b7824b4/index.coffee | 64 | 86 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.