Skip to content

Commit 2a01126

Browse files
author
Omar Tawfik
committed
Move ProvideLanguageExtension and ProvideEditorExtension back to service
1 parent e161cf3 commit 2a01126

File tree

4 files changed

+17
-6
lines changed

4 files changed

+17
-6
lines changed

vsintegration/src/FSharp.Editor/CommonConstants.fs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@ module internal FSharpCommonConstants =
1212
[<Literal>]
1313
let languageServiceGuidString = "BC6DD5A5-D4D6-4dab-A00D-A51242DBAF1B"
1414
[<Literal>]
15+
let editorFactoryGuidString = "4EB7CCB7-4336-4FFD-B12B-396E9FD079A9"
16+
[<Literal>]
1517
let svsSettingsPersistenceManagerGuidString = "9B164E40-C3A2-4363-9BC5-EB4039DEF653"
1618
[<Literal>]
1719
let FSharpLanguageName = "F#"
1820
[<Literal>]
1921
let FSharpContentTypeName = "F#"
2022
[<Literal>]
21-
let FSharpLanguageServiceCallbackName = "F# Language Service"
23+
let FSharpLanguageServiceCallbackName = "F# Language Service"

vsintegration/src/FSharp.Editor/LanguageService.fs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ open Microsoft.VisualStudio.FSharp.LanguageService
3030
type internal SVsSettingsPersistenceManager = class end
3131

3232
[<Guid(FSharpCommonConstants.languageServiceGuidString)>]
33+
[<ProvideLanguageExtension(typeof<FSharpLanguageService>, ".fs")>]
34+
[<ProvideLanguageExtension(typeof<FSharpLanguageService>, ".fsi")>]
35+
[<ProvideLanguageExtension(typeof<FSharpLanguageService>, ".fsx")>]
36+
[<ProvideLanguageExtension(typeof<FSharpLanguageService>, ".fsscript")>]
37+
[<ProvideLanguageExtension(typeof<FSharpLanguageService>, ".ml")>]
38+
[<ProvideLanguageExtension(typeof<FSharpLanguageService>, ".mli")>]
3339
type internal FSharpLanguageService(package : FSharpPackage) =
3440
inherit AbstractLanguageService<FSharpPackage, FSharpLanguageService>(package)
3541

@@ -98,6 +104,12 @@ type internal FSharpLanguageService(package : FSharpPackage) =
98104
| _ -> ()
99105

100106
and [<Guid(FSharpCommonConstants.packageGuidString)>]
107+
[<ProvideEditorExtension(FSharpCommonConstants.editorFactoryGuidString, ".fs", 97)>]
108+
[<ProvideEditorExtension(FSharpCommonConstants.editorFactoryGuidString, ".fsi", 97)>]
109+
[<ProvideEditorExtension(FSharpCommonConstants.editorFactoryGuidString, ".fsx", 97)>]
110+
[<ProvideEditorExtension(FSharpCommonConstants.editorFactoryGuidString, ".fsscript", 97)>]
111+
[<ProvideEditorExtension(FSharpCommonConstants.editorFactoryGuidString, ".ml", 97)>]
112+
[<ProvideEditorExtension(FSharpCommonConstants.editorFactoryGuidString, ".mli", 97)>]
101113
internal FSharpPackage() =
102114
inherit AbstractPackage<FSharpPackage, FSharpLanguageService>()
103115

vsintegration/src/FSharp.ProjectSystem.FSharp/Project.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1595,7 +1595,7 @@ namespace rec Microsoft.VisualStudio.FSharp.ProjectSystem
15951595
// in the registry hive so that more editors can be added without changing this part of the
15961596
// code. FSharp only makes usage of one Editor Factory and therefore we will return
15971597
// that guid
1598-
guidEditorType <- GuidList.guidEditorFactory
1598+
guidEditorType <- new Guid(FSharpCommonConstants.editorFactoryGuidString)
15991599
VSConstants.S_OK
16001600

16011601
interface IVsProjectSpecificEditorMap2 with
@@ -1609,7 +1609,7 @@ namespace rec Microsoft.VisualStudio.FSharp.ProjectSystem
16091609
// in the registry hive so that more editors can be added without changing this part of the
16101610
// code. FSharp only makes usage of one Editor Factory and therefore we will return
16111611
// that guid
1612-
guidEditorType <- GuidList.guidEditorFactory
1612+
guidEditorType <- new Guid(FSharpCommonConstants.editorFactoryGuidString)
16131613
VSConstants.S_OK
16141614

16151615
member x.GetSpecificLanguageService(_mkDocument:string, guidLanguageService:byref<Guid> ) =

vsintegration/src/FSharp.ProjectSystem.FSharp/ProjectPrelude.fs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,9 +267,6 @@ namespace Microsoft.VisualStudio.FSharp.ProjectSystem
267267
// Some more constants
268268

269269
module internal GuidList =
270-
let guidEditorFactory = new Guid("{4EB7CCB7-4336-4FFD-B12B-396E9FD079A9}")
271-
[<Literal>]
272-
let guidEditorFactoryString = "4EB7CCB7-4336-4FFD-B12B-396E9FD079A9"
273270
[<Literal>]
274271
let guidFSharpProjectPkgString = "91A04A73-4F2C-4E7C-AD38-C1A68E7DA05C"
275272
[<Literal>]

0 commit comments

Comments
 (0)