Skip to content

Commit 9b8bb77

Browse files
committed
Merge pull request #433 from rojepp/integration_20151010
Integrate with fsharp/fsharp
2 parents 35d4270 + 596e5e1 commit 9b8bb77

Some content is hidden

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

68 files changed

+361
-624
lines changed

.gitignore

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -94,21 +94,13 @@ ossreadme*.txt
9494
*.XML
9595
src/assemblyinfo/assemblyinfo.shared.fs
9696
*.csproj.user
97-
tests/fsharp/typecheck/sigs/*.diff
98-
tests/fsharp/typecheck/sigs/*.err
99-
tests/fsharp/typecheck/sigs/*.vsdiff
100-
tests/fsharp/typecheck/sigs/*.vserr
10197
src/fsharp/FSharp.LanguageService.Compiler/illex.*
10298
src/fsharp/FSharp.LanguageService.Compiler/ilpars.*
10399
src/fsharp/FSharp.LanguageService.Compiler/lex.*
104100
src/fsharp/FSharp.LanguageService.Compiler/pars.*
105-
tests/fsharp/typecheck/sigs/*.dll
106-
tests/fsharp/typecheck/sigs/*.exe
107101
vsintegration/src/unittests/Unittests.fsi
108102
tests/fsharpqa/Source/CodeGen/EmittedIL/StaticInit/StaticInit_Module01.dll
109103
tests/fsharpqa/Source/CodeGen/EmittedIL/StaticInit/StaticInit_Module01.pdb
110-
tests/fsharp/typeProviders/helloWorld/bincompat1/
111-
tests/fsharp/typeProviders/helloWorld/bincompat2/
112104
tests/XFSharpQA_Failures.log.*
113105
vsintegration/src/vs/FsPkgs/FSharp.Project/FS/FSharp.ProjectSystem.FSharp.fsi
114106
vsintegration/src/vs/FsPkgs/FSharp.Project/FS/ctofiles/
@@ -118,6 +110,8 @@ packages
118110
FSharp.Compiler.Tools.Nuget/*.nupkg
119111
FSharp.Core.Nuget/*.nupkg
120112
*.csproj.user
113+
*.sln.DotSettings.user
114+
121115
*.ide
122116
*.log
123117
*.jrs
@@ -126,5 +120,7 @@ FSharp.Core.Nuget/*.nupkg
126120
FSharp.Compiler.Tools.Nuget/*.nupkg
127121
FSharp.Core.Nuget/*.nupkg
128122
*.orig
123+
*.mdf
124+
*.ldf
129125
.paket/paket.exe
130126
paket-files

src/absil/ildiag.fsi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
/// Diagnostics from the AbsIL toolkit. You can reset the diagnostics
44
/// stream to point elsewhere, or turn it
5-
/// off altogether by setting it to 'None'. The logging channel initally
5+
/// off altogether by setting it to 'None'. The logging channel initially
66
/// points to stderr. All functions call flush() automatically.
77
///
88
/// REVIEW: review if we should just switch to System.Diagnostics

src/absil/illib.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -796,7 +796,7 @@ type LazyWithContext<'T,'ctxt> =
796796
match x.funcOrException with
797797
| null -> x.value
798798
| _ ->
799-
// Enter the lock in case another thread is in the process of evaluting the result
799+
// Enter the lock in case another thread is in the process of evaluating the result
800800
System.Threading.Monitor.Enter(x);
801801
try
802802
x.UnsynchronizedForce(ctxt)

src/absil/ilread.fs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,6 @@ type MemoryMappedFile(hMap: MemoryMapping.HANDLE, start:nativeint) =
217217

218218

219219
#endif
220-
221220
//---------------------------------------------------------------------
222221
// Read file from memory blocks
223222
//---------------------------------------------------------------------

src/absil/ilread.fsi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ type ILReaderOptions =
4141
val mkDefault : ILGlobals -> ILReaderOptions
4242

4343
// The non-memory resources (i.e. the file handle) associated with
44-
// the read can be recovered by calling CloseILModuleReader. Any reamining
44+
// the read can be recovered by calling CloseILModuleReader. Any remaining
4545
// lazily-computed items in the metadata graph returned by MetadataOfILModuleReader
4646
// will no longer be valid.
4747
[<Sealed>]

src/absil/ilreflect.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,11 +347,11 @@ let convTypeRefAux (cenv:cenv) (tref:ILTypeRef) =
347347
| None ->
348348
let asmName = convAssemblyRef asmref
349349
FileSystem.AssemblyLoad(asmName)
350-
let typT = assembly.GetType(qualifiedName)
350+
let typT = assembly.GetType(qualifiedName, throwOnError=true)
351351
typT |> nonNull "convTypeRefAux"
352352
| ILScopeRef.Module _
353353
| ILScopeRef.Local _ ->
354-
let typT = Type.GetType(qualifiedName,true)
354+
let typT = Type.GetType(qualifiedName, throwOnError=true)
355355
typT |> nonNull "convTypeRefAux"
356356

357357

src/absil/ilsupp.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1020,7 +1020,7 @@ type PdbDocumentWriter = { symDocWriter : ISymUnmanagedDocumentWriter } (* poin
10201020
type idd =
10211021
{ iddCharacteristics: int32;
10221022
iddMajorVersion: int32; (* actually u16 in IMAGE_DEBUG_DIRECTORY *)
1023-
iddMinorVersion: int32; (* acutally u16 in IMAGE_DEBUG_DIRECTORY *)
1023+
iddMinorVersion: int32; (* actually u16 in IMAGE_DEBUG_DIRECTORY *)
10241024
iddType: int32;
10251025
iddData: byte[];}
10261026

src/absil/ilsupp.fsi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ type PdbDocumentWriter
8989
type idd =
9090
{ iddCharacteristics: int32;
9191
iddMajorVersion: int32; (* actually u16 in IMAGE_DEBUG_DIRECTORY *)
92-
iddMinorVersion: int32; (* acutally u16 in IMAGE_DEBUG_DIRECTORY *)
92+
iddMinorVersion: int32; (* actually u16 in IMAGE_DEBUG_DIRECTORY *)
9393
iddType: int32;
9494
iddData: byte[];}
9595

src/absil/ilx.fsi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ type IlxClosureApps =
8989
| Apps_app of ILType * IlxClosureApps
9090
| Apps_done of ILType
9191

92-
/// ILX extensions to the intruction set
92+
/// ILX extensions to the instruction set
9393
///
9494
9595
type IlxInstr =

src/fsharp/CheckFormatStrings.fs

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ let newInfo ()=
4848
addZeros = false
4949
precision = false}
5050

51-
let ParseFormatString (m: Range.range) g (source: string option) fmt bty cty dty =
51+
let parseFormatStringInternal (m:Range.range) g (source: string option) fmt bty cty =
5252
// Offset is used to adjust ranges depending on whether input string is regular, verbatim or triple-quote.
5353
// We construct a new 'fmt' string since the current 'fmt' string doesn't distinguish between "\n" and escaped "\\n".
5454
let (offset, fmt) =
@@ -83,10 +83,7 @@ let ParseFormatString (m: Range.range) g (source: string option) fmt bty cty dty
8383
acc |> List.map snd |> List.rev
8484
else
8585
failwithf "%s" <| FSComp.SR.forPositionalSpecifiersNotPermitted()
86-
87-
let aty = List.foldBack (-->) argtys dty
88-
let ety = mkTupledTy g argtys
89-
aty,ety
86+
argtys
9087
elif System.Char.IsSurrogatePair(fmt,i) then
9188
parseLoop acc (i+2, relLine, relCol+2)
9289
else
@@ -292,3 +289,18 @@ let ParseFormatString (m: Range.range) g (source: string option) fmt bty cty dty
292289

293290
let results = parseLoop [] (0, 0, m.StartColumn)
294291
results, Seq.toList specifierLocations
292+
293+
let ParseFormatString m g source fmt bty cty dty =
294+
let argtys,ranges = parseFormatStringInternal m g source fmt bty cty
295+
let aty = List.foldBack (-->) argtys dty
296+
let ety = mkTupledTy g argtys
297+
(aty, ety),ranges
298+
299+
let TryCountFormatStringArguments m g source fmt bty cty =
300+
try
301+
parseFormatStringInternal m g source fmt bty cty
302+
|> fst
303+
|> List.length
304+
|> Some
305+
with _ ->
306+
None

0 commit comments

Comments
 (0)