Skip to content
This repository was archived by the owner on Dec 23, 2024. It is now read-only.

Commit 2f2130f

Browse files
authored
merge master into vs-rtm2017 (dotnet#3728)
* Generate source for .resx files on build. (dotnet#3607) * add build task to generate *.fs from *.resx files * generate source for embedded resources in tests * generate source for embedded resources in FSharp.Editor * generate source for embedded resources in FSharp.LanguageService * generate source for embedded resources in FSharp.ProjectSystem.FSharp * generate source for embedded resources in FSharp.VS.FSI * don't generate non-string resources when <=netstandard1.6 * update baseline error message for tests The error output should be the exception message, not the exception type. * perform up-to-date check before generating *.fs from *.resx * remove non-idiomatic fold for an array comprehension * correct newline replacement * output more friendly error message * throw if boolean value isn't explicitly `true` or `false` * only generate object resource code on non `netstandard1.*` and `netcoreapp1.*` platforms * ensure FSharp.Core specifies a target framework for resource generaton * rename attributes to be non-ambiguous and properly include them * fix order of file items in FSharp.Core * Fix build.cmd for certain always-shown errors (like "unable to find registry key"), improve finding of VS2017 tools, fix DEVGUIDE.md (dotnet#3635) * Fix build.com displaying the following error on each run "ERROR: The system was unable to find the specified registry key or value." * Remove warning about reg.exe errors introduced in dotnet#3614 (in commit b548bd7, but unrelated to that fix), it is no longer necessary. * Fix dotnet#3638, VS2017 Preview installation was not found when VS2017RTM is not installed. Remove comment introduced in dotnet#3614 (through commit 966bd7f) * Fixing JaroWinkler tests with InvariantCulture and fixing async tests by removing Debugger.Break() (dotnet#3627) * Fixing JaroWinkler tests to use InvariantCulture for number-to-string * Fixing the crashing of test runners because of a Debugger.Break() in a test * update to System.Collections.Immutable 1.3.1 (dotnet#3641) * update to System.Collections.Immutable 1.3.1 * fixes * fix assembly reference * [WIP] Adds optimized emit for int64 constants (dotnet#3620) * Adds optimized emit for int64 constants. * Adds comment linking to the changing PR. Thanks for this PR. Kevin * fix assembly reference (dotnet#3646) * Remove a few more build warnings (dotnet#3647) * fix assembly reference * remove more build warnings * fix build * move BuildFromSource projects to their own directory * Adds tests for emitted IL for new Int64 constants. (dotnet#3650) * Enable FS as prefix and ignore invalid values for warnings (dotnet#3631) * enable fs as prefix and ignore invalid values for warnings + tests * Allow #pragma to validate warnings * do it right * use ordinal compare * In both places * Add fs prefix to warnaserror * Fixup tests * Fix stack overflow on assembly resolution (dotnet#3658) * Fix stack overflow on tp assembly resolution * Feedback * Add impl files to file check results (dotnet#3659) * add LanguageServiceProfiling project to internals visible to list of FSharp.Compiler.Private project * add ImplementationFiles to FSharpCheckFileResults * make FSharpImplementationFileContents ctor internal * throw if ImplementationFiles is called having keepAssemblyContents flag set to false * add a test * spelling and cosmetics * This adds backup, restore, coloration and many more checks to the update-vsintegration.cmd (dotnet#3672) * This adds backup, restore, coloration and many more checks to the update-vsintegration.cmd * This adds backup, restore, coloration and many more checks to the update-vsintegration.cmd * Remove ambiguous an irrelevant instruction, improved help and instructions * Fix a scenario where the return code wasn't nonzero for error conditions, fixes not creating backup dir when not backing up * add LanguageServiceProfiling project to internals visible to list of FSharp.Compiler.Private project (dotnet#3657) * bump FCS version (dotnet#3676) * bump version * Update RELEASE_NOTES.md * Parsing improvements: no reactor, add parsing options, error severity options (dotnet#3601) * Parse without reactor, add parsing options, error severity options * Revert parsing APIs (fallback to the new ones), fix VFT projects * Cache parse results after type check * Add impl files to file check results (dotnet#3659) * add LanguageServiceProfiling project to internals visible to list of FSharp.Compiler.Private project * add ImplementationFiles to FSharpCheckFileResults * make FSharpImplementationFileContents ctor internal * throw if ImplementationFiles is called having keepAssemblyContents flag set to false * add a test * spelling and cosmetics * This adds backup, restore, coloration and many more checks to the update-vsintegration.cmd (dotnet#3672) * This adds backup, restore, coloration and many more checks to the update-vsintegration.cmd * This adds backup, restore, coloration and many more checks to the update-vsintegration.cmd * Remove ambiguous an irrelevant instruction, improved help and instructions * Fix a scenario where the return code wasn't nonzero for error conditions, fixes not creating backup dir when not backing up * add LanguageServiceProfiling project to internals visible to list of FSharp.Compiler.Private project (dotnet#3657) * bump FCS version (dotnet#3676) * bump version * Update RELEASE_NOTES.md * updates to make tests pass * restore old behaviour of CheckFileInProjectAllowingStaleCachedResults (builder had been created by ParseFileInProject) * restore use of CheckFileInProjectAllowingStaleCachedResults * deprecate test relying on whacky behaviour of deprecated GetCheckResultsBeforeFileInProjectEvenIfStale * Use ParseFile and FSharpParsingOptions instead of ParseFileInProject * prepare FCS release with this feature * whitespace cleanup (dotnet#3682) * whitespace and docs (dotnet#3684) * Preserve XML docs for in-memory project references (dotnet#3683) * fix xmldocs for in-memory project references * add test * fix tests * whitespace and comments (dotnet#3686) * fix assembly reference * whitespace and comments * whitespace and comments * whitespace and comments * cherry pick two PRs from FCS (dotnet#3687) * fix assembly reference * remove line endings from all *.nuspec files * ProjectCracker returns *.fsi files in FSharpProjectOptions.SourceFiles array (in addition to *.fs files, in right order) * ProjectCracker raises exception if ProjectCrackerTool returns non null ProjectCrackerOptions.Error (new field) * fix build on linux * fix a test * slashes * revert slashes * Update FSharp.Compiler.Service.ProjectCracker.nuspec * try to fix travis * try to fix travis * list dependencies * no obsolete pdb in nuget * list dependencies * cherry pick of fsharp/fsharp change * bump FCS version number (dotnet#3688) * Update FSharp.Compiler.Service.MSBuild.v12.nuspec * fix FCS nuget on windows * fix-resource (dotnet#3690) * Bump FSharp.Compiler.Tools to 4.1.27 and align mono build files (dotnet#3693) * ri change from fsharp * fix test * bump FSC tools to 4.1.27 * remove fsharp.core from Mono GAC * align mono directory * fix typo * install back versions with Mono * fix typo * update FCS doc generation (dotnet#3694) * update DEVGUIDE to add addiitional steps before running build (dotnet#3725) * Split templates out into a seperate vsix (dotnet#3720) * merge error * Merge issues
1 parent 8d559c1 commit 2f2130f

36 files changed

+196
-235
lines changed

Classification/ClassificationDefinitions.fs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ module internal ClassificationDefinitions =
140140
type internal FSharpFunctionTypeFormat() as self =
141141
inherit ClassificationFormatDefinition()
142142

143-
do self.DisplayName <- SR.FSharpFunctionsOrMethodsClassificationType.Value
143+
do self.DisplayName <- SR.FSharpFunctionsOrMethodsClassificationType()
144144

145145
[<Export(typeof<EditorFormatDefinition>)>]
146146
[<ClassificationType(ClassificationTypeNames = FSharpClassificationTypes.MutableVar)>]
@@ -150,7 +150,7 @@ module internal ClassificationDefinitions =
150150
type internal FSharpMutableVarTypeFormat [<ImportingConstructor>](theme: ThemeColors) as self =
151151
inherit ClassificationFormatDefinition()
152152

153-
do self.DisplayName <- SR.FSharpMutableVarsClassificationType.Value
153+
do self.DisplayName <- SR.FSharpMutableVarsClassificationType()
154154
self.ForegroundColor <- theme.GetColor FSharpClassificationTypes.MutableVar
155155

156156
[<Export(typeof<EditorFormatDefinition>)>]
@@ -161,7 +161,7 @@ module internal ClassificationDefinitions =
161161
type internal FSharpPrintfTypeFormat [<ImportingConstructor>](theme: ThemeColors) as self =
162162
inherit ClassificationFormatDefinition()
163163

164-
do self.DisplayName <- SR.FSharpPrintfFormatClassificationType.Value
164+
do self.DisplayName <- SR.FSharpPrintfFormatClassificationType()
165165
self.ForegroundColor <- theme.GetColor FSharpClassificationTypes.Printf
166166

167167
[<Export(typeof<EditorFormatDefinition>)>]
@@ -172,7 +172,7 @@ module internal ClassificationDefinitions =
172172
type internal FSharpPropertyFormat() as self =
173173
inherit ClassificationFormatDefinition()
174174

175-
do self.DisplayName <- SR.FSharpPropertiesClassificationType.Value
175+
do self.DisplayName <- SR.FSharpPropertiesClassificationType()
176176

177177
[<Export(typeof<EditorFormatDefinition>)>]
178178
[<ClassificationType(ClassificationTypeNames = FSharpClassificationTypes.Disposable)>]
@@ -182,5 +182,5 @@ module internal ClassificationDefinitions =
182182
type internal FSharpDisposableFormat [<ImportingConstructor>](theme: ThemeColors) as self =
183183
inherit ClassificationFormatDefinition()
184184

185-
do self.DisplayName <- SR.FSharpDisposablesClassificationType.Value
185+
do self.DisplayName <- SR.FSharpDisposablesClassificationType()
186186
self.ForegroundColor <- theme.GetColor FSharpClassificationTypes.Disposable

Classification/ColorizationService.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ type internal FSharpColorizationService
4040
asyncMaybe {
4141
do Trace.TraceInformation("{0:n3} (start) SemanticColorization", DateTime.Now.TimeOfDay.TotalSeconds)
4242
do! Async.Sleep DefaultTuning.SemanticColorizationInitialDelay |> liftAsync // be less intrusive, give other work priority most of the time
43-
let! options = projectInfoManager.TryGetOptionsForDocumentOrProject(document)
43+
let! _parsingOptions, projectOptions = projectInfoManager.TryGetOptionsForDocumentOrProject(document)
4444
let! sourceText = document.GetTextAsync(cancellationToken)
45-
let! _, _, checkResults = checkerProvider.Checker.ParseAndCheckDocument(document, options, sourceText = sourceText, allowStaleResults = false, userOpName=userOpName)
45+
let! _, _, checkResults = checkerProvider.Checker.ParseAndCheckDocument(document, projectOptions, sourceText = sourceText, allowStaleResults = false, userOpName=userOpName)
4646
// it's crucial to not return duplicated or overlapping `ClassifiedSpan`s because Find Usages service crashes.
4747
let targetRange = RoslynHelpers.TextSpanToFSharpRange(document.FilePath, textSpan, sourceText)
4848
let colorizationData = checkResults.GetSemanticClassification (Some targetRange) |> Array.distinctBy fst

CodeFix/AddNewKeywordToDisposableConstructorInvocation.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ type internal FSharpAddNewKeywordCodeFixProvider() =
1919

2020
override this.RegisterCodeFixesAsync context : Task =
2121
async {
22-
let title = SR.AddNewKeyword.Value
22+
let title = SR.AddNewKeyword()
2323
context.RegisterCodeFix(
2424
CodeAction.Create(
2525
title,

CodeFix/AddOpenCodeFixProvider.fs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,12 @@ type internal FSharpAddOpenCodeFixProvider
9696
override __.RegisterCodeFixesAsync context : Task =
9797
asyncMaybe {
9898
let document = context.Document
99-
let! options = projectInfoManager.TryGetOptionsForEditingDocumentOrProject document
99+
let! parsingOptions, projectOptions = projectInfoManager.TryGetOptionsForEditingDocumentOrProject document
100100
let! sourceText = context.Document.GetTextAsync(context.CancellationToken)
101-
let! _, parsedInput, checkResults = checker.ParseAndCheckDocument(document, options, allowStaleResults = true, sourceText = sourceText, userOpName = userOpName)
101+
let! _, parsedInput, checkResults = checker.ParseAndCheckDocument(document, projectOptions, allowStaleResults = true, sourceText = sourceText, userOpName = userOpName)
102102
let line = sourceText.Lines.GetLineFromPosition(context.Span.End)
103103
let linePos = sourceText.Lines.GetLinePosition(context.Span.End)
104-
let defines = CompilerEnvironment.GetCompilationDefinesForEditing(document.Name, options.OtherOptions |> Seq.toList)
104+
let defines = CompilerEnvironment.GetCompilationDefinesForEditing(document.Name, parsingOptions)
105105

106106
let! symbol =
107107
asyncMaybe {

CodeFix/ImplementInterfaceCodeFixProvider.fs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,21 +130,21 @@ type internal FSharpImplementInterfaceCodeFixProvider
130130
title)
131131
context.RegisterCodeFix(codeAction, diagnostics)
132132

133-
registerCodeFix SR.ImplementInterface.Value true
134-
registerCodeFix SR.ImplementInterfaceWithoutTypeAnnotation.Value false
133+
registerCodeFix (SR.ImplementInterface()) true
134+
registerCodeFix (SR.ImplementInterfaceWithoutTypeAnnotation()) false
135135
else
136136
()
137137

138138
override __.FixableDiagnosticIds = Seq.toImmutableArray fixableDiagnosticIds
139139

140140
override __.RegisterCodeFixesAsync context : Task =
141141
asyncMaybe {
142-
let! options = projectInfoManager.TryGetOptionsForEditingDocumentOrProject context.Document
142+
let! parsingOptions, projectOptions = projectInfoManager.TryGetOptionsForEditingDocumentOrProject context.Document
143143
let cancellationToken = context.CancellationToken
144144
let! sourceText = context.Document.GetTextAsync(cancellationToken)
145-
let! _, parsedInput, checkFileResults = checker.ParseAndCheckDocument(context.Document, options, sourceText = sourceText, allowStaleResults = true, userOpName = userOpName)
145+
let! _, parsedInput, checkFileResults = checker.ParseAndCheckDocument(context.Document, projectOptions, sourceText = sourceText, allowStaleResults = true, userOpName = userOpName)
146146
let textLine = sourceText.Lines.GetLineFromPosition context.Span.Start
147-
let defines = CompilerEnvironment.GetCompilationDefinesForEditing(context.Document.FilePath, options.OtherOptions |> Seq.toList)
147+
let defines = CompilerEnvironment.GetCompilationDefinesForEditing(context.Document.FilePath, parsingOptions)
148148
// Notice that context.Span doesn't return reliable ranges to find tokens at exact positions.
149149
// That's why we tokenize the line and try to find the last successive identifier token
150150
let tokens = Tokenizer.tokenizeLine(context.Document.Id, sourceText, context.Span.Start, context.Document.FilePath, defines)

CodeFix/MissingReferenceCodeFixProvider.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ type internal MissingReferenceCodeFixProvider() =
7171
| Some refProject ->
7272
let codefix =
7373
createCodeFix(
74-
String.Format(SR.AddProjectReference.Value, refProject.Name),
74+
String.Format(SR.AddProjectReference(), refProject.Name),
7575
context,
7676
AddProjectRef (ProjectReference refProject.Id)
7777
)
@@ -90,7 +90,7 @@ type internal MissingReferenceCodeFixProvider() =
9090
| Some metadataRef ->
9191
let codefix =
9292
createCodeFix(
93-
String.Format(SR.AddAssemblyReference.Value, assemblyName),
93+
String.Format(SR.AddAssemblyReference(), assemblyName),
9494
context,
9595
AddMetadataRef metadataRef
9696
)

CodeFix/RemoveUnusedOpens.fs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ type internal FSharpRemoveUnusedOpensCodeFixProvider
3232
let document = context.Document
3333
let! sourceText = document.GetTextAsync()
3434
let checker = checkerProvider.Checker
35-
let! options = projectInfoManager.TryGetOptionsForEditingDocumentOrProject(document)
36-
let! unusedOpens = UnusedOpensDiagnosticAnalyzer.GetUnusedOpenRanges(document, options, checker)
35+
let! _parsingOptions, projectOptions = projectInfoManager.TryGetOptionsForEditingDocumentOrProject(document)
36+
let! unusedOpens = UnusedOpensDiagnosticAnalyzer.GetUnusedOpenRanges(document, projectOptions, checker)
3737
let changes =
3838
unusedOpens
3939
|> List.map (fun m ->
@@ -52,7 +52,7 @@ type internal FSharpRemoveUnusedOpensCodeFixProvider
5252
override __.RegisterCodeFixesAsync context : Task =
5353
async {
5454
let diagnostics = context.Diagnostics |> Seq.filter (fun x -> fixableDiagnosticIds |> List.contains x.Id) |> Seq.toImmutableArray
55-
context.RegisterCodeFix(createCodeFix(SR.RemoveUnusedOpens.Value, context), diagnostics)
55+
context.RegisterCodeFix(createCodeFix(SR.RemoveUnusedOpens(), context), diagnostics)
5656
} |> RoslynHelpers.StartAsyncUnitAsTask(context.CancellationToken)
5757

5858
override __.GetFixAllProvider() = WellKnownFixAllProviders.BatchFixer

CodeFix/RenameUnusedValue.fs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,23 +54,23 @@ type internal FSharpRenameUnusedValueCodeFixProvider
5454
// We have to use the additional check for backtickes because `IsOperatorOrBacktickedName` operates on display names
5555
// where backtickes are replaced with parens.
5656
if not (PrettyNaming.IsOperatorOrBacktickedName ident) && not (ident.StartsWith "``") then
57-
let! options = projectInfoManager.TryGetOptionsForEditingDocumentOrProject document
58-
let! _, _, checkResults = checker.ParseAndCheckDocument(document, options, allowStaleResults = true, sourceText = sourceText, userOpName=userOpName)
57+
let! parsingOptions, projectOptions = projectInfoManager.TryGetOptionsForEditingDocumentOrProject document
58+
let! _, _, checkResults = checker.ParseAndCheckDocument(document, projectOptions, allowStaleResults = true, sourceText = sourceText, userOpName=userOpName)
5959
let m = RoslynHelpers.TextSpanToFSharpRange(document.FilePath, context.Span, sourceText)
60-
let defines = CompilerEnvironment.GetCompilationDefinesForEditing (document.FilePath, options.OtherOptions |> Seq.toList)
60+
let defines = CompilerEnvironment.GetCompilationDefinesForEditing (document.FilePath, parsingOptions)
6161
let! lexerSymbol = Tokenizer.getSymbolAtPosition (document.Id, sourceText, context.Span.Start, document.FilePath, defines, SymbolLookupKind.Greedy, false)
6262
let lineText = (sourceText.Lines.GetLineFromPosition context.Span.Start).ToString()
6363
let! symbolUse = checkResults.GetSymbolUseAtLocation(m.StartLine, m.EndColumn, lineText, lexerSymbol.FullIsland, userOpName=userOpName)
6464
let symbolName = symbolUse.Symbol.DisplayName
6565

6666
match symbolUse.Symbol with
6767
| :? FSharpMemberOrFunctionOrValue as func ->
68-
createCodeFix(context, symbolName, SR.PrefixValueNameWithUnderscore.Value, TextChange(TextSpan(context.Span.Start, 0), "_"))
68+
createCodeFix(context, symbolName, SR.PrefixValueNameWithUnderscore(), TextChange(TextSpan(context.Span.Start, 0), "_"))
6969

7070
if func.IsMemberThisValue then
71-
createCodeFix(context, symbolName, SR.RenameValueToDoubleUnderscore.Value, TextChange(context.Span, "__"))
71+
createCodeFix(context, symbolName, SR.RenameValueToDoubleUnderscore(), TextChange(context.Span, "__"))
7272
elif not func.IsMember then
73-
createCodeFix(context, symbolName, SR.RenameValueToUnderscore.Value, TextChange(context.Span, "_"))
73+
createCodeFix(context, symbolName, SR.RenameValueToUnderscore(), TextChange(context.Span, "_"))
7474
| _ -> ()
7575
}
7676
|> Async.Ignore

CodeFix/SimplifyName.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ type internal FSharpSimplifyNameCodeFixProvider() =
2424
for diagnostic in context.Diagnostics |> Seq.filter (fun x -> x.Id = fixableDiagnosticId) do
2525
let title =
2626
match diagnostic.Properties.TryGetValue(SimplifyNameDiagnosticAnalyzer.LongIdentPropertyKey) with
27-
| true, longIdent -> sprintf "%s '%s'" SR.SimplifyName.Value longIdent
28-
| _ -> SR.SimplifyName.Value
27+
| true, longIdent -> sprintf "%s '%s'" (SR.SimplifyName()) longIdent
28+
| _ -> SR.SimplifyName()
2929

3030
let codefix = createTextChangeCodeFix(title, context, (fun () -> asyncMaybe.Return [| TextChange(context.Span, "") |]))
3131

Commands/HelpContextService.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,13 @@ type internal FSharpHelpContextService
9999

100100
member this.GetHelpTermAsync(document, textSpan, cancellationToken) =
101101
asyncMaybe {
102-
let! options = projectInfoManager.TryGetOptionsForEditingDocumentOrProject(document)
102+
let! _parsingOptions, projectOptions = projectInfoManager.TryGetOptionsForEditingDocumentOrProject(document)
103103
let! sourceText = document.GetTextAsync(cancellationToken)
104104
let! textVersion = document.GetTextVersionAsync(cancellationToken)
105105
let defines = projectInfoManager.GetCompilationDefinesForEditingDocument(document)
106106
let textLine = sourceText.Lines.GetLineFromPosition(textSpan.Start)
107107
let tokens = Tokenizer.getColorizationData(document.Id, sourceText, textLine.Span, Some document.Name, defines, cancellationToken)
108-
return! FSharpHelpContextService.GetHelpTerm(checkerProvider.Checker, sourceText, document.FilePath, options, textSpan, tokens, textVersion.GetHashCode())
108+
return! FSharpHelpContextService.GetHelpTerm(checkerProvider.Checker, sourceText, document.FilePath, projectOptions, textSpan, tokens, textVersion.GetHashCode())
109109
}
110110
|> Async.map (Option.defaultValue "")
111111
|> RoslynHelpers.StartAsyncAsTask cancellationToken

0 commit comments

Comments
 (0)