Closed azuharu closed 4 years ago
duplicate of #183
yes it would be awesome if it automatically detects file-type.
here I'm editing .php
file but it is showing as JavaScript.
@prasathmani
not sure what the problem is after inspect i found that code is working fine. but still ace editor is not switching automatically to php
The problem is that the selector always displays "javascript" as the first choice. It cannot reflect current choice. (It is part of the ACE system)
Incidentally, there is another problem by simply specifying file extension as document type. It only succeeds in: .php, .xml, .html, .text and a few others.
For example, it fails with: .htm, .txt .js and many others, since the system's defined document types must be specified. For this to work, a file extension to document type must be converted.
Here is the list of document types:
"aceMode":{
"javascript":"JavaScript",
"abap":"ABAP",
"abc":"ABC",
"actionscript":"ActionScript",
"ada":"ADA",
"apache_conf":"Apache Conf",
"asciidoc":"AsciiDoc",
"asl":"ASL",
"assembly_x86":"Assembly x86",
"autohotkey":"AutoHotKey",
"apex":"Apex",
"batchfile":"BatchFile",
"bro":"Bro",
"c_cpp":"C and C++",
"c9search":"C9Search",
"cirru":"Cirru",
"clojure":"Clojure",
"cobol":"Cobol",
"coffee":"CoffeeScript",
"coldfusion":"ColdFusion",
"csharp":"C#",
"csound_document":"Csound Document",
"csound_orchestra":"Csound",
"csound_score":"Csound Score",
"css":"CSS",
"curly":"Curly",
"d":"D",
"dart":"Dart",
"diff":"Diff",
"dockerfile":"Dockerfile",
"dot":"Dot",
"drools":"Drools",
"edifact":"Edifact",
"eiffel":"Eiffel",
"ejs":"EJS",
"elixir":"Elixir",
"elm":"Elm",
"erlang":"Erlang",
"forth":"Forth",
"fortran":"Fortran",
"fsharp":"FSharp",
"fsl":"FSL",
"ftl":"FreeMarker",
"gcode":"Gcode",
"gherkin":"Gherkin",
"gitignore":"Gitignore",
"glsl":"Glsl",
"gobstones":"Gobstones",
"golang":"Go",
"graphqlschema":"GraphQLSchema",
"groovy":"Groovy",
"haml":"HAML",
"handlebars":"Handlebars",
"haskell":"Haskell",
"haskell_cabal":"Haskell Cabal",
"haxe":"haXe",
"hjson":"Hjson",
"html":"HTML",
"html_elixir":"HTML (Elixir)",
"html_ruby":"HTML (Ruby)",
"ini":"INI",
"io":"Io",
"jack":"Jack",
"jade":"Jade",
"java":"Java",
"json":"JSON",
"jsoniq":"JSONiq",
"jsp":"JSP",
"jssm":"JSSM",
"jsx":"JSX",
"julia":"Julia",
"kotlin":"Kotlin",
"latex":"LaTeX",
"less":"LESS",
"liquid":"Liquid",
"lisp":"Lisp",
"livescript":"LiveScript",
"logiql":"LogiQL",
"lsl":"LSL",
"lua":"Lua",
"luapage":"LuaPage",
"lucene":"Lucene",
"makefile":"Makefile",
"markdown":"Markdown",
"mask":"Mask",
"matlab":"MATLAB",
"maze":"Maze",
"mel":"MEL",
"mixal":"MIXAL",
"mushcode":"MUSHCode",
"mysql":"MySQL",
"nix":"Nix",
"nsis":"NSIS",
"objectivec":"Objective-C",
"ocaml":"OCaml",
"pascal":"Pascal",
"perl":"Perl",
"perl6":"Perl 6",
"pgsql":"pgSQL",
"php_laravel_blade":"PHP (Blade Template)",
"php":"PHP",
"puppet":"Puppet",
"pig":"Pig",
"powershell":"Powershell",
"praat":"Praat",
"prolog":"Prolog",
"properties":"Properties",
"protobuf":"Protobuf",
"python":"Python",
"r":"R",
"razor":"Razor",
"rdoc":"RDoc",
"red":"Red",
"rhtml":"RHTML",
"rst":"RST",
"ruby":"Ruby",
"rust":"Rust",
"sass":"SASS",
"scad":"SCAD",
"scala":"Scala",
"scheme":"Scheme",
"scss":"SCSS",
"sh":"SH",
"sjs":"SJS",
"slim":"Slim",
"smarty":"Smarty",
"snippets":"snippets",
"soy_template":"Soy Template",
"space":"Space",
"sql":"SQL",
"sqlserver":"SQLServer",
"stylus":"Stylus",
"svg":"SVG",
"swift":"Swift",
"tcl":"Tcl",
"terraform":"Terraform",
"tex":"Tex",
"text":"Text",
"textile":"Textile",
"toml":"Toml",
"tsx":"TSX",
"twig":"Twig",
"typescript":"Typescript",
"vala":"Vala",
"vbscript":"VBScript",
"velocity":"Velocity",
"verilog":"Verilog",
"vhdl":"VHDL",
"visualforce":"Visualforce",
"wollok":"Wollok",
"xml":"XML",
"xquery":"XQuery",
"yaml":"YAML",
"django":"Django"
},
And here is a link to all the .js modules that can be used. https://github.com/ajaxorg/ace/tree/master/lib/ace/mode
Hi there, I wonder if we can set automatically opened file in ace editor?
in my case, I open php files, but selected mode is Javascript
Thank you