C# Class _3PA.MainFeatures.AutoCompletion.AutoComplete

This class handles the AutoCompletionForm
Afficher le fichier Open project: jcaillon/3P Class Usage Examples

Private Properties

Свойство Type Description
OnInsertSuggestion void
RememberUseOf void
SetCurrentItems void
ShowSuggestionList void

Méthodes publiques

Méthode Description
Close ( ) : void

Closes the form

CorrectKeywordCase ( string keyword, int lastWordPos ) : string

Returns a keyword from the autocompletion list with the correct case

FindInCompletionData ( string keyword, int position, bool dontCheckLine = false ) : List

Find a list of items in the completion and return it Uses the position to filter the list the same way the autocompletion form would

FindInSavedItems ( string keyword, int line ) : CompletionItem

try to match the keyword with an item in the autocomplete list

FindRankingOfDatabaseItem ( string displayText ) : int

Find ranking of a database item

FindRankingOfParsedItem ( string displayText ) : int

Find ranking of a parsed item

ForceClose ( ) : void

Forces the form to close, only when leaving npp

GetCurrentSuggestion ( ) : CompletionItem

returns the keyword currently selected in the completion list

IsMouseIn ( ) : bool

Returns true if the cursor is within the form window

OnKeyDown ( Keys key ) : bool

Passes the OnKey input of the CharAdded or w/e event to the auto completion form

OnShowCompleteSuggestionList ( ) : void

Called from CTRL + Space shortcut

RefreshDynamicItems ( ) : void

Method called when the event OnParseEnded triggers, i.e. when we just parsed the document and need to refresh the autocompletion

RefreshStaticItems ( ) : void

this method should be called at the plugin's start and when we change the current database It refreshed the "static" items of the autocompletion : keywords, snippets, databases, tables, sequences

RememberUseOfDatabaseItem ( string displayText ) : void

remember the use of a particular item in the completion list (for database items!)

RememberUseOfParsedItem ( string displayText ) : void

remember the use of a particular item in the completion list (for dynamic items = parsed items)

UpdateAutocompletion ( ) : void

Updates the CURRENT ITEMS LIST, handles the opening or the closing of the autocompletion form on key input, it is only called when the user adds or delete a char

Private Methods

Méthode Description
OnInsertSuggestion ( CompletionItem data ) : void

Method called by the form when the user accepts a suggestion (tab or enter or doubleclick)

RememberUseOf ( CompletionItem item ) : void

Increase ranking of a given CompletionItem

SetCurrentItems ( List currentItems ) : void

Set the list of current items, handles the lock

ShowSuggestionList ( string keyword ) : void

This function handles the display of the autocomplete form, create or update it

Method Details

Close() public static méthode

Closes the form
public static Close ( ) : void
Résultat void

CorrectKeywordCase() public static méthode

Returns a keyword from the autocompletion list with the correct case
public static CorrectKeywordCase ( string keyword, int lastWordPos ) : string
keyword string
lastWordPos int
Résultat string

FindInCompletionData() public static méthode

Find a list of items in the completion and return it Uses the position to filter the list the same way the autocompletion form would
public static FindInCompletionData ( string keyword, int position, bool dontCheckLine = false ) : List
keyword string
position int
dontCheckLine bool
Résultat List

FindInSavedItems() public static méthode

try to match the keyword with an item in the autocomplete list
public static FindInSavedItems ( string keyword, int line ) : CompletionItem
keyword string
line int
Résultat CompletionItem

FindRankingOfDatabaseItem() public static méthode

Find ranking of a database item
public static FindRankingOfDatabaseItem ( string displayText ) : int
displayText string
Résultat int

FindRankingOfParsedItem() public static méthode

Find ranking of a parsed item
public static FindRankingOfParsedItem ( string displayText ) : int
displayText string
Résultat int

ForceClose() public static méthode

Forces the form to close, only when leaving npp
public static ForceClose ( ) : void
Résultat void

GetCurrentSuggestion() public static méthode

returns the keyword currently selected in the completion list
public static GetCurrentSuggestion ( ) : CompletionItem
Résultat CompletionItem

IsMouseIn() public static méthode

Returns true if the cursor is within the form window
public static IsMouseIn ( ) : bool
Résultat bool

OnKeyDown() public static méthode

Passes the OnKey input of the CharAdded or w/e event to the auto completion form
public static OnKeyDown ( Keys key ) : bool
key Keys
Résultat bool

OnShowCompleteSuggestionList() public static méthode

Called from CTRL + Space shortcut
public static OnShowCompleteSuggestionList ( ) : void
Résultat void

RefreshDynamicItems() public static méthode

Method called when the event OnParseEnded triggers, i.e. when we just parsed the document and need to refresh the autocompletion
public static RefreshDynamicItems ( ) : void
Résultat void

RefreshStaticItems() public static méthode

this method should be called at the plugin's start and when we change the current database It refreshed the "static" items of the autocompletion : keywords, snippets, databases, tables, sequences
public static RefreshStaticItems ( ) : void
Résultat void

RememberUseOfDatabaseItem() public static méthode

remember the use of a particular item in the completion list (for database items!)
public static RememberUseOfDatabaseItem ( string displayText ) : void
displayText string
Résultat void

RememberUseOfParsedItem() public static méthode

remember the use of a particular item in the completion list (for dynamic items = parsed items)
public static RememberUseOfParsedItem ( string displayText ) : void
displayText string
Résultat void

UpdateAutocompletion() public static méthode

Updates the CURRENT ITEMS LIST, handles the opening or the closing of the autocompletion form on key input, it is only called when the user adds or delete a char
public static UpdateAutocompletion ( ) : void
Résultat void