Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
03e7cab
show related completion after = or <> like C#
ijklam May 25, 2024
ed3db60
fix bug; format
ijklam May 25, 2024
1994e63
try fix
ijklam May 25, 2024
4375a4d
fix build
ijklam May 25, 2024
0a204bb
improve class member override completion
ijklam May 26, 2024
a0cccec
support override completion for interface implementation and obj expr
ijklam May 26, 2024
3aa34f8
fix #14375
ijklam May 27, 2024
2ab0062
field completion in method parameter list
ijklam Jun 1, 2024
0636a80
Merge branch 'main' into completion-after-op-improve
ijklam Jun 4, 2024
fc599c1
sync with main
ijklam Jun 4, 2024
e8351b9
sync with main
ijklam Jun 4, 2024
1578994
make override completion of property correctly
ijklam Jun 5, 2024
74967ba
for accessing base method, only write `base`
ijklam Jun 5, 2024
f820edc
exclude implemented method/prop from interface implement of class
ijklam Jun 5, 2024
a0d28a6
simplify completionitem construct
ijklam Jun 6, 2024
0589485
parameter completion on currying function
ijklam Jun 6, 2024
d087238
format code
ijklam Jun 6, 2024
38faffa
fix test
ijklam Jun 6, 2024
4900fd7
Merge branch 'main' into completion-after-op-improve
ijklam Jun 6, 2024
fadd943
Merge branch 'completion-after-op-improve' of https://github.com/Tang…
ijklam Jun 6, 2024
0aa89a8
Merge remote-tracking branch 'upstream/main' into completion-after-op…
ijklam Jun 27, 2024
a57c559
Show literals completion in match
ijklam Jun 27, 2024
fbe6487
Show preferred completions on the top
ijklam Jun 27, 2024
397d278
fix match completion
ijklam Jun 27, 2024
9eb42b3
Parameter completion will wrap in paren if not in a paren
ijklam Jun 28, 2024
dc7c0c9
Merge branch 'main' into completion-after-op-improve
ijklam Jun 28, 2024
dc3052c
change ispreferred to int
ijklam Jun 28, 2024
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
469 changes: 428 additions & 41 deletions src/Compiler/Service/FSharpCheckerResults.fs

Large diffs are not rendered by default.

15 changes: 11 additions & 4 deletions src/Compiler/Service/ServiceDeclarationLists.fs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ type CompletionItemKind =
| CustomOperation
| Other

type CompletionPreferType =
| Suggested = 0
| Normal = 10000

type UnresolvedSymbol =
{ FullName: string
DisplayName: string
Expand All @@ -88,7 +92,8 @@ type CompletionItem =
Type: TyconRef option
Unresolved: UnresolvedSymbol option
CustomInsertText: string voption
CustomDisplayText: string voption }
CustomDisplayText: string voption
PreferredType: CompletionPreferType }
member x.Item = x.ItemWithInst.Item

[<AutoOpen>]
Expand Down Expand Up @@ -1010,7 +1015,7 @@ module internal DescriptionListsImpl =
/// An intellisense declaration
[<Sealed>]
type DeclarationListItem(textInDeclList: string, textInCode: string, fullName: string, glyph: FSharpGlyph, info, accessibility: FSharpAccessibility,
kind: CompletionItemKind, isOwnMember: bool, priority: int, isResolved: bool, namespaceToOpen: string option) =
kind: CompletionItemKind, isOwnMember: bool, priority: int, isResolved: bool, namespaceToOpen: string option, preferredType: CompletionPreferType) =

member _.Name = textInDeclList

Expand Down Expand Up @@ -1043,6 +1048,8 @@ type DeclarationListItem(textInDeclList: string, textInCode: string, fullName: s

member _.NamespaceToOpen = namespaceToOpen

member _.PreferredType = preferredType

/// A table of declarations for Intellisense completion
[<Sealed>]
type DeclarationListInfo(declarations: DeclarationListItem[], isForType: bool, isError: bool) =
Expand Down Expand Up @@ -1252,14 +1259,14 @@ type DeclarationListInfo(declarations: DeclarationListItem[], isForType: bool, i

DeclarationListItem(
textInDeclList, textInCode, fullName, glyph, Choice1Of2 (items, infoReader, ad, m, denv), getAccessibility item.Item,
item.Kind, item.IsOwnMember, item.MinorPriority, item.Unresolved.IsNone, namespaceToOpen))
item.Kind, item.IsOwnMember, item.MinorPriority, item.Unresolved.IsNone, namespaceToOpen, item.PreferredType))

DeclarationListInfo(Array.ofList decls, isForType, false)

static member Error message =
DeclarationListInfo(
[| DeclarationListItem("<Note>", "<Note>", "<Note>", FSharpGlyph.Error, Choice2Of2 (ToolTipText [ToolTipElement.CompositionError message]),
FSharpAccessibility(taccessPublic), CompletionItemKind.Other, false, 0, false, None) |], false, true)
FSharpAccessibility(taccessPublic), CompletionItemKind.Other, false, 0, false, None, CompletionPreferType.Suggested) |], false, true)

static member Empty = empty

Expand Down
7 changes: 7 additions & 0 deletions src/Compiler/Service/ServiceDeclarationLists.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ type public CompletionItemKind =
| CustomOperation
| Other

type public CompletionPreferType =
| Suggested = 0
| Normal = 10000

type public UnresolvedSymbol =
{
FullName: string
Expand All @@ -94,6 +98,7 @@ type internal CompletionItem =

CustomInsertText: string voption
CustomDisplayText: string voption
PreferredType: CompletionPreferType
}
member Item: Item

Expand Down Expand Up @@ -142,6 +147,8 @@ type public DeclarationListItem =

member NamespaceToOpen: string option

member PreferredType: CompletionPreferType


/// Represents a set of declarations in F# source code, with information attached ready for display by an editor.
/// Returned by GetDeclarations.
Expand Down
Loading