If the language required is known they can be accessed by using the type properties below.
let language = CodeLanguage.swiftIf the language needs to be discovered by the file extension this can be done by calling detectLanguageFrom(url:).
let fileURL = URL(fileURLWithPath: "/path/to/file.swift")
let language = CodeLanguage.detectLanguageFrom(url: fileURL)Important: In case the language is not supported yet, the resulting
CodeLanguagewill bedefault(plain text).
- Agda
- Bash
- C
- C++
- C#
- CSS
- Dart
- Dockerfile
- EJS
- Elixir
- ERB
- Go
- Go Mod
- Haskell
- HTML
- Java
- JavaScript
- JSON
- JSX
- Julia
- Kotlin
- Lua
- Markdown
- Objective C
- OCaml / OCaml Interface
- Perl
- PHP
- Python
- Ruby
- Rust
- Scala
- SQL
- Swift
- TOML
- Verilog
- YAML
- Zig
- doc:Add-Languages
idtsNameextensionsparentQueryURLtsNamequeryURLlanguageadditionalHighlights
allLanguagesdefaultagdabashccppcSharpcssdartdockerfileejselixirerbgogoModhaskellhtmljavajavascriptjsdocjsonjsxjuliakotlinluamarkdownmarkdownInlineobjcocamlocamlInterfaceperlphppythonregexrubyrustscalasqlswifttomltsxtypescriptverilogyamlzig
detectLanguageFrom(url:)