gi-gtksource-5.0.0: GtkSource bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.GtkSource.Objects.Completion

Description

Main Completion Object.

The completion system helps the user when they writes some text, such as words, command names, functions, and suchlike. Proposals can be shown, to complete the text the user is writing. Each proposal can contain an additional piece of information (for example documentation), that is displayed when the "Details" button is clicked.

Proposals are created via a [ifacecompletionProvider]. There can be for example a provider to complete words (see [classcompletionWords]), another provider for the completion of function names, etc. To add a provider, call [methodcompletion.add_provider].

When several providers match, they are all shown in the completion window, but one can switch between providers: see the Completion::move-page signal. It is also possible to activate the first proposals with key bindings, see the Completion:accelerators property.

The [ifacecompletionProposal] interface represents a proposal.

If a proposal contains extra information (see CompletionColumnDetails), it will be displayed in a supplemental details window, which appears when the "Details" button is clicked.

Each [classview] object is associated with a [classcompletion] instance. This instance can be obtained with [methodview.get_completion]. The [classview] class contains also the signalview[showCompletion] signal.

A same [ifacecompletionProvider] object can be used for several GtkSourceCompletion's.

Synopsis

Exported types

newtype Completion Source #

Memory-managed wrapper type.

Constructors

Completion (ManagedPtr Completion) 

Instances

Instances details
Eq Completion Source # 
Instance details

Defined in GI.GtkSource.Objects.Completion

GObject Completion Source # 
Instance details

Defined in GI.GtkSource.Objects.Completion

ManagedPtrNewtype Completion Source # 
Instance details

Defined in GI.GtkSource.Objects.Completion

Methods

toManagedPtr :: Completion -> ManagedPtr Completion

TypedObject Completion Source # 
Instance details

Defined in GI.GtkSource.Objects.Completion

Methods

glibType :: IO GType

HasParentTypes Completion Source # 
Instance details

Defined in GI.GtkSource.Objects.Completion

IsGValue (Maybe Completion) Source #

Convert Completion to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.GtkSource.Objects.Completion

Methods

gvalueGType_ :: IO GType

gvalueSet_ :: Ptr GValue -> Maybe Completion -> IO ()

gvalueGet_ :: Ptr GValue -> IO (Maybe Completion)

type ParentTypes Completion Source # 
Instance details

Defined in GI.GtkSource.Objects.Completion

type ParentTypes Completion = '[Object]

class (GObject o, IsDescendantOf Completion o) => IsCompletion o Source #

Type class for types which can be safely cast to Completion, for instance with toCompletion.

Instances

Instances details
(GObject o, IsDescendantOf Completion o) => IsCompletion o Source # 
Instance details

Defined in GI.GtkSource.Objects.Completion

toCompletion :: (MonadIO m, IsCompletion o) => o -> m Completion Source #

Cast to Completion, for types for which this is known to be safe. For general casts, use castTo.

Methods

addProvider

completionAddProvider Source #

Arguments

:: (HasCallStack, MonadIO m, IsCompletion a, IsCompletionProvider b) 
=> a

self: a Completion

-> b

provider: a CompletionProvider

-> m () 

Adds a [ifacecompletionProvider] to the list of providers to be queried for completion results.

blockInteractive

completionBlockInteractive :: (HasCallStack, MonadIO m, IsCompletion a) => a -> m () Source #

No description available in the introspection data.

fuzzyHighlight

completionFuzzyHighlight Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

haystack: the string to be highlighted

-> Text

casefoldQuery: the typed-text used to highlight haystack

-> m (Maybe AttrList)

Returns: a AttrList or Nothing

This will add <b> tags around matched characters in haystack based on casefoldQuery.

fuzzyMatch

completionFuzzyMatch Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Maybe Text

haystack: the string to be searched.

-> Text

casefoldNeedle: A utf8Casefold version of the needle.

-> m (Bool, Word32)

Returns: True if haystack matched casefoldNeedle, otherwise False.

This helper function can do a fuzzy match for you giving a haystack and casefolded needle.

Casefold your needle using utf8Casefold before running the query.

Score will be set with the score of the match upon success. Otherwise, it will be set to zero.

getBuffer

completionGetBuffer Source #

Arguments

:: (HasCallStack, MonadIO m, IsCompletion a) 
=> a

self: a Completion

-> m Buffer

Returns: A Buffer

Gets the connected [classview]'s [classbuffer]

getPageSize

completionGetPageSize :: (HasCallStack, MonadIO m, IsCompletion a) => a -> m Word32 Source #

No description available in the introspection data.

getView

completionGetView Source #

Arguments

:: (HasCallStack, MonadIO m, IsCompletion a) 
=> a

self: a Completion

-> m View

Returns: A View

Gets the [classview] that owns the [classcompletion].

hide

completionHide Source #

Arguments

:: (HasCallStack, MonadIO m, IsCompletion a) 
=> a

self: a Completion

-> m () 

Emits the "hide" signal.

When the "hide" signal is emitted, the completion window will be dismissed.

removeProvider

completionRemoveProvider Source #

Arguments

:: (HasCallStack, MonadIO m, IsCompletion a, IsCompletionProvider b) 
=> a

self: a Completion

-> b

provider: a CompletionProvider

-> m () 

Removes a [ifacecompletionProvider] previously added with [methodcompletion.add_provider].

setPageSize

completionSetPageSize :: (HasCallStack, MonadIO m, IsCompletion a) => a -> Word32 -> m () Source #

No description available in the introspection data.

show

completionShow Source #

Arguments

:: (HasCallStack, MonadIO m, IsCompletion a) 
=> a

self: a Completion

-> m () 

Emits the "show" signal.

When the "show" signal is emitted, the completion window will be displayed if there are any results available.

unblockInteractive

