[FEATURE]:FSharp LSP #3542

Open
opened 2026-02-16 17:40:35 -05:00 by yindo · 11 comments
Owner

Originally created by @Thorium on GitHub (Dec 14, 2025).

Originally assigned to: @nalin-singh on GitHub.

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

I see that "fsharp" language files are defined in the Opencode configs *.fs, *.fsx and *.fsi but the F# LSP is not installed by default.

LSP for F# is very simple to setup:

  1. dotnet tool install fsautocomplete -g
  2. Add the following section to the opencode.json:
  "lsp": {
    "fsharp": {
      "command": ["fsautocomplete"],
      "extensions": [".fs", ".fsx", ".fsi"]
    }
  }

...and it works! It would be nice to have this enabled by default in the installation.

Image
Originally created by @Thorium on GitHub (Dec 14, 2025). Originally assigned to: @nalin-singh on GitHub. ### Feature hasn't been suggested before. - [x] I have verified this feature I'm about to request hasn't been suggested before. ### Describe the enhancement you want to request I see that "fsharp" language files are defined in the Opencode configs `*.fs`, `*.fsx` and `*.fsi` but the F# LSP is not installed by default. LSP for F# is very simple to setup: 1. `dotnet tool install fsautocomplete -g` 2. Add the following section to the opencode.json: ``` "lsp": { "fsharp": { "command": ["fsautocomplete"], "extensions": [".fs", ".fsx", ".fsi"] } } ``` ...and it works! It would be nice to have this enabled by default in the installation. <img width="530" height="333" alt="Image" src="https://github.com/user-attachments/assets/2bd9f671-2aa8-4afd-8f64-6419447029d5" />
yindo added the help-wanteddiscussiongood first issue labels 2026-02-16 17:40:35 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Dec 14, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #1808: C# language server (csharp-ls) doesn't work - This is a similar language support request within the .NET ecosystem. Understanding how C# LSP support is being addressed may provide insights for F# LSP implementation.

Additionally, you may want to reference other language LSP support requests:

  • #3116: Kotlin LSP support - A similar feature request for adding LSP support for another language

Feel free to ignore if your specific case differs from these.

@github-actions[bot] commented on GitHub (Dec 14, 2025): This issue might be a duplicate of existing issues. Please check: - #1808: C# language server (csharp-ls) doesn't work - This is a similar language support request within the .NET ecosystem. Understanding how C# LSP support is being addressed may provide insights for F# LSP implementation. Additionally, you may want to reference other language LSP support requests: - #3116: Kotlin LSP support - A similar feature request for adding LSP support for another language Feel free to ignore if your specific case differs from these.
Author
Owner

@nalin-singh commented on GitHub (Dec 15, 2025):

working on this

@nalin-singh commented on GitHub (Dec 15, 2025): working on this
Author
Owner

@nalin-singh commented on GitHub (Dec 15, 2025):

did start to work, have to do some additional testing

Image
@nalin-singh commented on GitHub (Dec 15, 2025): did start to work, have to do some additional testing <img width="327" height="271" alt="Image" src="https://github.com/user-attachments/assets/e5250a9f-b609-41c2-86d0-4d7e8e248013" />
Author
Owner

@nalin-singh commented on GitHub (Dec 15, 2025):

do we also want to add a tree-sitter parser ? [WARN] 'TSWorker:': no parser found for injection language: fsharp

@nalin-singh commented on GitHub (Dec 15, 2025): do we also want to add a tree-sitter parser ? `[WARN] 'TSWorker:': no parser found for injection language: fsharp`
Author
Owner

@Thorium commented on GitHub (Dec 15, 2025):

I think here is the scm: https://raw.githubusercontent.com/ionide/tree-sitter-fsharp/refs/heads/main/queries/highlights.scm

@Thorium commented on GitHub (Dec 15, 2025): I think here is the scm: `https://raw.githubusercontent.com/ionide/tree-sitter-fsharp/refs/heads/main/queries/highlights.scm`
Author
Owner

@nalin-singh commented on GitHub (Dec 15, 2025):

requires a wasm file as well, can't find that

Image
@nalin-singh commented on GitHub (Dec 15, 2025): requires a wasm file as well, can't find that <img width="1014" height="258" alt="Image" src="https://github.com/user-attachments/assets/723c33e3-41fd-4d12-b577-2ab33cb64045" />
Author
Owner

@Thorium commented on GitHub (Dec 15, 2025):

PR created to put the binaries to repo, but not merged yet. Would bring the wasm to the repo https://github.com/Thorium/tree-sitter-fsharp/raw/8ec2ff6f7c0ce3da6ef9a4e5b73a6b48d90fb3d4/wasm/tree-sitter-fsharp.wasm

@Thorium commented on GitHub (Dec 15, 2025): PR created to put the binaries to repo, but not merged yet. Would bring the wasm to the repo https://github.com/Thorium/tree-sitter-fsharp/raw/8ec2ff6f7c0ce3da6ef9a4e5b73a6b48d90fb3d4/wasm/tree-sitter-fsharp.wasm
Author
Owner

@Thorium commented on GitHub (Dec 15, 2025):

Should we have added the wasm before closing this?

@Thorium commented on GitHub (Dec 15, 2025): Should we have added the wasm before closing this?
Author
Owner

@rekram1-node commented on GitHub (Dec 15, 2025):

it got auto closed by the merging of pr but yeah prolly good idea there

@rekram1-node commented on GitHub (Dec 15, 2025): it got auto closed by the merging of pr but yeah prolly good idea there
Author
Owner

@rekram1-node commented on GitHub (Dec 15, 2025):

that's for the syntax highlighting tho

@rekram1-node commented on GitHub (Dec 15, 2025): that's for the syntax highlighting tho
Author
Owner

@Thorium commented on GitHub (Dec 19, 2025):

I'm also looking how to support fantomas as formatter:

https://github.com/sst/opencode/blob/dev/packages/opencode/src/format/formatter.ts

export const fantomas: Info = {
  name: "fantomas",
  command: ["dotnet", "fantomas", "$FILE"],
  extensions: [".fs", ".fsx", ".fsi"],
  async enabled() {
    return Bun.which("dotnet") !== null
  },
}

...but having bun which dotnet is enough to check the availability, it should also somehow check that fantomas is listed in the list when you run dotnet tool list fantomas

@Thorium commented on GitHub (Dec 19, 2025): I'm also looking how to support `fantomas` as [formatter](https://opencode.ai/docs/formatters/): https://github.com/sst/opencode/blob/dev/packages/opencode/src/format/formatter.ts ``` export const fantomas: Info = { name: "fantomas", command: ["dotnet", "fantomas", "$FILE"], extensions: [".fs", ".fsx", ".fsi"], async enabled() { return Bun.which("dotnet") !== null }, } ``` ...but having bun which `dotnet` is enough to check the availability, it should also somehow check that fantomas is listed in the list when you run `dotnet tool list fantomas`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#3542