Skip to content

Commit 3f5a466

Browse files
Add keywords to autocomplete
1 parent 64d7ce6 commit 3f5a466

File tree

5 files changed

+20
-19
lines changed

5 files changed

+20
-19
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ src/atom-fsharp/lib/fsharp.js
5858
/temp/release
5959
src/atom-fsharp/bin-fantomas/
6060
release/syntaxes
61+
release/templates
6162

6263
temp
6364
.fake

paket.dependencies

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
source https://nuget.org/api/v2
22

33
git https://github.com/ionide/ionide-vscode-helpers.git master build:"build.cmd", OS: windows
4-
git https://github.com/ionide/FsAutoComplete.git master build:"build.cmd LocalRelease", OS: windows
4+
git https://github.com/ionide/FsAutoComplete.git keywords build:"build.cmd LocalRelease", OS: windows
55
git https://github.com/fsprojects/Forge.git master build:"build.cmd", OS: windows
66

77
git https://github.com/ionide/ionide-vscode-helpers.git master build:"build.sh", OS: mono
8-
git https://github.com/ionide/FsAutoComplete.git master build:"build.sh LocalRelease", OS: mono
8+
git https://github.com/ionide/FsAutoComplete.git keywords build:"build.sh LocalRelease", OS: mono
99
git https://github.com/fsprojects/Forge.git master build:"build.sh", OS: mono
1010

1111
git [email protected]:ionide/ionide-fsgrammar.git

paket.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
NUGET
22
remote: https://www.nuget.org/api/v2
3-
FAKE (4.31.1)
3+
FAKE (4.32)
44
Microsoft.Bcl (1.1.10) - framework: net10, net11, net20, net30, net35, net40, net40-full
55
Microsoft.Bcl.Build (>= 1.0.14)
66
Microsoft.Bcl.Build (1.0.21) - import_targets: false, framework: net10, net11, net20, net30, net35, net40, net40-full
@@ -21,10 +21,10 @@ GIT
2121
build: build.sh
2222
os: mono
2323
remote: https://github.com/ionide/FsAutoComplete.git
24-
(e8d2a88369ef166ded48d3a52cf2a0cff02b0372)
24+
(2903174dc9ac12a9420022254ea518f55c1e54bc)
2525
build: build.cmd LocalRelease
2626
os: windows
27-
(e8d2a88369ef166ded48d3a52cf2a0cff02b0372)
27+
(2903174dc9ac12a9420022254ea518f55c1e54bc)
2828
build: build.sh LocalRelease
2929
os: mono
3030
remote: https://github.com/fsprojects/Forge.git
@@ -38,7 +38,7 @@ GIT
3838
(c8fea8dc0a224a2ceb2371bc5e941157aca3de9e)
3939
GITHUB
4040
remote: fsharp/FAKE
41-
modules/Octokit/Octokit.fsx (40dd0ff66fc379474450f93fd1ba545f6cf6c121)
41+
modules/Octokit/Octokit.fsx (094228d817b5bdb97f896a7d4a994d31e66be529)
4242
Octokit (>= 0.20)
4343
remote: Ionide/ionide-vscode-helpers
4444
Fable.Import.Axios.fs (777815f9c3f9b3925e42c6394c7f1f5fac124d6a)

release/templates

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/Components/Autocomplete.fs

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,27 @@ module Autocomplete =
1414
let private createProvider () =
1515
let provider = createEmpty<CompletionItemProvider>
1616

17-
let convertToInt code =
17+
let convertToKind code =
1818
match code with
19-
| "C" -> 6 (* CompletionItemKind.Class *)
20-
| "E" -> 12 (* CompletionItemKind.Enum *)
21-
| "S" -> 6 (* CompletionItemKind.Value *)
22-
| "I" -> 7 (* CompletionItemKind.Interface *)
23-
| "N" -> 8 (* CompletionItemKind.Module *)
24-
| "M" -> 1 (* CompletionItemKind.Method *)
25-
| "P" -> 9 (* CompletionItemKind.Property *)
26-
| "F" -> 4 (* CompletionItemKind.Field *)
27-
| "T" -> 6 (* CompletionItemKind.Class *)
28-
| _ -> 0
19+
| "C" -> CompletionItemKind.Class
20+
| "E" -> CompletionItemKind.Enum
21+
| "S" -> CompletionItemKind.Value
22+
| "I" -> CompletionItemKind.Interface
23+
| "N" -> CompletionItemKind.Module
24+
| "M" -> CompletionItemKind.Method
25+
| "P" -> CompletionItemKind.Property
26+
| "F" -> CompletionItemKind.Field
27+
| "T" -> CompletionItemKind.Class
28+
| "K" -> CompletionItemKind.Keyword
29+
| _ -> 0 |> unbox
2930

3031
let mapCompletion (doc : TextDocument) (pos : Position) (o : CompletionResult) =
3132
if o |> unbox <> null then
3233
o.Data |> Array.map (fun c ->
3334
let range = doc.getWordRangeAtPosition pos
3435
let length = if JS.isDefined range then range.``end``.character - range.start.character else 0.
3536
let result = createEmpty<CompletionItem>
36-
result.kind <- c.GlyphChar |> convertToInt |> unbox
37+
result.kind <- c.GlyphChar |> convertToKind |> unbox
3738
result.label <- c.Name
3839
result.insertText <- c.ReplacementText
3940
result)

0 commit comments

Comments
 (0)