Skip to content

Commit 5751cad

Browse files
Make completion faster
1 parent 910b037 commit 5751cad

File tree

5 files changed

+9
-14
lines changed

5 files changed

+9
-14
lines changed

paket.lock

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
NUGET
22
remote: https://www.nuget.org/api/v2
3-
specs:
4-
FAKE (4.25.2)
3+
FAKE (4.25.4)
54
FunScript (1.1.94)
65
Microsoft.Bcl (1.1.10) - framework: net10, net11, net20, net30, net35, net40, net40-full
76
Microsoft.Bcl.Build (>= 1.0.14)
@@ -16,22 +15,17 @@ NUGET
1615
Microsoft.Net.Http - framework: net10, net11, net20, net30, net35, net40, net40-full
1716
GIT
1817
remote: https://github.com/ionide/ionide-vscode-helpers.git
19-
specs:
2018
(b81a80ede2179222a5639cf866423d9bc6c2f0b4)
2119
build: build.cmd
2220
remote: https://github.com/ionide/FSharpFormatting.CLI.git
23-
specs:
2421
(8b996684032cebe1ba052696fb30081fab023b1f)
2522
build: build.cmd
2623
remote: https://github.com/ionide/FsAutoComplete.git
27-
specs:
28-
(8be5fa64fdd5b8f811c7dda1beaa3b861c5808b2)
24+
(40248ae40c8b30921565fb573091e3917ff2a3cf)
2925
build: build.cmd LocalRelease
3026
remote: [email protected]:ionide/ionide-fsgrammar.git
31-
specs:
3227
(8061b5296321522633b16d7df66af8cf5fcd3784)
3328
GITHUB
3429
remote: fsharp/FAKE
35-
specs:
36-
modules/Octokit/Octokit.fsx (59dfade480c5f9107107f11af366aaae1f4a9157)
30+
modules/Octokit/Octokit.fsx (db3139b0bf8a93047a68ca10f0135f1e94a10cae)
3731
Octokit

src/Components/Autocomplete.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ module Autocomplete =
4444
sug
4545

4646
provider.``provideCompletionItems <-`` (fun doc pos _ ->
47-
LanguageService.parse doc.fileName (doc.getText ())
48-
|> Promise.bind (fun _ -> LanguageService.completion (doc.fileName) (int pos.line + 1) (int pos.character + 1))
47+
let ln = doc.lineAt pos.line
48+
LanguageService.completion (doc.fileName) ln.text (int pos.line + 1) (int pos.character + 1)
4949
|> Promise.success (mapCompletion doc pos)
5050
|> Promise.toThenable)
5151

src/Core/DTO.fs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ module DTO =
77
type DeclarationsRequest = {FileName : string}
88
type HelptextRequest = {Symbol : string}
99
type PositionRequest = {FileName : string; Line : int; Column : int; Filter : string}
10+
type CompletionRequest = {FileName : string; SourceLine : string; Line : int; Column : int; Filter : string}
1011

1112
type OverloadSignature = {
1213
Signature: string

src/Core/LanguageService.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ module LanguageService =
7272
|> request (url "helptext")
7373
|> send 0
7474

75-
let completion fn line col =
76-
{PositionRequest.Line = line; FileName = fn; Column = col; Filter = "Contains"}
75+
let completion fn sl line col =
76+
{CompletionRequest.Line = line; FileName = fn; Column = col; Filter = "Contains"; SourceLine = sl}
7777
|> request (url "completion")
7878
|> send 1
7979

src/Ionide.FSharp.fsproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
<Reference Include="System.Numerics" />
7676
</ItemGroup>
7777
<Choose>
78-
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.0' Or $(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6' Or $(TargetFrameworkVersion) == 'v4.6.1')">
78+
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.0' Or $(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6' Or $(TargetFrameworkVersion) == 'v4.6.1' Or $(TargetFrameworkVersion) == 'v4.6.2')">
7979
<ItemGroup>
8080
<Reference Include="FunScript.Interop">
8181
<HintPath>..\packages\FunScript\lib\net40\FunScript.Interop.dll</HintPath>

0 commit comments

Comments
 (0)