diff --git a/CodeApp/Managers/LanguageService.swift b/CodeApp/Managers/LanguageService.swift index 9df46f5d..5dd0c8df 100644 --- a/CodeApp/Managers/LanguageService.swift +++ b/CodeApp/Managers/LanguageService.swift @@ -26,6 +26,11 @@ class LanguageService { languageIdentifier: "java", extensions: ["java"], args: ["java", "-jar", "${JAVA_LSP_FAT_JAR_PATH}"]), + Configuration( + languageIdentifier: "fsharp", + extensions: ["fs", "fsi", "fsx", "fsproj"], + args: ["dotnet", "fsautocomplete"] // Uses fsautocomplete, the F# LSP server + ), ] static func configurationFor(url: URL) -> Configuration? { diff --git a/CodeApp/Views/NewFileView.swift b/CodeApp/Views/NewFileView.swift index ad2ec30b..24af2512 100644 --- a/CodeApp/Views/NewFileView.swift +++ b/CodeApp/Views/NewFileView.swift @@ -108,6 +108,13 @@ struct NewFileView: View { import Swift print("Hello, World!") """ + case 100: + name = "default.fsx" + content = """ + // Created on \(UIDevice.current.name). + + printfn "Hello, World!" + """ case -2: name = "index.html" content = """ @@ -182,6 +189,7 @@ struct NewFileView: View { .init(code: 4, name: "PHP"), .init(code: 62, name: "Java"), .init(code: 83, name: "Swift"), + .init(code: 100, name: "F#"), .init(code: -2, name: "HTML"), .init(code: -3, name: "CSS"), ] diff --git a/README.md b/README.md index 9f6d3044..07ee0190 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ Use [VS Code](https://github.com/microsoft/vscode) as a design template while pr - C/C++ Runtime with WebAssembly (with clang) ✅ - Local Java (OpenJDK) ✅ - SSH Support ✅ -- [LSP](https://microsoft.github.io/language-server-protocol) support (Python & Java) ✅ +- [LSP](https://microsoft.github.io/language-server-protocol) support (Python, Java & F#) ✅ ## Building the project @@ -41,3 +41,4 @@ The source code of the built-in languages are hosted on these repositories. | PHP 8.3.2 | [php-src](https://github.com/bummoblizard/php-src/tree/PHP-8.3.2)| | Node.js 18.19.0 | [nodejs-mobile](https://github.com/1Conan/nodejs-mobile)| | OpenJDK 8 | [android-openjdk-build-multiarch](https://github.com/thebaselab/android-openjdk-build-multiarch)| +| F# (.NET SDK) | [dotnet/fsharp](https://github.com/dotnet/fsharp) |