Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge release/dev16.2 to release/dev16.3 #7004

Merged
merged 1 commit into from
Jun 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion RoslynPackageVersion.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.1.0-beta3-19222-02
3.2.0-beta4-19312-15
1 change: 1 addition & 0 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
https://dotnet.myget.org/F/roslyn-tools/api/v3/index.json;
https://api.nuget.org/v3/index.json;
https://dotnet.myget.org/F/roslyn/api/v3/index.json;
https://dotnet.myget.org/F/roslyn-analyzers/api/v3/index.json;
https://dotnet.myget.org/F/symreader-converter/api/v3/index.json;
https://dotnet.myget.org/F/interactive-window/api/v3/index.json;
https://myget.org/F/vs-devcore/api/v3/index.json;
Expand Down

This file was deleted.

3 changes: 2 additions & 1 deletion vsintegration/src/FSharp.Editor/CodeFix/RemoveUnusedOpens.fs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ open Microsoft.CodeAnalysis.Diagnostics
open Microsoft.CodeAnalysis.Text
open Microsoft.CodeAnalysis.CodeFixes
open Microsoft.CodeAnalysis.CodeActions
open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Diagnostics

open FSharp.Compiler.Range

Expand All @@ -21,7 +22,7 @@ type internal FSharpRemoveUnusedOpensCodeFixProvider
projectInfoManager: FSharpProjectOptionsManager
) =
inherit CodeFixProvider()
let fixableDiagnosticIds = [IDEDiagnosticIds.RemoveUnnecessaryImportsDiagnosticId]
let fixableDiagnosticIds = [FSharpIDEDiagnosticIds.RemoveUnnecessaryImportsDiagnosticId]

let createCodeFix (title: string, context: CodeFixContext) =
CodeAction.Create(
Expand Down
5 changes: 3 additions & 2 deletions vsintegration/src/FSharp.Editor/CodeFix/SimplifyName.fs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ open Microsoft.CodeAnalysis
open Microsoft.CodeAnalysis.Diagnostics
open Microsoft.CodeAnalysis.Text
open Microsoft.CodeAnalysis.CodeFixes
open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Diagnostics
open SymbolHelpers

[<ExportCodeFixProvider(FSharpConstants.FSharpLanguageName, Name = PredefinedCodeFixProviderNames.SimplifyNames); Shared>]
[<ExportCodeFixProvider(FSharpConstants.FSharpLanguageName, Name = "SimplifyNames"); Shared>]
type internal FSharpSimplifyNameCodeFixProvider() =
inherit CodeFixProvider()
let fixableDiagnosticId = IDEDiagnosticIds.SimplifyNamesDiagnosticId
let fixableDiagnosticId = FSharpIDEDiagnosticIds.SimplifyNamesDiagnosticId

override __.FixableDiagnosticIds = ImmutableArray.Create(fixableDiagnosticId)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ open System.Windows.Media.Animation
open Microsoft.CodeAnalysis
open Microsoft.CodeAnalysis.Editor.Shared.Extensions
open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Classification
open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Editor.Shared.Extensions

open FSharp.Compiler
open FSharp.Compiler.SourceCodeServices
Expand Down Expand Up @@ -91,7 +92,7 @@ type internal FSharpCodeLensService
logInfof "Tagged text %A" taggedText
#endif
let textBlock = new TextBlock(Background = Brushes.AliceBlue, Opacity = 0.0, TextTrimming = TextTrimming.None)
DependencyObjectExtensions.SetDefaultTextProperties(textBlock, formatMap.Value)
FSharpDependencyObjectExtensions.SetDefaultTextProperties(textBlock, formatMap.Value)

let prefix = Documents.Run settings.CodeLens.Prefix
prefix.Foreground <- SolidColorBrush(Color.FromRgb(153uy, 153uy, 153uy))
Expand All @@ -116,7 +117,7 @@ type internal FSharpCodeLensService
coloredProperties.SetForeground(Color.FromRgb(153uy, 153uy, 153uy))

let run = Documents.Run text.Text
DependencyObjectExtensions.SetTextProperties (run, actualProperties)
FSharpDependencyObjectExtensions.SetTextProperties (run, actualProperties)

let inl =
match text with
Expand All @@ -126,7 +127,7 @@ type internal FSharpCodeLensService
navigation.NavigateTo nav.Range)
h :> Documents.Inline
| _ -> run :> _
DependencyObjectExtensions.SetTextProperties (inl, actualProperties)
FSharpDependencyObjectExtensions.SetTextProperties (inl, actualProperties)
textBlock.Inlines.Add inl


