|
10 | 10 | <script> |
11 | 11 | CodeMirror.commands.autocomplete = function(cm) { |
12 | 12 | var langType = top.ICEcoder.caretLocType; |
13 | | - if (["JavaScript","CoffeeScript","SQL","CSS","HTML","XML","Content"].indexOf(langType)>-1) { |
| 13 | + if (["JavaScript","CoffeeScript","TypeScript","SQL","CSS","HTML","XML","Content"].indexOf(langType)>-1) { |
14 | 14 | if (langType=="XML"||langType=="Content") {langType="HTML"}; |
15 | 15 | CodeMirror.showHint(cm,CodeMirror.hint[langType.toLowerCase()]); |
16 | 16 | } |
|
46 | 46 | var comments, startLine, endLine, commentCH, commentBS, commentBE; |
47 | 47 |
|
48 | 48 | // Language specific commenting |
49 | | - if (["JavaScript","CoffeeScript","PHP","Python","Ruby","CSS","SQL","Erlang","Julia","Java","YAML","C","C++","C#","Go","Lua","Perl","Sass"].indexOf(top.ICEcoder.caretLocType)>-1) { |
| 49 | + if (["JavaScript","CoffeeScript","TypeScript","PHP","Python","Ruby","CSS","SQL","Erlang","Julia","Java","YAML","C","C++","C#","Go","Lua","Perl","Sass"].indexOf(top.ICEcoder.caretLocType)>-1) { |
50 | 50 |
|
51 | 51 | comments = { |
52 | 52 | "JavaScript" : ["// ", "/* ", " */"], |
53 | | - "CoffeeScript" : ["// ", "/* ", " */"], |
| 53 | + "CoffeeScript" : ["# ", "### ", " ###"], |
| 54 | + "TypeScript" : ["// ", "/* ", " */"], |
54 | 55 | "PHP" : ["// ", "/* ", " */"], |
55 | 56 | "Python" : ["# ", "/* ", " */"], |
56 | 57 | "Ruby" : ["# ", "/* ", " */"], |
|
93 | 94 | } |
94 | 95 | // Single line commenting |
95 | 96 | } else { |
96 | | - if (["CoffeeScript","CSS","SQL"].indexOf(top.ICEcoder.caretLocType)>-1) { |
| 97 | + if (["CSS","SQL"].indexOf(top.ICEcoder.caretLocType)>-1) { |
97 | 98 | cM.replaceRange(lineContent.slice(0,commentBS.length)!=commentBS |
98 | 99 | ? commentBS + lineContent + commentBE |
99 | 100 | : lineContent.slice(commentBS.length,lCLen-commentBE.length), {line: linePos, ch: 0}, {line: linePos, ch: 1000000}); |
|
137 | 138 | fileExt = fileName.split("."); |
138 | 139 | fileExt = fileExt[fileExt.length-1]; |
139 | 140 | } |
140 | | - if (thisCM && fileName && ["js","coffee","css","less","sql","erl","yaml","java","jl","c","cpp","ino","cs","go","lua","pl","scss"].indexOf(fileExt)==-1) { |
| 141 | + if (thisCM && fileName && ["js","coffee","ts","css","less","sql","erl","yaml","java","jl","c","cpp","ino","cs","go","lua","pl","scss"].indexOf(fileExt)==-1) { |
141 | 142 | testToken = thisCM.getTokenAt({line:thisCM.lineCount(),ch:thisCM.lineInfo(thisCM.lineCount()-1).text.length}); |
142 | 143 | nestOK = testToken.type && testToken.type.indexOf("error") == -1 ? true : false; |
143 | 144 | } |
|
169 | 170 | caretLocType = |
170 | 171 | fileExt == "js" ? "JavaScript" |
171 | 172 | : fileExt == "coffee" ? "CoffeeScript" |
| 173 | + : fileExt == "ts" ? "TypeScript" |
172 | 174 | : fileExt == "py" ? "Python" |
173 | 175 | : fileExt == "rb" ? "Ruby" |
174 | 176 | : fileExt == "css" ? "CSS" |
|
0 commit comments