C# Class _3PA.MainFeatures.AutoCompletion.AutoComplete

This class handles the AutoCompletionForm
显示文件 Open project: jcaillon/3P Class Usage Examples

Private Properties

Property Type Description
OnInsertSuggestion void
RememberUseOf void
SetCurrentItems void
ShowSuggestionList void

Public Methods

Method 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

Method 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 method

Closes the form
public static Close ( ) : void
return void

CorrectKeywordCase() public static method

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

FindInCompletionData() public static method

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
return List

FindInSavedItems() public static method

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

FindRankingOfDatabaseItem() public static method

Find ranking of a database item
public static FindRankingOfDatabaseItem ( string displayText ) : int
displayText string
return int

FindRankingOfParsedItem() public static method

Find ranking of a parsed item
public static FindRankingOfParsedItem ( string displayText ) : int
displayText string
return int

ForceClose() public static method

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

GetCurrentSuggestion() public static method

returns the keyword currently selected in the completion list
public static GetCurrentSuggestion ( ) : CompletionItem
return CompletionItem

IsMouseIn() public static method

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

OnKeyDown() public static method

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

OnShowCompleteSuggestionList() public static method

Called from CTRL + Space shortcut
public static OnShowCompleteSuggestionList ( ) : void
return void

RefreshDynamicItems() public static method

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
return void

RefreshStaticItems() public static method

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
return void

RememberUseOfDatabaseItem() public static method

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

RememberUseOfParsedItem() public static method

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

UpdateAutocompletion() public static method

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
return void