Expand Down
20 changes: 0 additions & 20 deletions vsintegration/src/FSharp.Editor/Common/ContentType.fs

This file was deleted.

8 changes: 0 additions & 8 deletions vsintegration/src/FSharp.Editor/Common/RoslynHelpers.fs
Original file line number Diff line number Diff line change
Expand Up @@ -130,14 +130,6 @@ module internal RoslynHelpers =
let StartAsyncUnitAsTask cancellationToken (computation:Async<unit>) =
StartAsyncAsTask cancellationToken computation :> Task

let private TheSupportedDiagnostics =
// We are constructing our own descriptors at run-time. Compiler service is already doing error formatting and localization.
let dummyDescriptors =
[| for i in 0 .. 10000 -> DiagnosticDescriptor(sprintf "FS%04d" i, String.Empty, String.Empty, String.Empty, DiagnosticSeverity.Error, true, null, null) |]
ImmutableArray.Create<DiagnosticDescriptor>(dummyDescriptors)

let SupportedDiagnostics() = TheSupportedDiagnostics

let ConvertError(error: FSharpErrorInfo, location: Location) =
// Normalize the error message into the same format that we will receive it from the compiler.
// This ensures that IntelliSense and Compiler errors in the 'Error List' are de-duplicated.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ open Microsoft.CodeAnalysis
open Microsoft.CodeAnalysis.Completion
open Microsoft.CodeAnalysis.Options
open Microsoft.CodeAnalysis.Text
open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Completion

open Microsoft.VisualStudio.Shell

Expand Down Expand Up @@ -48,7 +49,7 @@ type internal FSharpCompletionProvider
|> List.filter (fun (keyword, _) -> not (PrettyNaming.IsOperatorName keyword))
|> List.sortBy (fun (keyword, _) -> keyword)
|> List.mapi (fun n (keyword, description) ->
CommonCompletionItem.Create(keyword, null, CompletionItemRules.Default, Nullable Glyph.Keyword, sortText = sprintf "%06d" (1000000 + n))
FSharpCommonCompletionItem.Create(keyword, null, CompletionItemRules.Default, Nullable Glyph.Keyword, sortText = sprintf "%06d" (1000000 + n))
.AddProperty("description", description)
.AddProperty(IsKeywordPropName, ""))

Expand All @@ -73,7 +74,7 @@ type internal FSharpCompletionProvider
// * let xs = [1..10] <<---- Don't commit autocomplete! (same for arrays)
let noCommitChars = [|' '; '='; ','; '.'; '<'; '>'; '('; ')'; '!'; ':'; '['; ']'; '|'|].ToImmutableArray()

CompletionItemRules.Default.WithCommitCharacterRule(CharacterSetModificationRule.Create(CharacterSetModificationKind.Remove, noCommitChars))
CompletionItemRules.Default.WithCommitCharacterRules(ImmutableArray.Create (CharacterSetModificationRule.Create(CharacterSetModificationKind.Remove, noCommitChars)))

static let getRules showAfterCharIsTyped = if showAfterCharIsTyped then noCommitOnSpaceRules else CompletionItemRules.Default

Expand Down Expand Up @@ -152,7 +153,7 @@ type internal FSharpCompletionProvider
| _, idents -> Array.last idents

