提交 fe014083 编写于 作者: B Brett V. Forsgren 提交者: GitHub

Merge pull request #3062 from brettfo/update-roslyn-refs

update Roslyn references
......@@ -527,7 +527,7 @@ if defined TF_BUILD (
git fetch --all
)
set msbuildflags=/maxcpucount %_nrswitch% /nologo
set msbuildflags=%_nrswitch% /nologo
REM set msbuildflags=%_nrswitch% /nologo
set _ngenexe="%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\ngen.exe"
if not exist %_ngenexe% echo Error: Could not find ngen.exe. && goto :failure
......
......@@ -32,7 +32,7 @@
<WarningsAsErrors />
<FX_NO_LOADER Condition=" '$(FX_NO_LOADER)'==''">false</FX_NO_LOADER>
<RoslynVersion>2.0.0</RoslynVersion>
<RoslynVersion>2.3.0-beta2-61719-01</RoslynVersion>
<RoslynVSBinariesVersion>15.0</RoslynVSBinariesVersion>
<RoslynVSPackagesVersion>15.0.26201</RoslynVSPackagesVersion>
<!--<VSSDK_BUILDTOOLS_VERSION>Microsoft.VSSDK.BuildTools.15.0.26124-RC3</VSSDK_BUILDTOOLS_VERSION>-->
......
......@@ -7,12 +7,12 @@
<package id="System.Reflection.Metadata" version="1.4.2" targetFramework="net46" />
<package id="Microsoft.Composition" version="1.0.30" targetFramework="net46" />
<package id="Microsoft.CodeAnalysis.Common" version="2.0.0" targetFramework="net46" />
<package id="Microsoft.CodeAnalysis.EditorFeatures" version="2.0.0" targetFramework="net46" />
<package id="Microsoft.CodeAnalysis.EditorFeatures.Text" version="2.0.0" targetFramework="net46" />
<package id="Microsoft.CodeAnalysis.Features" version="2.0.0" targetFramework="net46" />
<package id="Microsoft.CodeAnalysis.Workspaces.Common" version="2.0.0" targetFramework="net46" />
<package id="Microsoft.VisualStudio.LanguageServices" version="2.0.0" targetFramework="net46" />
<package id="Microsoft.CodeAnalysis.Common" version="2.3.0-beta2-61719-01" targetFramework="net46" />
<package id="Microsoft.CodeAnalysis.EditorFeatures" version="2.3.0-beta2-61719-01" targetFramework="net46" />
<package id="Microsoft.CodeAnalysis.EditorFeatures.Text" version="2.3.0-beta2-61719-01" targetFramework="net46" />
<package id="Microsoft.CodeAnalysis.Features" version="2.3.0-beta2-61719-01" targetFramework="net46" />
<package id="Microsoft.CodeAnalysis.Workspaces.Common" version="2.3.0-beta2-61719-01" targetFramework="net46" />
<package id="Microsoft.VisualStudio.LanguageServices" version="2.3.0-beta2-61719-01" targetFramework="net46" />
<package id="EnvDTE" version="8.0.1" targetFramework="net46" />
<package id="EnvDTE80" version="8.0.1" targetFramework="net46" />
......
......@@ -47,7 +47,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, Nullable Glyph.Keyword, sortText = sprintf "%06d" (1000000 + n))
CommonCompletionItem.Create(keyword, CompletionItemRules.Default, Nullable Glyph.Keyword, sortText = sprintf "%06d" (1000000 + n))
.AddProperty("description", description)
.AddProperty(IsKeywordPropName, ""))
......
......@@ -10,7 +10,6 @@ open System.Threading
open System.Threading.Tasks
open Microsoft.CodeAnalysis
open Microsoft.CodeAnalysis.Completion
open Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense.Completion.FileSystem
open Microsoft.CodeAnalysis.Text
open Microsoft.CodeAnalysis.Classification
......@@ -35,15 +34,9 @@ type internal HashDirectiveCompletionProvider(workspace: Workspace, projectInfoM
let getPathThroughLastSlash(text: SourceText, position: int, quotedPathGroup: Group) =
PathCompletionUtilities.GetPathThroughLastSlash(
quotedPath = quotedPathGroup.Value,
quotedPathStart = getQuotedPathStart(text, position, quotedPathGroup),
position = position)
let getTextChangeSpan(text: SourceText, position: int, quotedPathGroup: Group) =
PathCompletionUtilities.GetTextChangeSpan(
quotedPath = quotedPathGroup.Value,
quotedPathStart = getQuotedPathStart(text, position, quotedPathGroup),
position = position)
quotedPathGroup.Value,
getQuotedPathStart(text, position, quotedPathGroup),
position)
let getFileGlyph (extention: string) =
match extention with
......@@ -117,30 +110,26 @@ type internal HashDirectiveCompletionProvider(workspace: Workspace, projectInfoM
let snapshot = text.FindCorrespondingEditorTextSnapshot()
do! Option.guard (not (isNull snapshot))
let fileSystem = CurrentWorkingDirectoryDiscoveryService.GetService(snapshot)
let extraSearchPaths =
if completion.UseIncludeDirectives then
getIncludeDirectives (text, position)
else []
let defaultSearchPath = Path.GetDirectoryName document.FilePath
let searchPaths = defaultSearchPath :: extraSearchPaths
let helper =
FileSystemCompletionHelper(
this,
getTextChangeSpan(text, position, quotedPathGroup),
fileSystem,
Glyph.OpenFolder,
completion.AllowableExtensions |> List.tryPick getFileGlyph |> Option.defaultValue Glyph.None,
searchPaths = Seq.toImmutableArray searchPaths,
allowableExtensions = completion.AllowableExtensions,
itemRules = rules)
Seq.toImmutableArray searchPaths,
null,
completion.AllowableExtensions |> Seq.toImmutableArray,
rules)
let pathThroughLastSlash = getPathThroughLastSlash(text, position, quotedPathGroup)
let documentPath = if document.Project.IsSubmission then null else document.FilePath
context.AddItems(helper.GetItems(pathThroughLastSlash, documentPath))
context.AddItems(helper.GetItems(pathThroughLastSlash, ct))
}
|> Async.Ignore
|> RoslynHelpers.StartAsyncUnitAsTask context.CancellationToken
......
// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
namespace Microsoft.VisualStudio.FSharp.Editor
open System
open System.IO
module PathCompletionUtilities =
let GetPathThroughLastSlash(quotedPath: string, quotedPathStart: int, position: int) =
let quoteLength = "\"".Length
let positionInQuotedPath = position - quotedPathStart
let path = quotedPath.Substring(quoteLength, positionInQuotedPath - quoteLength).Trim()
let afterLastSlashIndex =
let position = Math.Min(path.Length, path.Length - 1)
let index = path.LastIndexOf(Path.DirectorySeparatorChar, position)
if index >= 0 then index + 1 else -1
if afterLastSlashIndex >= 0 then path.Substring(0, afterLastSlashIndex) else path
let EndsWithQuote(quotedPath: string) =
quotedPath.Length >= 2 && quotedPath.[quotedPath.Length - 1] = '"'
......@@ -8,6 +8,7 @@ open System.Collections.Immutable
open System.Threading.Tasks
open Microsoft.CodeAnalysis
open Microsoft.CodeAnalysis.DocumentHighlighting
open Microsoft.CodeAnalysis.Editor
open Microsoft.CodeAnalysis.Host.Mef
open Microsoft.CodeAnalysis.Text
......
......@@ -65,6 +65,7 @@
<Compile Include="DocComments\XMLDocumentation.fs" />
<Compile Include="Completion\CompletionUtils.fs" />
<Compile Include="Completion\CompletionProvider.fs" />
<Compile Include="Completion\PathCompletionUtilities.fs" />
<Compile Include="Completion\FileSystemCompletion.fs" />
<Compile Include="Completion\CompletionService.fs" />
<Compile Include="Completion\SignatureHelp.fs" />
......
......@@ -84,7 +84,7 @@ module internal Tokenizer =
| Internal -> Glyph.EnumInternal
| Protected -> Glyph.EnumProtected
| Private -> Glyph.EnumPrivate
| FSharpGlyph.EnumMember -> Glyph.EnumMember
| FSharpGlyph.EnumMember -> Glyph.EnumMemberPublic
| FSharpGlyph.Event ->
match accessibility with
| Public -> Glyph.EventPublic
......
......@@ -136,7 +136,7 @@ type internal FSharpFindUsagesService
| _ ->
for referenceDocSpan in referenceDocSpans do
for definitionItem in definitionItems do
let referenceItem = SourceReferenceItem(definitionItem, referenceDocSpan)
let referenceItem = SourceReferenceItem(definitionItem, referenceDocSpan, true) // defaulting to `true` until we can officially determine if this usage is a write
do! context.OnReferenceFoundAsync(referenceItem) |> Async.AwaitTask |> liftAsync
()
......
......@@ -116,7 +116,7 @@ System.Console.WriteLine(x + y)
[<Test>]
let ShouldNotTriggerCompletionAfterAnyTriggerOtherThanInsertion() =
for triggerKind in [CompletionTriggerKind.Deletion; CompletionTriggerKind.Other; CompletionTriggerKind.Snippets ] do
for triggerKind in [CompletionTriggerKind.Deletion; CompletionTriggerKind.Invoke; CompletionTriggerKind.Snippets ] do
let fileContents = "System.Console.WriteLine(123)"
let caretPosition = fileContents.IndexOf("System.")
let documentId = DocumentId.CreateNewId(ProjectId.CreateNewId())
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册