CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
sagemathinc

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: sagemathinc/cocalc
Path: blob/master/src/packages/frontend/codemirror/modes.js
Views: 687
1
//########################################################################
2
// This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.
3
// License: MS-RSL – see LICENSE.md for details
4
//########################################################################
5
6
/*
7
Load javascript support for all modes that we support in CoCalc.
8
9
NOTE: This is used by the share server, so we can't load css or other stuff
10
that shouldn't also be used on the backend.
11
*/
12
13
require("codemirror/mode/clike/clike.js");
14
require("codemirror/mode/clojure/clojure.js");
15
require("codemirror/mode/cobol/cobol.js");
16
require("codemirror/mode/coffeescript/coffeescript.js");
17
require("codemirror/mode/commonlisp/commonlisp.js");
18
require("codemirror/mode/css/css.js");
19
require("codemirror/mode/diff/diff.js");
20
require("codemirror/mode/dockerfile/dockerfile.js");
21
require("codemirror/mode/dtd/dtd.js");
22
require("codemirror/mode/ecl/ecl.js");
23
require("codemirror/mode/eiffel/eiffel.js");
24
require("codemirror/mode/elm/elm.js");
25
require("codemirror/mode/erlang/erlang.js");
26
require("codemirror/mode/fortran/fortran.js");
27
require("codemirror/mode/gfm/gfm.js");
28
require("codemirror/mode/go/go.js");
29
require("codemirror/mode/groovy/groovy.js");
30
require("codemirror/mode/haskell/haskell.js");
31
require("codemirror/mode/haxe/haxe.js");
32
require("codemirror/mode/htmlembedded/htmlembedded.js");
33
require("codemirror/mode/htmlmixed/htmlmixed.js");
34
require("codemirror/mode/http/http.js");
35
require("codemirror/mode/javascript/javascript.js");
36
require("codemirror/mode/jinja2/jinja2.js");
37
require("codemirror/mode/jsx/jsx.js");
38
require("codemirror/mode/julia/julia.js");
39
require("codemirror/mode/livescript/livescript.js");
40
require("codemirror/mode/lua/lua.js");
41
require("codemirror/mode/markdown/markdown.js");
42
require("codemirror/mode/mllike/mllike.js");
43
require("codemirror/mode/nginx/nginx.js");
44
require("codemirror/mode/ntriples/ntriples.js");
45
require("codemirror/mode/octave/octave.js");
46
require("codemirror/mode/pascal/pascal.js");
47
require("codemirror/mode/pegjs/pegjs.js");
48
require("codemirror/mode/perl/perl.js");
49
require("codemirror/mode/php/php.js");
50
require("codemirror/mode/pig/pig.js");
51
require("codemirror/mode/properties/properties.js");
52
require("codemirror/mode/pug/pug.js");
53
require("codemirror/mode/r/r.js");
54
require("codemirror/mode/ruby/ruby.js");
55
require("codemirror/mode/rust/rust.js");
56
require("codemirror/mode/sass/sass.js");
57
require("codemirror/mode/scheme/scheme.js");
58
require("codemirror/mode/shell/shell.js");
59
require("codemirror/mode/sieve/sieve.js");
60
require("codemirror/mode/smalltalk/smalltalk.js");
61
require("codemirror/mode/smarty/smarty.js");
62
require("codemirror/mode/sparql/sparql.js");
63
require("codemirror/mode/sql/sql.js");
64
require("codemirror/mode/stex/stex.js");
65
require("codemirror/mode/tiddlywiki/tiddlywiki.js");
66
require("codemirror/mode/tiki/tiki.js");
67
require("codemirror/mode/toml/toml.js");
68
require("codemirror/mode/vb/vb.js");
69
require("codemirror/mode/vbscript/vbscript.js");
70
require("codemirror/mode/velocity/velocity.js");
71
require("codemirror/mode/verilog/verilog.js");
72
require("codemirror/mode/xml/xml.js");
73
require("codemirror/mode/xquery/xquery.js");
74
require("codemirror/mode/yaml/yaml.js");
75
require("codemirror/mode/yaml-frontmatter/yaml-frontmatter.js");
76
require("codemirror/mode/z80/z80.js");
77
require("codemirror/mode/gas/gas.js");
78
79
/*
80
* In mode/python/python.js I add our unicode output character to be a comment starter:
81
82
// Handle Comments
83
if (ch == "#" || ch == "\uFE21") {
84
85
Also, it's critical to fix a bug by replacing the state function by
86
87
function top(state) {
88
if (state.scopes.length == 0) {
89
return {type:"undefined", offset:0}; // better than totally crashing
90
}
91
return state.scopes[state.scopes.length - 1];
92
}
93
*/
94
require("./mode/python.js");
95
96
require("./mode/makefile.js");
97
98
// In ReST mode/rst/rst.js, add Sage support:
99
// var rx_examples = new RegExp('^\\s+(?:>>>|sage:|In \\[\\d+\\]:)\\s');
100
require("./mode/rst.js");
101
102
// Modify the coffeescript mode to support cjsx.
103
require("./mode/coffeescript2.js");
104
105
require("./mode/less.js");
106
require("./mode/pari.js");
107
require("./mode/macaulay2.js");
108
109
require("./mode/mediawiki/mediawiki.js");
110
111
require("./mode/lean");
112
113
require("./mode/ada");
114
115
require("./custom-modes");
116
117