completionUnblockInteractive :: (HasCallStack, MonadIO m, IsCompletion a) => a -> m () Source #

No description available in the introspection data.

Properties

buffer

The TextBuffer for the Completion:view. This is a convenience property for providers.

getCompletionBuffer :: (MonadIO m, IsCompletion o) => o -> m (Maybe TextView) Source #

Get the value of the “buffer” property. When overloading is enabled, this is equivalent to

get completion #buffer

pageSize

The number of rows to display to the user before scrolling.

constructCompletionPageSize :: (IsCompletion o, MonadIO m) => Word32 -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “page-size” property. This is rarely needed directly, but it is used by new.

getCompletionPageSize :: (MonadIO m, IsCompletion o) => o -> m Word32 Source #

Get the value of the “page-size” property. When overloading is enabled, this is equivalent to

get completion #pageSize

setCompletionPageSize :: (MonadIO m, IsCompletion o) => o -> Word32 -> m () Source #

Set the value of the “page-size” property. When overloading is enabled, this is equivalent to

set completion [ #pageSize := value ]

rememberInfoVisibility

Determines whether the visibility of the info window should be saved when the completion is hidden, and restored when the completion is shown again.

constructCompletionRememberInfoVisibility :: (IsCompletion o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “remember-info-visibility” property. This is rarely needed directly, but it is used by new.

getCompletionRememberInfoVisibility :: (MonadIO m, IsCompletion o) => o -> m Bool Source #

Get the value of the “remember-info-visibility” property. When overloading is enabled, this is equivalent to

get completion #rememberInfoVisibility

setCompletionRememberInfoVisibility :: (MonadIO m, IsCompletion o) => o -> Bool -> m () Source #

Set the value of the “remember-info-visibility” property. When overloading is enabled, this is equivalent to

set completion [ #rememberInfoVisibility := value ]

selectOnShow

Determines whether the first proposal should be selected when the completion is first shown.

constructCompletionSelectOnShow :: (IsCompletion o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “select-on-show” property. This is rarely needed directly, but it is used by new.

getCompletionSelectOnShow :: (MonadIO m, IsCompletion o) => o -> m Bool Source #

Get the value of the “select-on-show” property. When overloading is enabled, this is equivalent to

get completion #selectOnShow

setCompletionSelectOnShow :: (MonadIO m, IsCompletion o) => o -> Bool -> m () Source #

Set the value of the “select-on-show” property. When overloading is enabled, this is equivalent to

set completion [ #selectOnShow := value ]

showIcons

The "show-icons" property denotes if icons should be displayed within the list of completions presented to the user.

constructCompletionShowIcons :: (IsCompletion o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “show-icons” property. This is rarely needed directly, but it is used by new.

getCompletionShowIcons :: (MonadIO m, IsCompletion o) => o -> m Bool Source #

Get the value of the “show-icons” property. When overloading is enabled, this is equivalent to

get completion #showIcons

setCompletionShowIcons :: (MonadIO m, IsCompletion o) => o -> Bool -> m () Source #

Set the value of the “show-icons” property. When overloading is enabled, this is equivalent to

set completion [ #showIcons := value ]

view

The "view" property is the TextView for which this Completion is providing completion features.

constructCompletionView :: (IsCompletion o, MonadIO m, IsView a) => a -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “view” property. This is rarely needed directly, but it is used by new.

getCompletionView :: (MonadIO m, IsCompletion o) => o -> m View Source #

Get the value of the “view” property. When overloading is enabled, this is equivalent to

get completion #view

Signals

hide

type CompletionHideCallback = IO () Source #

The "hide" signal is emitted when the completion window should be hidden.

afterCompletionHide :: (IsCompletion a, MonadIO m) => a -> ((?self :: a) => CompletionHideCallback) -> m SignalHandlerId Source #

Connect a signal handler for the hide signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after completion #hide callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

onCompletionHide :: (IsCompletion a, MonadIO m) => a -> ((?self :: a) => CompletionHideCallback) -> m SignalHandlerId Source #

Connect a signal handler for the hide signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on completion #hide callback

providerAdded

type CompletionProviderAddedCallback Source #

Arguments

 = CompletionProvider

provider: a CompletionProvider

-> IO () 

The "provided-added" signal is emitted when a new provider is added to the completion.

afterCompletionProviderAdded :: (IsCompletion a, MonadIO m) => a -> ((?self :: a) => CompletionProviderAddedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the providerAdded signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after completion #providerAdded callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

onCompletionProviderAdded :: (IsCompletion a, MonadIO m) => a -> ((?self :: a) => CompletionProviderAddedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the providerAdded signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on completion #providerAdded callback

providerRemoved

type CompletionProviderRemovedCallback Source #

Arguments

 = CompletionProvider

provider: a CompletionProvider

-> IO () 

The "provided-removed" signal is emitted when a provider has been removed from the completion.

afterCompletionProviderRemoved :: (IsCompletion a, MonadIO m) => a -> ((?self :: a) => CompletionProviderRemovedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the providerRemoved signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after completion #providerRemoved callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

onCompletionProviderRemoved :: (IsCompletion a, MonadIO m) => a -> ((?self :: a) => CompletionProviderRemovedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the providerRemoved signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on completion #providerRemoved callback

show

type CompletionShowCallback = IO () Source #

The "show" signal is emitted when the completion window should be shown.

afterCompletionShow :: (IsCompletion a, MonadIO m) => a -> ((?self :: a) => CompletionShowCallback) -> m SignalHandlerId Source #

Connect a signal handler for the show signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after completion #show callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

onCompletionShow :: (IsCompletion a, MonadIO m) => a -> ((?self :: a) => CompletionShowCallback) -> m SignalHandlerId Source #

Connect a signal handler for the show signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on completion #show callback