Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit351d06b

Browse files
authored
Remove dependency on FSharp.LanguageService (#4108)
* Move ProjectSitesAndFiles to FSharp.Editor* Remove commented out code* Fix build that wasn't reported when running build.cmd* Remove weird stuff and add the VSLang proj reference like it is in FSharp.LanguageService* Remove dependency on FSharp.LanguageService* remove commented out reference
1 parent9333b06 commit351d06b

File tree

8 files changed

+468
-23
lines changed

8 files changed

+468
-23
lines changed

‎vsintegration/src/FSharp.Editor/Common/RoslynHelpers.fs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ open Microsoft.FSharp.Compiler
1414
openMicrosoft.FSharp.Compiler.Layout
1515
openMicrosoft.FSharp.Compiler.SourceCodeServices
1616
openMicrosoft.FSharp.Compiler.Range
17-
openMicrosoft.VisualStudio.FSharp.LanguageService
1817

1918
[<RequireQualifiedAccess>]
2019
moduleinternalRoslynHelpers=

‎vsintegration/src/FSharp.Editor/Common/Vs.fs‎

Lines changed: 69 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,84 @@
33
namespaceMicrosoft.VisualStudio.FSharp.Editor
44

55
openSystem
6+
openSystem.Runtime.InteropServices
67
openMicrosoft.VisualStudio
8+
openMicrosoft.VisualStudio.Editor
79
openMicrosoft.VisualStudio.Shell.Interop
810
openMicrosoft.VisualStudio.TextManager.Interop
911

1012
/// Helper methods for interoperating with COM
11-
moduleinternalCom=
13+
moduleinternalCom=
14+
letThrowOnFailure0(hr)=
15+
ErrorHandler.ThrowOnFailure(hr)|> ignore
16+
17+
letThrowOnFailure1(hr,res)=
18+
ErrorHandler.ThrowOnFailure(hr)|> ignore;
19+
res
20+
21+
letThrowOnFailure2(hr,res1,res2)=
22+
ErrorHandler.ThrowOnFailure(hr)|> ignore;
23+
res1,res2
24+
25+
letThrowOnFailure3(hr,res1,res2,res3)=
26+
ErrorHandler.ThrowOnFailure(hr)|> ignore;
27+
res1,res2,res3
28+
29+
letThrowOnFailure4(hr,res1,res2,res3,res4)=
30+
ErrorHandler.ThrowOnFailure(hr)|> ignore;
31+
res1,res2,res3,res4
32+
1233
letSucceeded hr=
1334
// REVIEW: Not the correct check for succeeded
1435
hr= VSConstants.S_OK
1536

37+
moduleinternalVsUserData=
38+
39+
letvsBufferMoniker= Guid("978A8E17-4DF8-432A-9623-D530A26452BC")
40+
41+
// This is the file name of the buffer.
42+
letGetBufferMonker(ud:IVsUserData):string=
43+
downcast Com.ThrowOnFailure1(ud.GetData(ref vsBufferMoniker))
44+
45+
moduleinternalVsTextLines=
46+
/// Get the length of the given line.
47+
letLengthOfLine(buffer:IVsTextBuffer)(line:int):int=
48+
Com.ThrowOnFailure1(buffer.GetLengthOfLine(line))
49+
50+
/// Get the text for a particular line.
51+
letLineText(buffer:IVsTextLines)line=
52+
Com.ThrowOnFailure1(buffer.GetLineText(line,0, line, LengthOfLine buffer line))
53+
54+
/// Get the color state
55+
letTextColorState(buffer:IVsTextLines):IVsTextColorState= unbox(box(buffer))
56+
57+
/// Get the filename of the given buffer (via IVsUserData). Not all buffers have a file. This will be an exception.
58+
letGetFilename(buffer:IVsTextLines)=
59+
letud=(box buffer):?> IVsUserData
60+
VsUserData.GetBufferMonker(ud)
61+
62+
/// Get the string contents of a given buffer (the current snapshot).
63+
letGetFileContents(buffer:IVsTextBuffer,editorAdaptersFactoryService:IVsEditorAdaptersFactoryService)=
64+
letdataBuffer= editorAdaptersFactoryService.GetDataBuffer(buffer)
65+
dataBuffer.CurrentSnapshot.GetText()
66+
67+
moduleinternalVsRunningDocumentTable=
68+
letFindDocumentWithoutLocking(rdt:IVsRunningDocumentTable,url:string):(IVsHierarchy* IVsTextLines)option=
69+
let(hr:int,hier:IVsHierarchy,_itemid:uint32,unkData:IntPtr,_cookie:uint32)= rdt.FindAndLockDocument(uint32_VSRDTFLAGS.RDT_NoLock, url)
70+
try
71+
if Com.Succeeded(hr)then
72+
letbufferObject=
73+
if unkData=IntPtr.Zerothennull
74+
else Marshal.GetObjectForIUnknown(unkData)
75+
letbuffer=
76+
match bufferObjectwith
77+
|:? IVsTextLinesas tl-> tl
78+
|_->null
79+
Some(hier, buffer)
80+
else None
81+
finally
82+
if IntPtr.Zero<> unkDatathen Marshal.Release(unkData)|>ignore
83+
1684
[<AutoOpen>]
1785
moduleinternalServiceProviderExtensions=
1886
typeinternalSystem.IServiceProviderwith

‎vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj‎

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@
3232
<InternalsVisibleToInclude="FSharp.ProjectSystem.FSharp" />
3333
<InternalsVisibleToInclude="VisualFSharp.UnitTests" />
3434
<InternalsVisibleToInclude="VisualFSharp.Salsa" />
35-
</ItemGroup>
36-
<ItemGroup>
3735
<EmbeddedResourceInclude="FSharp.Editor.resx">
3836
<GenerateSource>true</GenerateSource>
3937
<GeneratedModuleName>Microsoft.VisualStudio.FSharp.Editor.SR</GeneratedModuleName>
@@ -42,18 +40,20 @@
4240
<CompileInclude="Common\Pervasive.fs" />
4341
<CompileInclude="Common\Extensions.fs" />
4442
<CompileInclude="Common\Constants.fs" />
43+
<CompileInclude="Common\Error.fs" />
4544
<CompileInclude="Common\Logging.fs" />
4645
<CompileInclude="Common\RoslynHelpers.fs" />
4746
<CompileInclude="Common\CodeAnalysisExtensions.fs" />
4847
<CompileInclude="Common\ContentType.fs" />
49-
<CompileInclude="Common\Error.fs" />
5048
<CompileInclude="Common\Vs.fs" />
5149
<CompileInclude="Options\SettingsPersistence.fs" />
5250
<CompileInclude="Options\UIHelpers.fs" />
5351
<CompileInclude="Options\EditorOptions.fs" />
5452
<CompileInclude="LanguageService\Tokenizer.fs" />
5553
<CompileInclude="LanguageService\Symbols.fs" />
5654
<CompileInclude="LanguageService\FSharpCheckerExtensions.fs" />
55+
<CompileInclude="LanguageService\IProjectSite.fs" />
56+
<CompileInclude="LanguageService\ProjectSitesAndFiles.fs" />
5757
<CompileInclude="LanguageService\LanguageService.fs" />
5858
<CompileInclude="LanguageService\AssemblyContentProvider.fs" />
5959
<CompileInclude="LanguageService\SymbolHelpers.fs" />
@@ -107,11 +107,6 @@
107107
<Project>{DED3BBD7-53F4-428A-8C9F-27968E768605}</Project>
108108
<Name>FSharp.Core</Name>
109109
</ProjectReference>
110-
<ProjectReferenceInclude="$(FSharpSourcesRoot)\..\vsintegration\src\FSharp.LanguageService\FSharp.LanguageService.fsproj">
111-
<Name>FSharp.LanguageService</Name>
112-
<Project>{ee85aab7-cda0-4c4e-bda0-a64ccc413e3f}</Project>
113-
<Private>True</Private>
114-
</ProjectReference>
115110
<ProjectReferenceInclude="$(FSharpSourcesRoot)\..\vsintegration\src\FSharp.LanguageService.Base\FSharp.LanguageService.Base.csproj">
116111
<Name>FSharp.LanguageService.Base</Name>
117112
<Project>{1c5c163c-37ea-4a3c-8ccc-0d34b74bf8ef}</Project>
@@ -132,8 +127,6 @@
132127
<Project>{991dcf75-c2eb-42b6-9a0d-aa1d2409d519}</Project>
133128
<Private>True</Private>
134129
</ProjectReference>
135-
</ItemGroup>
136-
<ItemGroup>
137130
<ReferenceInclude="mscorlib" />
138131
<ReferenceInclude="PresentationFramework" />
139132
<ReferenceInclude="System.Windows.Forms" />
@@ -146,8 +139,6 @@
146139
<ReferenceInclude="System" />
147140
<ReferenceInclude="PresentationCore" />
148141
<ReferenceInclude="System.ComponentModel.Composition" />
149-
</ItemGroup>
150-
<ItemGroup>
151142
<ReferenceInclude="EnvDTE">
152143
<HintPath>$(FSharpSourcesRoot)\..\packages\EnvDTE.8.0.1\lib\net10\EnvDTE.dll</HintPath>
153144
<Private>True</Private>
@@ -156,6 +147,10 @@
156147
<HintPath>$(FSharpSourcesRoot)\..\packages\EnvDTE80.8.0.1\lib\net10\EnvDTE80.dll</HintPath>
157148
<Private>True</Private>
158149
</Reference>
150+
<ReferenceInclude="VSLangProj">
151+
<HintPath>$(FSharpSourcesRoot)\..\packages\VSSDK.VSLangProj.7.0.4\lib\net20\VSLangProj.dll</HintPath>
152+
<Private>True</Private>
153+
</Reference>
159154
<ReferenceInclude="Microsoft.VisualStudio.Threading">
160155
<HintPath>$(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Threading.$(MicrosoftVisualStudioThreadingVersion)\lib\net45\Microsoft.VisualStudio.Threading.dll</HintPath>
161156
</Reference>
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information.
2+
3+
namespaceMicrosoft.VisualStudio.FSharp.Editor
4+
5+
openSystem.Runtime.InteropServices
6+
7+
/// Narrow abstraction over the project system.
8+
typeinternalAdviseProjectSiteChanges=delegateofunit->unit
9+
10+
[<ComImport; InterfaceType(ComInterfaceType.InterfaceIsIUnknown); Guid("ad98f020-bad0-0000-0000-abc037459871")>]
11+
typeinternalIProvideProjectSite=
12+
abstractGetProjectSite :unit->IProjectSite
13+
14+
/// Represents known F#-specific information about a project.
15+
andinternalIProjectSite=
16+
17+
/// List of files in the project. In the correct order.
18+
abstractCompilationSourceFiles :string[]
19+
20+
/// Flags that the compiler would need to understand how to compile. Includes '-r'
21+
/// options but not source files
22+
abstractCompilationOptions :string[]
23+
24+
/// The normalized '-r:' assembly references, without the '-r:'
25+
abstractCompilationReferences :string[]
26+
27+
/// The '-o:' output bin path, without the '-o:'
28+
abstractCompilationBinOutputPath :stringoption
29+
30+
/// The name of the project file.
31+
abstractProjectFileName :string
32+
33+
/// Register for notifications for when the above change
34+
abstractAdviseProjectSiteChanges : callbackOwnerKey:string*AdviseProjectSiteChanges->unit
35+
36+
/// Register for notifications when project is cleaned/rebuilt (and thus any live TypeProviders should be refreshed)
37+
abstractAdviseProjectSiteCleaned : callbackOwnerKey:string*AdviseProjectSiteChanges->unit
38+
39+
// Register for notifications when project is closed.
40+
abstractAdviseProjectSiteClosed : callbackOwnerKey:string*AdviseProjectSiteChanges->unit
41+
42+
/// A user-friendly description of the project. Used only for developer/DEBUG tooltips and such.
43+
abstractDescription :string
44+
45+
/// The error list task reporter
46+
abstractBuildErrorReporter :Microsoft.VisualStudio.Shell.Interop.IVsLanguageServiceBuildErrorReporter2optionwith get, set
47+
48+
/// False type resolution errors are invalid. This occurs with orphaned source files. The prior
49+
/// type checking state is unknown. In this case we don't want to squiggle the type checking files.
50+
abstractIsIncompleteTypeCheckEnvironment :bool
51+
52+
/// target framework moniker
53+
abstractTargetFrameworkMoniker :string
54+
55+
/// Project Guid
56+
abstractProjectGuid :string
57+
58+
/// timestamp the site was last loaded
59+
abstractLoadTime :System.DateTime
60+
61+
abstractProjectProvider :IProvideProjectSiteoption

‎vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ open Microsoft.FSharp.Compiler.CompileOps
2323
openMicrosoft.FSharp.Compiler.SourceCodeServices
2424
openMicrosoft.VisualStudio
2525
openMicrosoft.VisualStudio.Editor
26-
openMicrosoft.VisualStudio.FSharp.LanguageService
27-
openMicrosoft.VisualStudio.FSharp.LanguageService.SiteProvider
26+
openMicrosoft.VisualStudio.FSharp.Editor.SiteProvider
2827
openMicrosoft.VisualStudio.TextManager.Interop
2928
openMicrosoft.VisualStudio.LanguageServices
3029
openMicrosoft.VisualStudio.LanguageServices.Implementation.LanguageService

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp