@@ -10,7 +10,6 @@ open System.Threading
1010open System.Threading .Tasks
1111open Microsoft.CodeAnalysis
1212open Microsoft.CodeAnalysis .Completion
13- open Microsoft.CodeAnalysis .Editor .Implementation .IntelliSense .Completion .FileSystem
1413open Microsoft.CodeAnalysis .Text
1514open Microsoft.CodeAnalysis .Classification
1615
@@ -35,15 +34,9 @@ type internal HashDirectiveCompletionProvider(workspace: Workspace, projectInfoM
3534
3635let getPathThroughLastSlash ( text : SourceText , position : int , quotedPathGroup : Group ) =
3736 PathCompletionUtilities.GetPathThroughLastSlash(
38- quotedPath= quotedPathGroup.Value,
39- quotedPathStart= getQuotedPathStart( text, position, quotedPathGroup),
40- position= position)
41-
42- let getTextChangeSpan ( text : SourceText , position : int , quotedPathGroup : Group ) =
43- PathCompletionUtilities.GetTextChangeSpan(
44- quotedPath= quotedPathGroup.Value,
45- quotedPathStart= getQuotedPathStart( text, position, quotedPathGroup),
46- position= position)
37+ quotedPathGroup.Value,
38+ getQuotedPathStart( text, position, quotedPathGroup),
39+ position)
4740
4841let getFileGlyph ( extention : string ) =
4942match extentionwith
@@ -117,30 +110,26 @@ type internal HashDirectiveCompletionProvider(workspace: Workspace, projectInfoM
117110let snapshot = text.FindCorrespondingEditorTextSnapshot()
118111
119112do ! Option.guard( not ( isNull snapshot))
120- let fileSystem = CurrentWorkingDirectoryDiscoveryService.GetService( snapshot)
121-
113+
122114let extraSearchPaths =
123115if completion.UseIncludeDirectivesthen
124116 getIncludeDirectives( text, position)
125117else []
126-
118+
127119let defaultSearchPath = Path.GetDirectoryName document.FilePath
128120let searchPaths = defaultSearchPath:: extraSearchPaths
129-
121+
130122let helper =
131123 FileSystemCompletionHelper(
132- this,
133- getTextChangeSpan( text, position, quotedPathGroup),
134- fileSystem,
135124 Glyph.OpenFolder,
136125 completion.AllowableExtensions|> List.tryPick getFileGlyph|> Option.defaultValue Glyph.None,
137- searchPaths= Seq.toImmutableArray searchPaths,
138- allowableExtensions= completion.AllowableExtensions,
139- itemRules= rules)
126+ Seq.toImmutableArray searchPaths,
127+ null ,
128+ completion.AllowableExtensions|> Seq.toImmutableArray,
129+ rules)
140130
141131let pathThroughLastSlash = getPathThroughLastSlash( text, position, quotedPathGroup)
142- let documentPath = if document.Project.IsSubmissionthen null else document.FilePath
143- context.AddItems( helper.GetItems( pathThroughLastSlash, documentPath))
132+ context.AddItems( helper.GetItems( pathThroughLastSlash, ct))
144133}
145134|> Async.Ignore
146135|> RoslynHelpers.StartAsyncUnitAsTask context.CancellationToken