Skip to content

Commit

Permalink
fix: Add more language IDs to DocumentSelector
Browse files Browse the repository at this point in the history
VS Code uses "csharp" as the language ID of C#, while other LSP client
might use other IDs (e.g., "cs"). Add them all to the DocumentSelector.

Signed-off-by: Adam Tao <[email protected]>
  • Loading branch information
tcx4c70 committed Jul 24, 2023
1 parent 2d207cb commit fa0c6e2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Handlers/DocumentSelectorUtil.fs
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
namespace CSharpLanguageServer.Handlers

open System.Runtime.CompilerServices
open Ionide.LanguageServerProtocol.Types

[<AutoOpen>]
module DocumentSelectorUtil =
type DocumentFilter with
static member Default: DocumentFilter =
{ Language = Some "cs"
static member Create(language: string) : DocumentFilter =
{ Language = Some language
Scheme = Some "file"
Pattern = Some "**/*.cs" }

// Type abbreviations cannot have augmentations, extensions
let defaultDocumentSelector: DocumentSelector = [| DocumentFilter.Default |]
let defaultDocumentSelector: DocumentSelector =
[| DocumentFilter.Create "csharp"; DocumentFilter.Create "cs" |]

0 comments on commit fa0c6e2

Please sign in to comment.