diff --git a/src/data/languages.json b/src/data/languages.json index f11b656..56d9b08 100644 --- a/src/data/languages.json +++ b/src/data/languages.json @@ -1,857 +1,941 @@ { - ".swf": { - "image": "as" - }, - ".as": { - "image": "as" - }, - ".jsfl": { - "image": "as" - }, - ".swc": { - "image": "as" - }, - ".asp": { - "image": "asp" - }, - ".asax": { - "image": "asp" - }, - ".ascx": { - "image": "asp" - }, - ".ashx": { - "image": "asp" - }, - ".asmx": { - "image": "asp" - }, - ".aspx": { - "image": "asp" - }, - ".axd": { - "image": "asp" - }, - "/\\.(l?a|[ls]?o|out|s|a51|asm|axf|elf|prx|puff|z80)$/i": { - "image": "assembly" - }, - ".agc": { - "image": "assembly" - }, - ".ko": { - "image": "assembly" - }, - ".lst": { - "image": "assembly" - }, - "/\\.((c([+px]{2}?)?-?)?objdump|bsdiff|bin|dat|pak|pdb)$/i": { - "image": "assembly" - }, - ".d-objdump": { - "image": "assembly" - }, - "/\\.gcode|\\.gco/i": { - "image": "assembly" - }, - "/\\.rpy[bc]$/i": { - "image": "assembly" - }, - "/\\.py[co]$/i": { - "image": "assembly" - }, - ".swp": { - "image": "assembly" - }, - ".DS_Store": { - "image": "assembly" - }, - ".ahk": { - "image": "ahk" - }, - ".ahkl": { - "image": "ahk" - }, - ".au3": { - "image": "autoit" - }, - "/^(\\.bowerrc|bower\\.json|Bowerfile)$/i": { - "image": "bower" - }, - "/\\.bf?$/i": { - "image": "brainfuck" - }, - "/^Gemfile(\\.lock)?$/i": { - "image": "gemfile" - }, - ".c": { - "image": "c" - }, - "/\\.c[+px]{2}$|\\.cc$/i": { - "image": "cpp" - }, - "/\\.h[+px]{2}$/i": { - "image": "cpp" - }, - "/\\.[it]pp$/i": { - "image": "cpp" - }, - "/\\.(tcc|inl)$/i": { - "image": "cpp" - }, - ".cats": { - "image": "cpp" - }, - ".idc": { - "image": "cpp" - }, - ".w": { - "image": "cpp" - }, - ".nc": { - "image": "cpp" - }, - ".upc": { - "image": "cpp" - }, - ".xpm": { - "image": "cpp" - }, - ".cs": { - "image": "csharp" - }, - ".csx": { - "image": "csharp" - }, - ".clj": { - "image": "clojure" - }, - ".cl2": { - "image": "clojure" - }, - ".cljc": { - "image": "clojure" - }, - ".cljx": { - "image": "clojure" - }, - ".hic": { - "image": "clojure" - }, - "/\\.cljs(cm)?$/i": { - "image": "clojure" - }, - ".cmake": { - "image": "cmake" - }, - "/^CMakeLists\\.txt$/": { - "image": "cmake" - }, - ".coffee": { - "image": "coffee" - }, - ".cjsx": { - "image": "coffee" - }, - ".coffee.ecr": { - "image": "coffee" - }, - ".coffee.erb": { - "image": "coffee" - }, - ".litcoffee": { - "image": "coffee" - }, - ".iced": { - "image": "coffee" - }, - "/\\.e?cr$/i": { - "image": "crystal" - }, - ".css": { - "image": "css" - }, - ".less": { - "image": "less" - }, - "/\\.(styl|stylus)$/i": { - "image": "stylus" - }, - ".scss": { - "image": "scss" - }, - ".sass": { - "image": "scss" - }, - "/\\.di?$/i": { - "image": "d" - }, - ".dart": { - "image": "dart" - }, - "/\\.(h|geo|topo)$/i": { - "image": "manifest" - }, - ".cson": { - "image": "manifest" - }, - ".json5": { - "image": "manifest" - }, - ".http": { - "image": "manifest" - }, - ".ndjson": { - "image": "manifest" - }, - ".fea": { - "image": "manifest" - }, - ".json.eex": { - "image": "manifest" - }, - ".proto": { - "image": "manifest" - }, - ".pytb": { - "image": "manifest" - }, - ".pydeps": { - "image": "manifest" - }, - "/\\.pot?$/i": { - "image": "manifest" - }, - ".ejson": { - "image": "manifest" - }, - ".edn": { - "image": "manifest" - }, - ".eam.fs": { - "image": "manifest" - }, - ".qml": { - "image": "manifest" - }, - ".qbs": { - "image": "manifest" - }, - ".ston": { - "image": "manifest" - }, - ".ttl": { - "image": "manifest" - }, - ".rviz": { - "image": "manifest" - }, - ".syntax": { - "image": "manifest" - }, - ".webmanifest": { - "image": "manifest" - }, - "/^pkginfo$/": { - "image": "manifest" - }, - "/^mime\\.types$/i": { - "image": "manifest" - }, - "/^METADATA\\.pb$/": { - "image": "manifest" - }, - "/[\\/\\\\](?:magic[\\/\\\\]Magdir|file[\\/\\\\]magic)[\\/\\\\][-.\\w]+$/i": { - "image": "manifest" - }, - "/(\\\\|\\/)dev[-\\w]+\\1(?:[^\\\\\\/]+\\1)*(?!DESC|NOTES)(?:[A-Z][-A-Z]*)(?:\\.in)?$/": { - "image": "manifest" - }, - "lib/icons/.icondb.js": { - "image": "manifest" - }, - "/\\.git[\\/\\\\](.*[\\/\\\\])?(HEAD|ORIG_HEAD|packed-refs|logs[\\/\\\\](.+[\\/\\\\])?[^\\/\\\\]+)$/": { - "image": "manifest" - }, - ".dfm": { - "image": "delphi" - }, - ".dpr": { - "image": "delphi" - }, - "/^(Dockerfile|docker-compose)|\\.docker(file|ignore)$/i": { - "image": "docker" - }, - "/^docker-sync\\.yml$/i": { - "image": "docker" - }, - ".ejs": { - "image": "ejs" - }, - ".elm": { - "image": "elm" - }, - ".erl": { - "image": "erlang" - }, - ".beam": { - "image": "erlang" - }, - ".hrl": { - "image": "erlang" - }, - ".xrl": { - "image": "erlang" - }, - ".yrl": { - "image": "erlang" - }, - ".app.src": { - "image": "erlang" - }, - "/^Emakefile$/": { - "image": "erlang" - }, - "/^rebar(\\.config)?\\.lock$/i": { - "image": "erlang" - }, - ".ex": { - "image": "elixir" - }, - "/\\.(exs|eex)$/i": { - "image": "elixir" - }, - "/^mix\\.(exs?|lock)$/i": { - "image": "elixir" - }, - ".fs": { - "image": "fsharp" - }, - ".fsi": { - "image": "fsharp" - }, - ".fsscript": { - "image": "fsharp" - }, - ".fsx": { - "image": "fsharp" - }, - "/^\\.git|^\\.keep$|\\.mailmap$/i": { - "image": "git" - }, - ".go": { - "image": "go" - }, - ".gradle": { - "image": "gradle" - }, - "gradlew": { - "image": "gradle" - }, - ".graphql": { - "image": "graphql" - }, - "/\\.(hbs|handlebars|(mu)?stache)$/i": { - "image": "handlebars" - }, - ".hs": { - "image": "haskell" - }, - ".hsc": { - "image": "haskell" - }, - ".c2hs": { - "image": "haskell" - }, - ".lhs": { - "image": "haskell" - }, - "/\\.x?html?$/i": { - "image": "html" - }, - ".hx": { - "image": "haxe" - }, - ".hxml": { - "image": "haxe" - }, - ".jade": { - "image": "pug" - }, - ".pug": { - "image": "pug" - }, - ".jar": { - "image": "jar" - }, - ".java": { - "image": "java" - }, - ".jil": { - "image": "julia" - }, - ".js": { - "image": "js" - }, - ".es6": { - "image": "js" - }, - ".es": { - "image": "js" - }, - ".mjs": { - "image": "js" - }, - ".jsx": { - "image": "jsx" - }, - ".json": { - "image": "json" - }, - ".kt": { - "image": "kotlin" - }, - ".ktm": { - "image": "kotlin" - }, - ".kts": { - "image": "kotlin" - }, - ".lsp": { - "image": "lisp" - }, - ".lisp": { - "image": "lisp" - }, - ".l": { - "image": "lisp" - }, - ".nl": { - "image": "lisp" - }, - ".ny": { - "image": "lisp" - }, - ".podsl": { - "image": "lisp" - }, - ".sexp": { - "image": "lisp" - }, - ".lua": { - "image": "lua" - }, - ".pd_lua": { - "image": "lua" - }, - ".rbxs": { - "image": "lua" - }, - ".wlua": { - "image": "lua" - }, - "/^Makefile/": { - "image": "makefile" - }, - "/^mk\\.config$/": { - "image": "makefile" - }, - "/\\.(mk|mak|make)$/i": { - "image": "makefile" - }, - "/^BSDmakefile$/i": { - "image": "makefile" - }, - "/^GNUmakefile$/i": { - "image": "makefile" - }, - "/^makefile\\.sco$/i": { - "image": "makefile" - }, - "/^Kbuild$/": { - "image": "makefile" - }, - "/^makefile$/": { - "image": "makefile" - }, - "/^mkfile$/i": { - "image": "makefile" - }, - "/^\\.?qmake$/i": { - "image": "makefile" - }, - "/\\.(md|mdown|markdown|mkd|mkdown|mdwn|mkdn|rmd|ron|pmd)$/i": { - "image": "markdown" - }, - "/\\.mm?$/i": { - "image": "objc" - }, - ".pch": { - "image": "objc" - }, - ".x": { - "image": "objc" - }, - ".ml": { - "image": "ocaml" - }, - ".mli": { - "image": "ocaml" - }, - ".eliom": { - "image": "ocaml" - }, - ".eliomi": { - "image": "ocaml" - }, - ".ml4": { - "image": "ocaml" - }, - ".mll": { - "image": "ocaml" - }, - ".mly": { - "image": "ocaml" - }, - "/\\.pas(cal)?$/i": { - "image": "pascal" - }, - ".lpr": { - "image": "pascal" - }, - "/\\.p(er)?l$/i": { - "image": "perl" - }, - ".al": { - "image": "perl" - }, - ".ph": { - "image": "perl" - }, - ".plx": { - "image": "perl" - }, - ".pm": { - "image": "perl" - }, - "/\\.(psgi|xs)$/i": { - "image": "perl" - }, - ".pl6": { - "image": "perl" - }, - "/\\.[tp]6$|\\.6pl$/i": { - "image": "perl" - }, - "/\\.(pm6|p6m)$/i": { - "image": "perl" - }, - ".6pm": { - "image": "perl" - }, - ".nqp": { - "image": "perl" - }, - ".p6l": { - "image": "perl" - }, - ".pod6": { - "image": "perl" - }, - "/^Rexfile$/": { - "image": "perl" - }, - "/\\.php([st\\d]|_cs)?$/i": { - "image": "php" - }, - "/^Phakefile/": { - "image": "php" - }, - ".ps1": { - "image": "powershell" - }, - ".psd1": { - "image": "powershell" - }, - ".psm1": { - "image": "powershell" - }, - ".ps1xml": { - "image": "powershell" - }, - ".py": { - "image": "python" - }, - ".ipy": { - "image": "python" - }, - ".isolate": { - "image": "python" - }, - ".pep": { - "image": "python" - }, - ".gyp": { - "image": "python" - }, - ".gypi": { - "image": "python" - }, - ".pyde": { - "image": "python" - }, - ".pyp": { - "image": "python" - }, - ".pyt": { - "image": "python" - }, - ".py3": { - "image": "python" - }, - ".pyi": { - "image": "python" - }, - ".pyw": { - "image": "python" - }, - ".tac": { - "image": "python" - }, - ".wsgi": { - "image": "python" - }, - ".xpy": { - "image": "python" - }, - ".rpy": { - "image": "python" - }, - "/\\.?(pypirc|pythonrc|python-venv)$/i": { - "image": "python" - }, - "/^(SConstruct|SConscript)$/": { - "image": "python" - }, - "/^(Snakefile|WATCHLISTS)$/": { - "image": "python" - }, - "/^wscript$/": { - "image": "python" - }, - "/\\.(r|Rprofile|rsx|rd)$/i": { - "image": "r" - }, - "/\\.(rb|ru|ruby|erb|gemspec|god|mspec|pluginspec|podspec|rabl|rake|opal)$/i": { - "image": "ruby" - }, - "/^\\.?(irbrc|gemrc|pryrc|ruby-(gemset|version))$/i": { - "image": "ruby" - }, - "/^(Appraisals|(Rake|[bB]uild|Cap|Danger|Deliver|Fast|Guard|Jar|Maven|Pod|Puppet|Snap)file(\\.lock)?)$/": { - "image": "ruby" - }, - "/\\.(jbuilder|rbuild|rb[wx]|builder)$/i": { - "image": "ruby" - }, - "/^rails$/": { - "image": "ruby" - }, - ".watchr": { - "image": "ruby" - }, - ".rs": { - "image": "rust" - }, - "/\\.(sc|scala)$/i": { - "image": "scala" - }, - "/\\.(sh|rc|bats|bash|tool|install|command)$/i": { - "image": "shell" - }, - "/^(\\.?bash(rc|[-_]?(profile|login|logout|history|prompt))|_osc|config|install-sh|PKGBUILD)$/i": { - "image": "shell" - }, - "/\\.(ksh|mksh|pdksh)$/i": { - "image": "shell" - }, - ".sh-session": { - "image": "shell" - }, - "/\\.zsh(-theme|_history)?$|^\\.?(antigen|zpreztorc|zlogin|zlogout|zprofile|zshenv|zshrc)$/i": { - "image": "shell" - }, - "/\\.fish$|^\\.fishrc$/i": { - "image": "shell" - }, - "/^\\.?(login|profile)$/": { - "image": "shell" - }, - ".inputrc": { - "image": "shell" - }, - ".tmux": { - "image": "shell" - }, - "/^(configure|config\\.(guess|rpath|status|sub)|depcomp|libtool|compile)$/": { - "image": "shell" - }, - "/^\\/(private\\/)?etc\\/([^\\/]+\\/)*(profile$|nanorc$|rc\\.|csh\\.)/i": { - "image": "shell" - }, - "/^\\.?cshrc$/i": { - "image": "shell" - }, - ".profile": { - "image": "shell" - }, - ".tcsh": { - "image": "shell" - }, - ".csh": { - "image": "shell" - }, - "/\\.(my)?sql$/i": { - "image": "sql" - }, - ".ddl": { - "image": "sql" - }, - ".udf": { - "image": "sql" - }, - ".hql": { - "image": "sql" - }, - ".viw": { - "image": "sql" - }, - ".prc": { - "image": "sql" - }, - ".cql": { - "image": "sql" - }, - ".db2": { - "image": "sql" - }, - ".svg": { - "image": "svg" - }, - ".swift": { - "image": "swift" - }, - ".tex": { - "image": "tex" - }, - ".ltx": { - "image": "tex" - }, - ".aux": { - "image": "tex" - }, - ".sty": { - "image": "tex" - }, - ".dtx": { - "image": "tex" - }, - ".cls": { - "image": "tex" - }, - ".ins": { - "image": "tex" - }, - ".lbx": { - "image": "tex" - }, - ".mkiv": { - "image": "tex" - }, - ".mkvi": { - "image": "tex" - }, - ".mkii": { - "image": "tex" - }, - ".texi": { - "image": "tex" - }, - "/^hyphen(ex)?\\.(cs|den|det|fr|sv|us)$/": { - "image": "tex" - }, - ".toml": { - "image": "toml" - }, - ".ts": { - "image": "ts" - }, - ".tsx": { - "image": "tsx" - }, - ".twig": { - "image": "twig" - }, - "/\\.te?xt$/i": { - "image": "text" - }, - ".rtf": { - "image": "text" - }, - "/\\.i?nfo$/i": { - "image": "text" - }, - ".msg": { - "image": "text" - }, - "/\\.(utxt|utf8)$/i": { - "image": "text" - }, - ".vb": { - "image": "vb" - }, - ".vbs": { - "image": "vb" - }, - ".vba": { - "image": "vba" - }, - ".vbhtml": { - "image": "vbhtml" - }, - ".vbproj": { - "image": "vbproj" - }, - ".vcxproj": { - "image": "vcxproj" - }, - ".vscodeignore": { - "image": "vscodeignore" - }, - ".vue": { - "image": "vue" - }, - "/\\.ya?ml$/i": { - "image": "yaml" - }, - "/^yarn(\\.lock)?$/i": { - "image": "yarn" - }, - ".yarnrc": { - "image": "yarn" - }, - ".bat": { - "image": "bat" - }, - ".batch": { - "image": "bat" - }, - ".cmd": { - "image": "bat" - }, - "/\\.(exe|com|msi)$/i": { - "image": "bat" - }, - ".reg": { - "image": "bat" + "knownLanguages": [ + "as", + "asp", + "assembly", + "ahk", + "autoit", + "bower", + "brainfuck", + "gemfile", + "c", + "cpp", + "csharp", + "clojure", + "cmake", + "coffee", + "crystal", + "css", + "less", + "stylus", + "scss", + "d", + "dart", + "manifest", + "delphi", + "docker", + "ejs", + "elm", + "erlang", + "elixir", + "fsharp", + "git", + "go", + "gradle", + "graphql", + "handlebars", + "haskell", + "html", + "haxe", + "pug", + "jar", + "java", + "julia", + "js", + "jsx", + "json", + "kotlin", + "lisp", + "lua", + "makefile", + "markdown", + "objc", + "ocaml", + "pascal", + "perl", + "php", + "powershell", + "python", + "r", + "ruby", + "rust", + "scala", + "shell", + "sql", + "svg", + "swift", + "tex", + "toml", + "ts", + "tsx", + "twig", + "text", + "vb", + "vba", + "vbhtml", + "vbproj", + "vcxproj", + "vscodeignore", + "vue", + "yaml", + "yarn", + "bat" + ], + "knownExtentions": { + ".swf": { + "image": "as" + }, + ".as": { + "image": "as" + }, + ".jsfl": { + "image": "as" + }, + ".swc": { + "image": "as" + }, + ".asp": { + "image": "asp" + }, + ".asax": { + "image": "asp" + }, + ".ascx": { + "image": "asp" + }, + ".ashx": { + "image": "asp" + }, + ".asmx": { + "image": "asp" + }, + ".aspx": { + "image": "asp" + }, + ".axd": { + "image": "asp" + }, + "/\\.(l?a|[ls]?o|out|s|a51|asm|axf|elf|prx|puff|z80)$/i": { + "image": "assembly" + }, + ".agc": { + "image": "assembly" + }, + ".ko": { + "image": "assembly" + }, + ".lst": { + "image": "assembly" + }, + "/\\.((c([+px]{2}?)?-?)?objdump|bsdiff|bin|dat|pak|pdb)$/i": { + "image": "assembly" + }, + ".d-objdump": { + "image": "assembly" + }, + "/\\.gcode|\\.gco/i": { + "image": "assembly" + }, + "/\\.rpy[bc]$/i": { + "image": "assembly" + }, + "/\\.py[co]$/i": { + "image": "assembly" + }, + ".swp": { + "image": "assembly" + }, + ".DS_Store": { + "image": "assembly" + }, + ".ahk": { + "image": "ahk" + }, + ".ahkl": { + "image": "ahk" + }, + ".au3": { + "image": "autoit" + }, + "/^(\\.bowerrc|bower\\.json|Bowerfile)$/i": { + "image": "bower" + }, + "/\\.bf?$/i": { + "image": "brainfuck" + }, + "/^Gemfile(\\.lock)?$/i": { + "image": "gemfile" + }, + ".c": { + "image": "c" + }, + "/\\.c[+px]{2}$|\\.cc$/i": { + "image": "cpp" + }, + "/\\.h[+px]{2}$/i": { + "image": "cpp" + }, + "/\\.[it]pp$/i": { + "image": "cpp" + }, + "/\\.(tcc|inl)$/i": { + "image": "cpp" + }, + ".cats": { + "image": "cpp" + }, + ".idc": { + "image": "cpp" + }, + ".w": { + "image": "cpp" + }, + ".nc": { + "image": "cpp" + }, + ".upc": { + "image": "cpp" + }, + ".xpm": { + "image": "cpp" + }, + ".cs": { + "image": "csharp" + }, + ".csx": { + "image": "csharp" + }, + ".clj": { + "image": "clojure" + }, + ".cl2": { + "image": "clojure" + }, + ".cljc": { + "image": "clojure" + }, + ".cljx": { + "image": "clojure" + }, + ".hic": { + "image": "clojure" + }, + "/\\.cljs(cm)?$/i": { + "image": "clojure" + }, + ".cmake": { + "image": "cmake" + }, + "/^CMakeLists\\.txt$/": { + "image": "cmake" + }, + ".coffee": { + "image": "coffee" + }, + ".cjsx": { + "image": "coffee" + }, + ".coffee.ecr": { + "image": "coffee" + }, + ".coffee.erb": { + "image": "coffee" + }, + ".litcoffee": { + "image": "coffee" + }, + ".iced": { + "image": "coffee" + }, + "/\\.e?cr$/i": { + "image": "crystal" + }, + ".css": { + "image": "css" + }, + ".less": { + "image": "less" + }, + "/\\.(styl|stylus)$/i": { + "image": "stylus" + }, + ".scss": { + "image": "scss" + }, + ".sass": { + "image": "scss" + }, + "/\\.di?$/i": { + "image": "d" + }, + ".dart": { + "image": "dart" + }, + "/\\.(h|geo|topo)$/i": { + "image": "manifest" + }, + ".cson": { + "image": "manifest" + }, + ".json5": { + "image": "manifest" + }, + ".http": { + "image": "manifest" + }, + ".ndjson": { + "image": "manifest" + }, + ".fea": { + "image": "manifest" + }, + ".json.eex": { + "image": "manifest" + }, + ".proto": { + "image": "manifest" + }, + ".pytb": { + "image": "manifest" + }, + ".pydeps": { + "image": "manifest" + }, + "/\\.pot?$/i": { + "image": "manifest" + }, + ".ejson": { + "image": "manifest" + }, + ".edn": { + "image": "manifest" + }, + ".eam.fs": { + "image": "manifest" + }, + ".qml": { + "image": "manifest" + }, + ".qbs": { + "image": "manifest" + }, + ".ston": { + "image": "manifest" + }, + ".ttl": { + "image": "manifest" + }, + ".rviz": { + "image": "manifest" + }, + ".syntax": { + "image": "manifest" + }, + ".webmanifest": { + "image": "manifest" + }, + "/^pkginfo$/": { + "image": "manifest" + }, + "/^mime\\.types$/i": { + "image": "manifest" + }, + "/^METADATA\\.pb$/": { + "image": "manifest" + }, + "/[\\/\\\\](?:magic[\\/\\\\]Magdir|file[\\/\\\\]magic)[\\/\\\\][-.\\w]+$/i": { + "image": "manifest" + }, + "/(\\\\|\\/)dev[-\\w]+\\1(?:[^\\\\\\/]+\\1)*(?!DESC|NOTES)(?:[A-Z][-A-Z]*)(?:\\.in)?$/": { + "image": "manifest" + }, + "lib/icons/.icondb.js": { + "image": "manifest" + }, + "/\\.git[\\/\\\\](.*[\\/\\\\])?(HEAD|ORIG_HEAD|packed-refs|logs[\\/\\\\](.+[\\/\\\\])?[^\\/\\\\]+)$/": { + "image": "manifest" + }, + ".dfm": { + "image": "delphi" + }, + ".dpr": { + "image": "delphi" + }, + "/^(Dockerfile|docker-compose)|\\.docker(file|ignore)$/i": { + "image": "docker" + }, + "/^docker-sync\\.yml$/i": { + "image": "docker" + }, + ".ejs": { + "image": "ejs" + }, + ".elm": { + "image": "elm" + }, + ".erl": { + "image": "erlang" + }, + ".beam": { + "image": "erlang" + }, + ".hrl": { + "image": "erlang" + }, + ".xrl": { + "image": "erlang" + }, + ".yrl": { + "image": "erlang" + }, + ".app.src": { + "image": "erlang" + }, + "/^Emakefile$/": { + "image": "erlang" + }, + "/^rebar(\\.config)?\\.lock$/i": { + "image": "erlang" + }, + ".ex": { + "image": "elixir" + }, + "/\\.(exs|eex)$/i": { + "image": "elixir" + }, + "/^mix\\.(exs?|lock)$/i": { + "image": "elixir" + }, + ".fs": { + "image": "fsharp" + }, + ".fsi": { + "image": "fsharp" + }, + ".fsscript": { + "image": "fsharp" + }, + ".fsx": { + "image": "fsharp" + }, + "/^\\.git|^\\.keep$|\\.mailmap$/i": { + "image": "git" + }, + ".go": { + "image": "go" + }, + ".gradle": { + "image": "gradle" + }, + "gradlew": { + "image": "gradle" + }, + ".graphql": { + "image": "graphql" + }, + "/\\.(hbs|handlebars|(mu)?stache)$/i": { + "image": "handlebars" + }, + ".hs": { + "image": "haskell" + }, + ".hsc": { + "image": "haskell" + }, + ".c2hs": { + "image": "haskell" + }, + ".lhs": { + "image": "haskell" + }, + "/\\.x?html?$/i": { + "image": "html" + }, + ".hx": { + "image": "haxe" + }, + ".hxml": { + "image": "haxe" + }, + ".jade": { + "image": "pug" + }, + ".pug": { + "image": "pug" + }, + ".jar": { + "image": "jar" + }, + ".java": { + "image": "java" + }, + ".jil": { + "image": "julia" + }, + ".js": { + "image": "js" + }, + ".es6": { + "image": "js" + }, + ".es": { + "image": "js" + }, + ".mjs": { + "image": "js" + }, + ".jsx": { + "image": "jsx" + }, + ".json": { + "image": "json" + }, + ".kt": { + "image": "kotlin" + }, + ".ktm": { + "image": "kotlin" + }, + ".kts": { + "image": "kotlin" + }, + ".lsp": { + "image": "lisp" + }, + ".lisp": { + "image": "lisp" + }, + ".l": { + "image": "lisp" + }, + ".nl": { + "image": "lisp" + }, + ".ny": { + "image": "lisp" + }, + ".podsl": { + "image": "lisp" + }, + ".sexp": { + "image": "lisp" + }, + ".lua": { + "image": "lua" + }, + ".pd_lua": { + "image": "lua" + }, + ".rbxs": { + "image": "lua" + }, + ".wlua": { + "image": "lua" + }, + "/^Makefile/": { + "image": "makefile" + }, + "/^mk\\.config$/": { + "image": "makefile" + }, + "/\\.(mk|mak|make)$/i": { + "image": "makefile" + }, + "/^BSDmakefile$/i": { + "image": "makefile" + }, + "/^GNUmakefile$/i": { + "image": "makefile" + }, + "/^makefile\\.sco$/i": { + "image": "makefile" + }, + "/^Kbuild$/": { + "image": "makefile" + }, + "/^makefile$/": { + "image": "makefile" + }, + "/^mkfile$/i": { + "image": "makefile" + }, + "/^\\.?qmake$/i": { + "image": "makefile" + }, + "/\\.(md|mdown|markdown|mkd|mkdown|mdwn|mkdn|rmd|ron|pmd)$/i": { + "image": "markdown" + }, + "/\\.mm?$/i": { + "image": "objc" + }, + ".pch": { + "image": "objc" + }, + ".x": { + "image": "objc" + }, + ".ml": { + "image": "ocaml" + }, + ".mli": { + "image": "ocaml" + }, + ".eliom": { + "image": "ocaml" + }, + ".eliomi": { + "image": "ocaml" + }, + ".ml4": { + "image": "ocaml" + }, + ".mll": { + "image": "ocaml" + }, + ".mly": { + "image": "ocaml" + }, + "/\\.pas(cal)?$/i": { + "image": "pascal" + }, + ".lpr": { + "image": "pascal" + }, + "/\\.p(er)?l$/i": { + "image": "perl" + }, + ".al": { + "image": "perl" + }, + ".ph": { + "image": "perl" + }, + ".plx": { + "image": "perl" + }, + ".pm": { + "image": "perl" + }, + "/\\.(psgi|xs)$/i": { + "image": "perl" + }, + ".pl6": { + "image": "perl" + }, + "/\\.[tp]6$|\\.6pl$/i": { + "image": "perl" + }, + "/\\.(pm6|p6m)$/i": { + "image": "perl" + }, + ".6pm": { + "image": "perl" + }, + ".nqp": { + "image": "perl" + }, + ".p6l": { + "image": "perl" + }, + ".pod6": { + "image": "perl" + }, + "/^Rexfile$/": { + "image": "perl" + }, + "/\\.php([st\\d]|_cs)?$/i": { + "image": "php" + }, + "/^Phakefile/": { + "image": "php" + }, + ".ps1": { + "image": "powershell" + }, + ".psd1": { + "image": "powershell" + }, + ".psm1": { + "image": "powershell" + }, + ".ps1xml": { + "image": "powershell" + }, + ".py": { + "image": "python" + }, + ".ipy": { + "image": "python" + }, + ".isolate": { + "image": "python" + }, + ".pep": { + "image": "python" + }, + ".gyp": { + "image": "python" + }, + ".gypi": { + "image": "python" + }, + ".pyde": { + "image": "python" + }, + ".pyp": { + "image": "python" + }, + ".pyt": { + "image": "python" + }, + ".py3": { + "image": "python" + }, + ".pyi": { + "image": "python" + }, + ".pyw": { + "image": "python" + }, + ".tac": { + "image": "python" + }, + ".wsgi": { + "image": "python" + }, + ".xpy": { + "image": "python" + }, + ".rpy": { + "image": "python" + }, + "/\\.?(pypirc|pythonrc|python-venv)$/i": { + "image": "python" + }, + "/^(SConstruct|SConscript)$/": { + "image": "python" + }, + "/^(Snakefile|WATCHLISTS)$/": { + "image": "python" + }, + "/^wscript$/": { + "image": "python" + }, + "/\\.(r|Rprofile|rsx|rd)$/i": { + "image": "r" + }, + "/\\.(rb|ru|ruby|erb|gemspec|god|mspec|pluginspec|podspec|rabl|rake|opal)$/i": { + "image": "ruby" + }, + "/^\\.?(irbrc|gemrc|pryrc|ruby-(gemset|version))$/i": { + "image": "ruby" + }, + "/^(Appraisals|(Rake|[bB]uild|Cap|Danger|Deliver|Fast|Guard|Jar|Maven|Pod|Puppet|Snap)file(\\.lock)?)$/": { + "image": "ruby" + }, + "/\\.(jbuilder|rbuild|rb[wx]|builder)$/i": { + "image": "ruby" + }, + "/^rails$/": { + "image": "ruby" + }, + ".watchr": { + "image": "ruby" + }, + ".rs": { + "image": "rust" + }, + "/\\.(sc|scala)$/i": { + "image": "scala" + }, + "/\\.(sh|rc|bats|bash|tool|install|command)$/i": { + "image": "shell" + }, + "/^(\\.?bash(rc|[-_]?(profile|login|logout|history|prompt))|_osc|config|install-sh|PKGBUILD)$/i": { + "image": "shell" + }, + "/\\.(ksh|mksh|pdksh)$/i": { + "image": "shell" + }, + ".sh-session": { + "image": "shell" + }, + "/\\.zsh(-theme|_history)?$|^\\.?(antigen|zpreztorc|zlogin|zlogout|zprofile|zshenv|zshrc)$/i": { + "image": "shell" + }, + "/\\.fish$|^\\.fishrc$/i": { + "image": "shell" + }, + "/^\\.?(login|profile)$/": { + "image": "shell" + }, + ".inputrc": { + "image": "shell" + }, + ".tmux": { + "image": "shell" + }, + "/^(configure|config\\.(guess|rpath|status|sub)|depcomp|libtool|compile)$/": { + "image": "shell" + }, + "/^\\/(private\\/)?etc\\/([^\\/]+\\/)*(profile$|nanorc$|rc\\.|csh\\.)/i": { + "image": "shell" + }, + "/^\\.?cshrc$/i": { + "image": "shell" + }, + ".profile": { + "image": "shell" + }, + ".tcsh": { + "image": "shell" + }, + ".csh": { + "image": "shell" + }, + "/\\.(my)?sql$/i": { + "image": "sql" + }, + ".ddl": { + "image": "sql" + }, + ".udf": { + "image": "sql" + }, + ".hql": { + "image": "sql" + }, + ".viw": { + "image": "sql" + }, + ".prc": { + "image": "sql" + }, + ".cql": { + "image": "sql" + }, + ".db2": { + "image": "sql" + }, + ".svg": { + "image": "svg" + }, + ".swift": { + "image": "swift" + }, + ".tex": { + "image": "tex" + }, + ".ltx": { + "image": "tex" + }, + ".aux": { + "image": "tex" + }, + ".sty": { + "image": "tex" + }, + ".dtx": { + "image": "tex" + }, + ".cls": { + "image": "tex" + }, + ".ins": { + "image": "tex" + }, + ".lbx": { + "image": "tex" + }, + ".mkiv": { + "image": "tex" + }, + ".mkvi": { + "image": "tex" + }, + ".mkii": { + "image": "tex" + }, + ".texi": { + "image": "tex" + }, + "/^hyphen(ex)?\\.(cs|den|det|fr|sv|us)$/": { + "image": "tex" + }, + ".toml": { + "image": "toml" + }, + ".ts": { + "image": "ts" + }, + ".tsx": { + "image": "tsx" + }, + ".twig": { + "image": "twig" + }, + "/\\.te?xt$/i": { + "image": "text" + }, + ".rtf": { + "image": "text" + }, + "/\\.i?nfo$/i": { + "image": "text" + }, + ".msg": { + "image": "text" + }, + "/\\.(utxt|utf8)$/i": { + "image": "text" + }, + ".vb": { + "image": "vb" + }, + ".vbs": { + "image": "vb" + }, + ".vba": { + "image": "vba" + }, + ".vbhtml": { + "image": "vbhtml" + }, + ".vbproj": { + "image": "vbproj" + }, + ".vcxproj": { + "image": "vcxproj" + }, + ".vscodeignore": { + "image": "vscodeignore" + }, + ".vue": { + "image": "vue" + }, + "/\\.ya?ml$/i": { + "image": "yaml" + }, + "/^yarn(\\.lock)?$/i": { + "image": "yarn" + }, + ".yarnrc": { + "image": "yarn" + }, + ".bat": { + "image": "bat" + }, + ".batch": { + "image": "bat" + }, + ".cmd": { + "image": "bat" + }, + "/\\.(exe|com|msi)$/i": { + "image": "bat" + }, + ".reg": { + "image": "bat" + } } } diff --git a/src/extension.ts b/src/extension.ts index 0d087ef..01531dc 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -12,7 +12,10 @@ import { workspace, WorkspaceFolder } from 'vscode'; -const languages = require('./data/languages.json'); +const lang = require('./data/languages.json'); + +const knownExtentions: { [x: string]: {image: string}} = lang.knownExtentions; +const knownLanguages: string[] = lang.knownLanguages; // Define the RPC variable and its type. let rpc: Client; @@ -92,12 +95,6 @@ function initRPC(clientID: string): void { // Set the activity once on ready setTimeout(() => rpc.setActivity(activity), 500); const workspaceElapsedTime = Boolean(config.get('workspaceElapsedTime')); - eventHandlers.add(workspace.onDidChangeTextDocument(() => setActivity(workspaceElapsedTime))) - .add(workspace.onDidOpenTextDocument(() => setActivity(workspaceElapsedTime))) - .add(workspace.onDidCloseTextDocument(() => setActivity(workspaceElapsedTime))) - .add(debug.onDidChangeActiveDebugSession(() => setActivity())) - .add(debug.onDidStartDebugSession(() => setActivity())) - .add(debug.onDidTerminateDebugSession(() => setActivity())); // Make sure to listen to the close event and dispose and destroy everything accordingly. rpc.transport.once('close', async () => { if (!config.get('enabled')) return; @@ -110,7 +107,10 @@ function initRPC(clientID: string): void { }); // Update the user's activity to the `activity` variable. - activityTimer = setInterval(() => rpc.setActivity(activity), 15000); + activityTimer = setInterval(() => { + setActivity(workspaceElapsedTime); + rpc.setActivity(activity); + }, 15000); }); // Log in to the RPC Client, and check whether or not it errors. @@ -157,14 +157,14 @@ function setActivity(workspaceElapsedTime: boolean = false): void { lastKnownFileName = window.activeTextEditor ? window.activeTextEditor.document.fileName : null; const fileName: string = window.activeTextEditor ? basename(window.activeTextEditor.document.fileName) : null; - const largeImageKey = window.activeTextEditor - ? languages[Object.keys(languages).find(key => { + const largeImageKey: any = window.activeTextEditor + ? knownExtentions[Object.keys(knownExtentions).find(key => { if (key.startsWith('.') && fileName.endsWith(key)) return true; const match = key.match(/^\/(.*)\/([mgiy]+)$/); if (!match) return false; const regex = new RegExp(match[1], match[2]); return regex.test(fileName); - })] + })] || (knownLanguages.includes(window.activeTextEditor.document.languageId) ? window.activeTextEditor.document.languageId : null) : 'vscode-big'; // Get the previous activity start timestamp (if available) to preserve workspace elapsed time @@ -177,7 +177,7 @@ function setActivity(workspaceElapsedTime: boolean = false): void { startTimestamp: previousTimestamp && workspaceElapsedTime ? previousTimestamp : new Date().getTime() / 1000, largeImageKey: largeImageKey ? largeImageKey.image - || largeImageKey + || largeImageKey : 'txt', largeImageText: window.activeTextEditor ? config.get('largeImage')