let completionItem =
CommonCompletionItem.Create(name, null, rules = getRules intellisenseOptions.ShowAfterCharIsTyped, glyph = Nullable (Microsoft.CodeAnalysis.ExternalAccess.FSharp.FSharpGlyphHelpersObsolete.Convert(glyph)), filterText = filterText)
FSharpCommonCompletionItem.Create(name, null, rules = getRules intellisenseOptions.ShowAfterCharIsTyped, glyph = Nullable glyph, filterText = filterText)
.AddProperty(FullNamePropName, declarationItem.FullName)

let completionItem =
Expand Down Expand Up @@ -198,7 +199,7 @@ type internal FSharpCompletionProvider
}

override this.ShouldTriggerCompletion(sourceText: SourceText, caretPosition: int, trigger: CompletionTrigger, _: OptionSet) =
use _logBlock = Logger.LogBlockMessage this.Name LogEditorFunctionId.Completion_ShouldTrigger
use _logBlock = Logger.LogBlock LogEditorFunctionId.Completion_ShouldTrigger

let getInfo() =
let documentId = workspace.GetDocumentIdInCurrentContext(sourceText.Container)
Expand Down
10 changes: 6 additions & 4 deletions vsintegration/src/FSharp.Editor/Completion/CompletionService.fs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ open Microsoft.CodeAnalysis
open Microsoft.CodeAnalysis.Completion
open Microsoft.CodeAnalysis.Host
open Microsoft.CodeAnalysis.Host.Mef
open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Completion

open Microsoft.VisualStudio.Shell

Expand All @@ -26,10 +27,11 @@ type internal FSharpCompletionService
let builtInProviders =
ImmutableArray.Create<CompletionProvider>(
FSharpCompletionProvider(workspace, serviceProvider, checkerProvider, projectInfoManager, assemblyContentProvider),
HashDirectiveCompletionProvider(workspace, projectInfoManager,
[ Completion.Create("""\s*#load\s+(@?"*(?<literal>"[^"]*"?))""", [".fs"; ".fsx"], useIncludeDirectives = true)
Completion.Create("""\s*#r\s+(@?"*(?<literal>"[^"]*"?))""", [".dll"; ".exe"], useIncludeDirectives = true)
Completion.Create("""\s*#I\s+(@?"*(?<literal>"[^"]*"?))""", ["\x00"], useIncludeDirectives = false) ]))
FSharpCommonCompletionProvider.Create(
HashDirectiveCompletionProvider(workspace, projectInfoManager,
[ Completion.Create("""\s*#load\s+(@?"*(?<literal>"[^"]*"?))""", [".fs"; ".fsx"], useIncludeDirectives = true)
Completion.Create("""\s*#r\s+(@?"*(?<literal>"[^"]*"?))""", [".dll"; ".exe"], useIncludeDirectives = true)
Completion.Create("""\s*#I\s+(@?"*(?<literal>"[^"]*"?))""", ["\x00"], useIncludeDirectives = false) ])))

override this.Language = FSharpConstants.FSharpLanguageName
override this.GetBuiltInProviders() = builtInProviders
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ open Microsoft.CodeAnalysis
open Microsoft.CodeAnalysis.Classification
open Microsoft.CodeAnalysis.Text
open Microsoft.CodeAnalysis.Completion
open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Completion
open System.Globalization
open FSharp.Compiler.SourceCodeServices

Expand Down Expand Up @@ -81,7 +82,7 @@ module internal CompletionUtils =
| _ -> false

let isStartingNewWord (sourceText, position) =
CommonCompletionUtilities.IsStartingNewWord(sourceText, position, (fun ch -> isIdentifierStartCharacter ch), (fun ch -> isIdentifierPartCharacter ch))
FSharpCommonCompletionUtilities.IsStartingNewWord(sourceText, position, (fun ch -> isIdentifierStartCharacter ch), (fun ch -> isIdentifierPartCharacter ch))

let shouldProvideCompletion (documentId: DocumentId, filePath: string, defines: string list, sourceText: SourceText, triggerPosition: int) : bool =
let textLines = sourceText.Lines
Expand Down
Loading