You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I'm planning to create a PR that adds F# support (only syntax highlighting for now, can leave more features for later).
Can you give any hints on where the changes should be done? Would it be possible for the F#-related bits to be implemented in its own assembly (so that the source can be in F# itself, this way it would be easier to get more potential contributions later)?
@knocte My investigation shows that if a few gaps are filled, you don't need a pull request to this main repo, but can safely keep an extension compatible with both VS for Windows and SharpIDE.
#99 shows how T4 support can be added by simply importing the T4 language extension from VS for Windows. I believe that is enough for your initial request.
I plan to do more experiments and see how an existing language server can be imported in a similar way. Currently SharpIDE directly couple with Roslyn, so it doesn't speak LSP yet.
@lextm sorry man but you're a bit exhausting. After posting this issue, you have placed 3 comments here, posted another issue linking to this, and posted 2 comments in other issue. Can you just let the maintainer say something?
@knocte I’ve been following this repo since the initial Reddit announcement and have been watching its progress for quite a while.
So while my comments may look like they arrived in a single batch, the thoughts behind them had actually been forming over time.
I also intentionally left my work as a [WIP] pull request, because as you said, it is ultimately up to the maintainer to decide what to do next. At this point, I’m interested to see what direction he wants to take.
Hi @knocte,
Regarding F# syntax highlighting, completions etc support, unfortunately it does not look as straightforward as adding VB.NET support, as F# does not use roslyn. F# does not participate in the roslyn workspace (AdHocWorkspace).
For VB.NET you would add the equivalents of e.g. Microsoft.CodeAnalysis.CSharp.Workspaces, so Microsoft.CodeAnalysis.VisualBasic.Workspaces. This doesn't exist for FSharp.
It seems like FSharp support would need to co-exist with the roslyn workspace for C#.
FSharp has a nuget package called FSharp.Compiler.Service, which I believe has traditionally been used for relevant functionality.
There is also the Microsoft.FSharp.Compiler, available on the roslyn-compiler nuget feed in SharpIDE (source here)
There also seems to be ongoing work regarding a LanguageServer for FSharp - source, epic
FSharp.VisualStudio.Extension and FSharp.Compiler.LanguageServer use the FSharpWorkspace, which may be the layer we wish to use, if we wish to avoid the overhead of using the LSP?
That being said, I think adding LSP support to SharpIDE is going to be inevitable, e.g. for html, javascript syntax highlighting, completions etc. It may be more pragmatic to implement F# support via its LSP, although I have no idea what that entails regarding a solution, project references etc.
Hi Matt thanks for your answer. I already know the ecosystem quite well (e.g. I know Roslyn doesn't have support of F#, that's why we don't use it in FSharpLint, the proj I'm maintainer of, for example; and indeed we use FCS instead). My question was more aimed at the source code of SharpIDE, where is C# syntax highlighting currently living, where would I start looking? Thanks
Activity
lextm commentedon Mar 28, 2026
@MattParkerDev I think this is another call on extensibility API.
Ideally, you provide the LSP common interface and then any other languages and their LSP implementations can be integrated in a standard way.
lextm commentedon Mar 28, 2026
Related to #18 which is also about F#.
lextm commentedon Mar 29, 2026
@knocte My investigation shows that if a few gaps are filled, you don't need a pull request to this main repo, but can safely keep an extension compatible with both VS for Windows and SharpIDE.
#99 shows how T4 support can be added by simply importing the T4 language extension from VS for Windows. I believe that is enough for your initial request.
I plan to do more experiments and see how an existing language server can be imported in a similar way. Currently SharpIDE directly couple with Roslyn, so it doesn't speak LSP yet.
knocte commentedon Mar 30, 2026
@lextm sorry man but you're a bit exhausting. After posting this issue, you have placed 3 comments here, posted another issue linking to this, and posted 2 comments in other issue. Can you just let the maintainer say something?
lextm commentedon Mar 30, 2026
@knocte I’ve been following this repo since the initial Reddit announcement and have been watching its progress for quite a while.
So while my comments may look like they arrived in a single batch, the thoughts behind them had actually been forming over time.
I also intentionally left my work as a [WIP] pull request, because as you said, it is ultimately up to the maintainer to decide what to do next. At this point, I’m interested to see what direction he wants to take.
MattParkerDev commentedon Mar 30, 2026
Hi @knocte,
Regarding F# syntax highlighting, completions etc support, unfortunately it does not look as straightforward as adding VB.NET support, as F# does not use roslyn. F# does not participate in the roslyn workspace (AdHocWorkspace).
For VB.NET you would add the equivalents of e.g.
Microsoft.CodeAnalysis.CSharp.Workspaces, soMicrosoft.CodeAnalysis.VisualBasic.Workspaces. This doesn't exist for FSharp.It seems like FSharp support would need to co-exist with the roslyn workspace for C#.
FSharp has a nuget package called
FSharp.Compiler.Service, which I believe has traditionally been used for relevant functionality.There is also the
Microsoft.FSharp.Compiler, available on theroslyn-compilernuget feed in SharpIDE (source here)There also seems to be ongoing work regarding a LanguageServer for FSharp - source, epic
FSharp.VisualStudio.Extension and FSharp.Compiler.LanguageServer use the FSharpWorkspace, which may be the layer we wish to use, if we wish to avoid the overhead of using the LSP?
That being said, I think adding LSP support to SharpIDE is going to be inevitable, e.g. for html, javascript syntax highlighting, completions etc. It may be more pragmatic to implement F# support via its LSP, although I have no idea what that entails regarding a solution, project references etc.
knocte commentedon Mar 30, 2026
Hi Matt thanks for your answer. I already know the ecosystem quite well (e.g. I know Roslyn doesn't have support of F#, that's why we don't use it in FSharpLint, the proj I'm maintainer of, for example; and indeed we use FCS instead). My question was more aimed at the source code of SharpIDE, where is C# syntax highlighting currently living, where would I start looking? Thanks
MattParkerDev commentedon Mar 30, 2026
RoslynAnalysis currently contains all of the Roslyn workspace stuff, including retrieving syntax highlighting.
SharpIDE/src/SharpIDE.Application/Features/Analysis/RoslynAnalysis.cs
Line 55 in c09c068
SharpIDE/src/SharpIDE.Application/Features/Analysis/RoslynAnalysis.cs
Line 575 in c09c068
SharpIdeCodeEdit is an editor tab for a file.
SharpIDE/src/SharpIDE.Godot/Features/CodeEditor/SharpIdeCodeEdit.cs
Line 27 in c09c068
It has a
SharpIDE/src/SharpIDE.Godot/Features/CodeEditor/SharpIdeCodeEdit.cs
Line 36 in c09c068
Implemented here:
SharpIDE/src/SharpIDE.Godot/Features/CodeEditor/CustomSyntaxHighlighter.cs
Line 13 in c09c068
CustomHighlighter is the last step.
Hopefully that is helpful, happy to answer any further questions here or on discord :)