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

Commitd55d45b

Browse files
committed
Open source ui stack for FSharp (changeset 1288301)
1 parent00837ae commitd55d45b

File tree

295 files changed

+92106
-11
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

295 files changed

+92106
-11
lines changed

‎changelist.txt‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
Changelist for Visual F# Tools 3.1.2
1212
====================================
1313

14+
- Open source project system, language service, editor, vs_fsi
15+
* #! treated as a comment when it is at the start of an fsharp file
1416
* Fix for #78 - allow space characters in active pattern case identifiers
1517
* Fix Related to #78 - Adjust parser to disallow vertical pipes in active pattern case identifiers.
1618
* Fix for #69 - Invalid code generated when calling C# method with optional nullable args

‎src/update.cmd‎

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,39 @@ set SN64="%X86_PROGRAMFILES%\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools\x6
2828
setNGEN32=%windir%\Microsoft.NET\Framework\v4.0.30319\ngen.exe
2929
setNGEN64=%windir%\Microsoft.NET\Framework64\v4.0.30319\ngen.exe
3030

31-
rem Disable strong-name validation for F# binaries built from open source
31+
rem Disable strong-name validation for F# binaries built from open source that are signed with the microsoft key
3232
%SN32% -Vr FSharp.Core,b03f5f7f11d50a3a
33-
%SN32% -Vr FSharp.Build,f536804aa0eb945b
34-
%SN32% -Vr FSharp.Compiler,f536804aa0eb945b
35-
%SN32% -Vr FSharp.Compiler.Interactive.Settings,f536804aa0eb945b
36-
%SN32% -Vr FSharp.Compiler.Server.Shared,f536804aa0eb945b
33+
%SN32% -Vr FSharp.Build,b03f5f7f11d50a3a
34+
%SN32% -Vr FSharp.Compiler.Interactive.Settings,b03f5f7f11d50a3a
3735
%SN32% -Vr FSharp.Compiler.Hosted,b03f5f7f11d50a3a
3836

37+
%SN32% -Vr FSharp.Compiler,b03f5f7f11d50a3a
38+
%SN32% -Vr FSharp.Compiler.Server.Shared,b03f5f7f11d50a3a
39+
%SN32% -Vr FSharp.Editor,b03f5f7f11d50a3a
40+
%SN32% -Vr FSharp.LanguageService,b03f5f7f11d50a3a
41+
%SN32% -Vr FSharp.LanguageService.Base,b03f5f7f11d50a3a
42+
%SN32% -Vr FSharp.LanguageService.Compiler,b03f5f7f11d50a3a
43+
%SN32% -Vr FSharp.ProjectSystem.Base,b03f5f7f11d50a3a
44+
%SN32% -Vr FSharp.ProjectSystem.FSharp,b03f5f7f11d50a3a
45+
%SN32% -Vr FSharp.ProjectSystem.PropertyPages,b03f5f7f11d50a3a
46+
%SN32% -Vr FSharp.VS.FSI,b03f5f7f11d50a3a
47+
3948
if /i"%PROCESSOR_ARCHITECTURE%"=="AMD64" (
4049
%SN64% -Vr FSharp.Core,b03f5f7f11d50a3a
41-
%SN64% -Vr FSharp.Build,f536804aa0eb945b
42-
%SN64% -Vr FSharp.Compiler,f536804aa0eb945b
43-
%SN64% -Vr FSharp.Compiler.Interactive.Settings,f536804aa0eb945b
44-
%SN64% -Vr FSharp.Compiler.Server.Shared,f536804aa0eb945b
50+
%SN64% -Vr FSharp.Build,b03f5f7f11d50a3a
51+
%SN64% -Vr FSharp.Compiler.Interactive.Settings,b03f5f7f11d50a3a
4552
%SN64% -Vr FSharp.Compiler.Hosted,b03f5f7f11d50a3a
53+
54+
%SN64% -Vr FSharp.Compiler,b03f5f7f11d50a3a
55+
%SN64% -Vr FSharp.Compiler.Server.Shared,b03f5f7f11d50a3a
56+
%SN64% -Vr FSharp.Editor,b03f5f7f11d50a3a
57+
%SN64% -Vr FSharp.LanguageService,b03f5f7f11d50a3a
58+
%SN64% -Vr FSharp.LanguageService.Base,b03f5f7f11d50a3a
59+
%SN64% -Vr FSharp.LanguageService.Compiler,b03f5f7f11d50a3a
60+
%SN64% -Vr FSharp.ProjectSystem.Base,b03f5f7f11d50a3a
61+
%SN64% -Vr FSharp.ProjectSystem.FSharp,b03f5f7f11d50a3a
62+
%SN64% -Vr FSharp.ProjectSystem.PropertyPages,b03f5f7f11d50a3a
63+
%SN64% -Vr FSharp.VS.FSI,b03f5f7f11d50a3a
4664
)
4765

