Skip to content

Commit 607c3e6

Browse files
committed
Updated fsstrings
1 parent d15ae18 commit 607c3e6

File tree

3 files changed

+27
-25
lines changed

3 files changed

+27
-25
lines changed

fcs/fcs-fable/fsstrings.fs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -774,19 +774,19 @@ let resources =
774774
"This expression is a function value, i.e. is missing arguments. Its type is {0}."
775775
);
776776
( "UnitTypeExpected",
777-
"The result of this expression is implicitly ignored. Consider using 'ignore' to discard this value explicitly, e.g. 'expr |> ignore', or 'let' to bind the result to a name, e.g. 'let result = expr'."
777+
"The result of this expression has type '{0}' and is implicitly ignored. Consider using 'ignore' to discard this value explicitly, e.g. 'expr |> ignore', or 'let' to bind the result to a name, e.g. 'let result = expr'."
778778
);
779779
( "UnitTypeExpectedWithEquality",
780-
"The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'."
780+
"The result of this equality expression has type '{0}' and is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'."
781781
);
782782
( "UnitTypeExpectedWithPossiblePropertySetter",
783-
"The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to set a value to a property, then use the '<-' operator e.g. '{0}.{1} <- expression'."
783+
"The result of this equality expression has type '{0}' and is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to set a value to a property, then use the '<-' operator e.g. '{1}.{2} <- expression'."
784784
);
785785
( "UnitTypeExpectedWithPossibleAssignment",
786-
"The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to mutate a value, then mark the value 'mutable' and use the '<-' operator e.g. '{0} <- expression'."
786+
"The result of this equality expression has type '{0}' and is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to mutate a value, then mark the value 'mutable' and use the '<-' operator e.g. '{1} <- expression'."
787787
);
788788
( "UnitTypeExpectedWithPossibleAssignmentToMutable",
789-
"The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to mutate a value, then use the '<-' operator e.g. '{0} <- expression'."
789+
"The result of this equality expression has type '{0}' and is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to mutate a value, then use the '<-' operator e.g. '{1} <- expression'."
790790
);
791791
( "RecursiveUseCheckedAtRuntime",
792792
"This recursive use will be checked for initialization-soundness at runtime. This warning is usually harmless, and may be suppressed by using '#nowarn \"21\"' or '--nowarn:21'."

fcs/fcs-fable/test/app.fs

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,15 @@ let writeAllText (filePath:string) (text:string) = File.WriteAllText (filePath,
3434
let main argv =
3535
printfn "Parsing begins..."
3636

37-
let checker = InteractiveChecker.Create(references, readAllBytes)
37+
let defines = [||]
38+
let checker = InteractiveChecker.Create(references, readAllBytes, defines)
3839

40+
let projectFileName = "project"
3941
let fileName = "test_script.fsx"
4042
let source = readAllText fileName
4143

42-
// let parseResults = checker.ParseScript(fileName,source)
43-
let parseResults, typeCheckResults, projectResults = checker.ParseAndCheckScript(fileName, source)
44+
//let parseResults, typeCheckResults, projectResults = checker.ParseAndCheckProject(projectFileName, [|fileName|], [|source|])
45+
let parseResults, typeCheckResults, projectResults = checker.ParseAndCheckScript(projectFileName, fileName, source)
4446

4547
printfn "parseResults.ParseHadErrors: %A" parseResults.ParseHadErrors
4648
printfn "parseResults.Errors: %A" parseResults.Errors
@@ -72,19 +74,19 @@ let main argv =
7274
let inputLines = source.Split('\n')
7375

7476
async {
75-
// Get tool tip at the specified location
76-
let! tip = typeCheckResults.GetToolTipText(4, 7, inputLines.[3], ["foo"], FSharpTokenTag.IDENT)
77-
(sprintf "%A" tip).Replace("\n","") |> printfn "\n---> ToolTip Text = %A" // should be "FSharpToolTipText [...]"
78-
79-
// Get declarations (autocomplete) for msg
80-
let partialName = { QualifyingIdents = []; PartialIdent = "msg"; EndColumn = 17; LastDotPos = None }
81-
let! decls = typeCheckResults.GetDeclarationListInfo(Some parseResults, 6, inputLines.[5], partialName, (fun _ -> []), fun _ -> false)
82-
[ for item in decls.Items -> item.Name ] |> printfn "\n---> msg AutoComplete = %A" // should be string methods
83-
84-
// Get declarations (autocomplete) for canvas
85-
let partialName = { QualifyingIdents = []; PartialIdent = "canvas"; EndColumn = 10; LastDotPos = None }
86-
let! decls = typeCheckResults.GetDeclarationListInfo(Some parseResults, 8, inputLines.[7], partialName, (fun _ -> []), fun _ -> false)
87-
[ for item in decls.Items -> item.Name ] |> printfn "\n---> canvas AutoComplete = %A"
77+
// Get tool tip at the specified location
78+
let! tip = typeCheckResults.GetToolTipText(4, 7, inputLines.[3], ["foo"], FSharpTokenTag.IDENT)
79+
(sprintf "%A" tip).Replace("\n","") |> printfn "\n---> ToolTip Text = %A" // should be "FSharpToolTipText [...]"
80+
81+
// Get declarations (autocomplete) for msg
82+
let partialName = { QualifyingIdents = []; PartialIdent = "msg"; EndColumn = 17; LastDotPos = None }
83+
let! decls = typeCheckResults.GetDeclarationListInfo(Some parseResults, 6, inputLines.[5], partialName, (fun _ -> []), fun _ -> false)
84+
[ for item in decls.Items -> item.Name ] |> printfn "\n---> msg AutoComplete = %A" // should be string methods
85+
86+
// Get declarations (autocomplete) for canvas
87+
let partialName = { QualifyingIdents = []; PartialIdent = "canvas"; EndColumn = 10; LastDotPos = None }
88+
let! decls = typeCheckResults.GetDeclarationListInfo(Some parseResults, 8, inputLines.[7], partialName, (fun _ -> []), fun _ -> false)
89+
[ for item in decls.Items -> item.Name ] |> printfn "\n---> canvas AutoComplete = %A"
8890
} |> Async.StartImmediate
8991

9092
0

fcs/fcs-fable/test/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
"start": "node out/app"
1414
},
1515
"devDependencies": {
16-
"babel-core": "^6.26.3",
16+
"@babel/core": "^7.1.2",
1717
"babel-preset-env": "^1.7.0",
18-
"fable-splitter": "2.0.0-beta-002",
19-
"rollup": "^0.66.2",
20-
"rollup-plugin-fable": "2.0.0-beta-001"
18+
"fable-splitter": "^2.0.2",
19+
"rollup": "^0.66.6",
20+
"rollup-plugin-fable": "^2.0.0"
2121
}
2222
}

0 commit comments

Comments
 (0)