4866
rem Only GACing FSharp.Core for now

‎vsintegration/src/fsharp.tools.targets‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- Copyright (c) Microsoft Open Technologies, Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.-->
33
<ProjectToolsVersion="4.0"DefaultTargets="Build"xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
4-
5-
<ImportProject="..\..\..\fsharp.tools.targets"Condition="Exists('..\..\..\fsharp.tools.targets')" />
4+
5+
<ImportProject="..\..\..\fsharp.tools.targets"Condition="Exists('..\..\..\fsharp.tools.targets') And '$(DevDivBuild)' == 'true'" />
6+
<ImportProject="..\..\src\FSharpSource.Settings.targets"Condition="Exists('..\..\src\FSharpSource.Settings.targets') And '$(DevDivBuild)' != 'true'" />
67

78
<ImportProject="$(MSBuildToolsPath)\Microsoft.CSharp.targets"Condition="'$(DevDivBuild)' == ''" />
89
<ImportProject="$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets"Condition="'$(VSToolsPath)' != ''" />
Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
// Copyright (c) Microsoft Open Technologies, Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
2+
3+
namespaceMicrosoft.VisualStudio.FSharp.Editor
4+
5+
openSystem
6+
openSystem.ComponentModel.Composition
7+
openMicrosoft.VisualStudio
8+
openMicrosoft.VisualStudio.FSharp.LanguageService
9+
openMicrosoft.VisualStudio.FSharp.Shared
10+
openMicrosoft.VisualStudio.Editor
11+
openMicrosoft.VisualStudio.Shell
12+
openMicrosoft.VisualStudio.Shell.Interop
13+
openMicrosoft.VisualStudio.Text
14+
openMicrosoft.VisualStudio.Text.BraceCompletion
15+
openMicrosoft.VisualStudio.Text.Editor
16+
openMicrosoft.VisualStudio.TextManager.Interop
17+
openMicrosoft.VisualStudio.Utilities
18+
19+
/// F# brace completion context implementation
20+
typeinternalCompletionContext(tokenContext: TokenContext,textManager: IVsTextManager)=
21+
interface IBraceCompletionContextwith
22+
memberthis.Start(_)=
23+
()
24+
25+
/// Called when user hits Return while inside of a brace completion session.
26+
memberthis.OnReturn(session)=
27+
28+
letlp=[| LANGPREFERENCES(guidLang= Guid(FSharpCommonConstants.languageServiceGuidString))|]
29+
ErrorHandler.ThrowOnFailure(textManager.GetUserPreferences(null,null, lp,null))|> ignore
30+
31+
// if smart indent is not enabled, or we are in a string, don't do any special formatting
32+
if(lp.[0].IndentStyle<> vsIndentStyle.vsIndentStyleSmart|| session.OpeningBrace='"')then
33+
()
34+
else
35+
// within other braces:
36+
// leave the opening brace where it is
37+
// put the caret one line down, indented once from the previous line
38+
// put the closing brace one line below that, justified with the original line
39+
// let q = query {
40+
// $caret$
41+
// }
42+
43+
letopeningBraceLine= session.OpeningPoint.GetPoint(session.SubjectBuffer.CurrentSnapshot).GetContainingLine()
44+
letexistingIndent= TextHelper.physicalIndentStringOfLine session.TextView openingBraceLine
45+
letcaretPosition= session.TextView.Caret.Position.BufferPosition.Position
46+
letsingleIndent= TextHelper.singleIndentString session.TextView
47+
48+
// we will already have "existing" indentation applied, justifying the caret with the previous line.
49+
// insert an additional indent, a newline, then another buffer matching "existing" indentation
50+
use edit= session.SubjectBuffer.CreateEdit()
51+
if edit.Insert(caretPosition, String.Format("{0}{1}{2}", singleIndent, Environment.NewLine, existingIndent))then
52+
letnewSnapshot= edit.Apply()
53+
54+
// if edit failed to apply, snapshots will be the same
55+
if newSnapshot= edit.Snapshotthen
56+
()
57+
else
58+
session.TextView.Caret.MoveTo(
59+
SnapshotPoint(newSnapshot, caretPosition+ singleIndent.Length).TranslateTo(session.TextView.TextSnapshot, PointTrackingMode.Positive)
60+
)|> ignore
61+
62+
/// Called when user types the (potential) closing brace for a session.
63+
/// Return false if we don't think user is really completing the session. E.g. escaped \" should not close a string session
64+
memberthis.AllowOverType(session)=
65+
letcaretPosition= session.TextView.Caret.Position.BufferPosition.Position
66+
letline= session.TextView.TextSnapshot.GetLineFromPosition(caretPosition)
67+
letlineNum= line.LineNumber
68+
letbraceColumn= caretPosition- line.Start.Position
69+
70+
// test what state we'd be in if the closing brace and a space were typed
71+
lettokenInfo= tokenContext.GetContextAt(session.TextView, lineNum, braceColumn+1,(string session.ClosingBrace+""), braceColumn)
72+
73+
match tokenInfo.Typewith
74+
| TokenType.Comment
75+
| TokenType.Unknown
76+
| TokenType.String->false
77+
|_->true
78+
79+
memberthis.Finish(_)=
80+
()
81+
82+
[<Export(typeof<IBraceCompletionContextProvider>)>]
83+
[<BracePair('"','"')>]
84+
[<BracePair('[',']')>]
85+
[<BracePair('{','}')>]
86+
[<BracePair('(',')')>]
87+
[<ContentType("F#")>]
88+
typeBraceCompletionContextProvider[<ImportingConstructor>](serviceProvider: SVsServiceProvider,adapterService: IVsEditorAdaptersFactoryService)=
89+
90+
lettokenContext= TokenContext(serviceProvider, adapterService)
91+
lettextManager= serviceProvider.GetService(typeof<SVsTextManager>):?> IVsTextManager
92+
93+
interface IBraceCompletionContextProviderwith
94+
95+
/// Called when user types a character matching a supported opening brace
96+
memberthis.TryCreateContext(textView:ITextView,snap:SnapshotPoint,openingBrace:char,_:char,completionContext:byref<IBraceCompletionContext>)=
97+
if textView=nullthen raise(ArgumentException("textView"))else
98+
99+
letline= snap.GetContainingLine()
100+
letlineNum= line.LineNumber
101+
letbraceColumn= snap.Position- line.Start.Position
102+
103+
// check what token context the user is at to decide if we should do brace completion
104+
letinfo= tokenContext.GetContextAt(textView, lineNum, braceColumn,"", braceColumn)
105+
match info.Typewith
106+
| TokenType.String
107+
| TokenType.Comment
108+
| TokenType.Unknown->
109+
// don't initiate brace completion inside of strings, comments, or inactive code
110+
completionContext<-null
111+
false
112+
|_->
113+
// check if we might be in a char literal
114+
letprevChar=
115+
match snap.Position-1with
116+
| pwhen p<0-> None
117+
| p-> Some(snap.Snapshot.[p])
118+
119+
match prevCharwith
120+
| Some('\'')->
121+
// previous character was a ', but could this be a char literal?
122+
// test the token context in the case that we added a closing ' after the brace character
123+
let(insideCharLit,outsideCharLit)=
124+
(tokenContext.GetContextAt(textView, lineNum, braceColumn,(string openingBrace)+"'", braceColumn).Type,
125+
tokenContext.GetContextAt(textView, lineNum, braceColumn+2,(string openingBrace)+"'", braceColumn).Type)
126+
127+
match(insideCharLit, outsideCharLit)with
128+
|(TokenType.String, t)when t<> TokenType.String->
129+
completionContext<-null
130+
false
131+
|_->
132+
completionContext<- CompletionContext(tokenContext, textManager)
133+
true
134+
|_->
135+
completionContext<- CompletionContext(tokenContext, textManager)
136+
true
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- Copyright (c) Microsoft Open Technologies, Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.-->
3+
<ProjectToolsVersion="12.0"DefaultTargets="Build"xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
4+
<PropertyGroup>
5+
<FSharpSourcesRoot>..\..\..\..\..\src</FSharpSourcesRoot>
6+
<vsFrameworkLatest>Microsoft.VisualStudio.Shell.12.0</vsFrameworkLatest>
7+
<vsLanguageServiceLatest>Microsoft.VisualStudio.Package.LanguageService.12.0</vsLanguageServiceLatest>
8+
<ProjectLanguage>FSharp</ProjectLanguage>
9+
<SIGN_WITH_MSFT_KEY>true</SIGN_WITH_MSFT_KEY>
10+
</PropertyGroup>
11+
<ImportProject="$(FSharpSourcesRoot)\FSharpSource.settings.targets" />
12+
<PropertyGroup>
13+
<ConfigurationCondition=" '$(Configuration)' == ''">Debug</Configuration>
14+
<PlatformCondition=" '$(Platform)' == ''">AnyCPU</Platform>
15+
<SchemaVersion>2.0</SchemaVersion>
16+
<ProjectGuid>{65E0E82A-EACE-4787-8994-888674C2FE87}</ProjectGuid>
17+
<OutputType>Library</OutputType>
18+
<AssemblyName>FSharp.Editor</AssemblyName>
19+
<UseVsVersion>true</UseVsVersion>
20+
<TargetType>LIBRARY</TargetType>
21+
<NoWarn>75</NoWarn>
22+
<TailcallsCondition="'$(CodeCoverage)' != ''">false</Tailcalls>
23+
<OtherFlags>$(OtherFlags) --warnon:1182 --subsystemversion:6.00</OtherFlags>
24+
</PropertyGroup>
25+
<ItemGroup>
26+
<CompileInclude="TokenContext.fs" />
27+
<CompileInclude="SmartIndent.fs" />
28+
<CompileInclude="BraceCompletion.fs" />
29+
<ContentInclude="extension.vsixmanifest">
30+
<CopyToOutputDirectory>false</CopyToOutputDirectory>
31+
</Content>
32+
</ItemGroup>
33+
<ItemGroup>
34+
<ProjectReferenceInclude="$(FSharpSourcesRoot)\fsharp\FSharp.Compiler.Service\FSharp.Compiler.Service.fsproj">
35+
<Name>FSharp.Compiler.Service</Name>
36+
<Project>{a437a6ec-5323-47c2-8f86-e2cac54ff152}</Project>
37+
<Private>True</Private>
38+
</ProjectReference>
39+
<ProjectReferenceInclude="$(FSharpSourcesRoot)\fsharp\FSharp.Compiler.Service\FSharp.Compiler.fsproj">
40+
<Name>FSharp.Compiler.Service</Name>
41+
<Project>{a437a6ec-5323-47c2-8f86-e2cac54ff152}</Project>
42+
<Private>True</Private>
43+
</ProjectReference>
44+
<ProjectReferenceInclude="$(FSharpSourcesRoot)\fsharp\FSharp.Core\FSharp.Core.fsproj">
45+
<Project>{DED3BBD7-53F4-428A-8C9F-27968E768605}</Project>
46+
<Name>FSharp.Core</Name>
47+
</ProjectReference>
48+
<ProjectReferenceInclude="..\FSharp.LanguageService\FSharp.LanguageService.fsproj">
49+
<Name>FSharp.LanguageService</Name>
50+
<Project>{ee85aab7-cda0-4c4e-bda0-a64ccc413e3f}</Project>
51+
<Private>True</Private>
52+
</ProjectReference>
53+
<ProjectReferenceInclude="..\FSharp.LanguageService\FSharp.LanguageService.Base\FSharp.LanguageService.Base.csproj">
54+
<Name>FSharp.LanguageService.Base</Name>
55+
<Project>{1c5c163c-37ea-4a3c-8ccc-0d34b74bf8ef}</Project>
56+
<Private>True</Private>
57+
</ProjectReference>
58+
<ProjectReferenceInclude="$(FSharpSourcesRoot)\fsharp\FSharp.LanguageService.Compiler\FSharp.LanguageService.Compiler.fsproj">
59+
<Project>{a437a6ec-5323-47c2-8f86-e2cac54ff152}</Project>
60+
<Name>FSharp.LanguageService.Compiler</Name>
61+
<Private>True</Private>
62+
</ProjectReference>
63+
</ItemGroup>
64+
<ItemGroup>
65+
<ReferenceInclude="mscorlib" />
66+
<ReferenceInclude="System" />
67+
<ReferenceInclude="System.ComponentModel.Composition" />
68+
<ReferenceInclude="Microsoft.VisualStudio.Editor" />
69+
<ReferenceInclude="Microsoft.VisualStudio.Text.UI" />
70+
<ReferenceInclude="Microsoft.VisualStudio.Text.UI.Wpf" />
71+
<ReferenceInclude="Microsoft.VisualStudio.Text.Data" />
72+
<ReferenceInclude="Microsoft.VisualStudio.Text.Logic" />
73+
<ReferenceInclude="Microsoft.VisualStudio.CoreUtility" />
74+
<ReferenceInclude="Microsoft.VisualStudio.OLE.Interop" />
75+
<ReferenceInclude="Microsoft.VisualStudio.Shell" />
76+
<ReferenceInclude="Microsoft.VisualStudio.Shell.Interop" />
77+
<ReferenceInclude="Microsoft.VisualStudio.Shell.Immutable.10.0" />
78+
<ReferenceInclude="Microsoft.VisualStudio.TextManager.Interop" />
79+
</ItemGroup>
80+
<ImportProject="$(FSharpSourcesRoot)\FSharpSource.targets" />
81+
</Project>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp