#include <MooseServer.h>
Classes | |
| struct | CheckState |
| Helper for storing the state for a single document. More... | |
Public Member Functions | |
| MooseServer (MooseApp &moose_app) | |
| virtual | ~MooseServer ()=default |
| std::shared_ptr< wasp::lsp::Connection > | getConnection () |
| Get read / write connection - specific to this server implemention. More... | |
Private Types | |
| using | SortedLocationNodes = std::set< wasp::HITNodeView, std::function< bool(const wasp::HITNodeView &, const wasp::HITNodeView &)> > |
| SortedLocationNodes - type alias for set of nodes sorted by location. More... | |
Private Member Functions | |
| bool | parseDocumentForDiagnostics (wasp::DataArray &diagnosticsList) |
| Parse document for diagnostics - specific to this server implemention. More... | |
| void | addResourcesForDocument () |
| Add paths from includes and FileName parameters for client to watch. More... | |
| void | getFileNameTypeValues (std::set< std::string > &filename_vals, wasp::HITNodeView parent) |
| Recursively walk input to gather all FileName type parameter values. More... | |
| bool | gatherDocumentCompletionItems (wasp::DataArray &completionItems, bool &is_incomplete, int line, int character) |
| Gather document completion items - specific to this server implemention. More... | |
| void | getExistingInput (wasp::HITNodeView parent_node, std::set< std::string > &existing_params, std::set< std::string > &existing_subblocks) |
| Get names of parameters and subblocks specified in given input node. More... | |
| void | getAllValidParameters (InputParameters &valid_params, const std::string &object_path, const std::string &object_type, std::set< std::string > &obj_act_tasks) |
| Get all global parameters, action parameters, and object parameters. More... | |
| void | getActionParameters (InputParameters &valid_params, const std::string &object_path, std::set< std::string > &obj_act_tasks) |
| Get all action parameters using requested object path to collection. More... | |
| void | getObjectParameters (InputParameters &valid_params, std::string object_type, const std::set< std::string > &obj_act_tasks) |
| Get all object parameters using requested object path to collection. More... | |
| bool | addParametersToList (wasp::DataArray &completionItems, const InputParameters &valid_params, const std::set< std::string > &existing_params, int replace_line_beg, int replace_char_beg, int replace_line_end, int replace_char_end, const std::string &filtering_prefix) |
| Add parameters that were previously gathered to list for completion. More... | |
| bool | addSubblocksToList (wasp::DataArray &completionItems, const std::string &object_path, int replace_line_beg, int replace_char_beg, int replace_line_end, int replace_char_end, const std::string &filtering_prefix, bool request_on_block_decl) |
| Add subblocks to completion list for request path, line, and column. More... | |
| bool | addValuesToList (wasp::DataArray &completionItems, const InputParameters &valid_params, const std::set< std::string > &existing_params, const std::set< std::string > &existing_subblocks, const std::string ¶m_name, const std::set< std::string > &obj_act_tasks, const std::string &object_path, int replace_line_beg, int replace_char_beg, int replace_line_end, int replace_char_end) |
| Add parameter values to completion list for request line and column. More... | |
| template<typename MooseEnumType > | |
| void | getEnumsAndDocs (MooseEnumType &moose_enum_param, std::map< std::string, std::string > &options_and_descs) |
| Fill map of all options and descriptions if parameter is moose enum. More... | |
| bool | gatherDocumentDefinitionLocations (wasp::DataArray &definitionLocations, int line, int character) |
| Gather definition locations - specific to this server implemention. More... | |
| void | getInputLookupDefinitionNodes (SortedLocationNodes &location_nodes, const std::string &clean_type, const std::string &val_string) |
| Get set of nodes from associated path lookups matching value string. More... | |
| bool | addLocationNodesToList (wasp::DataArray &defsOrRefsLocations, const SortedLocationNodes &location_nodes) |
| Add set of nodes sorted by location to definition or reference list. More... | |
| bool | getHoverDisplayText (std::string &display_text, int line, int character) |
| Get hover display text - logic specific to this server implemention. More... | |
| bool | gatherDocumentReferencesLocations (wasp::DataArray &referencesLocations, int line, int character, bool include_declaration) |
| Gather references locations - specific to this server implemention. More... | |
| void | getNodesByValueAndTypes (SortedLocationNodes &match_nodes, wasp::HITNodeView view_parent, const std::string &target_value, const std::set< std::string > &target_types) |
| Recursively walk input to gather all nodes matching value and types. More... | |
| bool | gatherDocumentFormattingTextEdits (wasp::DataArray &formattingTextEdits, int tab_size, bool insert_spaces) |
| Gather formatting text edits - specific to this server implemention. More... | |
| std::string | formatDocument (wasp::HITNodeView parent, std::size_t &prev_line, std::size_t level) |
| Recursively walk down whole nodeview tree while formatting document. More... | |
| bool | gatherDocumentSymbols (wasp::DataArray &documentSymbols) |
| Gather document symbols - specific to this server implemention. More... | |
| bool | traverseParseTreeAndFillSymbols (wasp::HITNodeView view_parent, wasp::DataObject &data_parent) |
| Recursively fill document symbols from the given node. More... | |
| int | getCompletionItemKind (const InputParameters &valid_params, const std::string ¶m_name, const std::string &clean_type, bool is_param) |
| Get completion item kind value that client may use for icon in list. More... | |
| int | getDocumentSymbolKind (wasp::HITNodeView symbol_node) |
| Get document symbol kind value that client may use for outline icon. More... | |
| std::string | getRequiredParamsText (const std::string &subblock_path, const std::string &subblock_type, const std::set< std::string > &existing_params, const std::string &indent_spaces) |
| Get required parameter completion text list for given subblock path. More... | |
| bool | gatherExtensionResponses (wasp::DataArray &extensionResponses, const std::string &extensionMethod, int line, int character) |
| Gather extension responses - specific to this server implemention. More... | |
| bool | gatherPlottingResponses (wasp::DataArray &plottingResponses, int line, int character) |
| Build CustomPlot extension responses when method name is plotting. More... | |
| void | buildLineGraphPlot (wasp::CustomPlot &plot_object, const std::string &plot_title, const std::vector< double > &graph_keys, const std::vector< double > &graph_vals) |
| Build CustomPlot graph with provided keys, values, and plot title. More... | |
| bool | connectionRead (wasp::DataObject &object) |
| Read from connection into object - specific to this server's connection. More... | |
| bool | connectionWrite (wasp::DataObject &object) |
| Write object json to connection - specific to this server's connection. More... | |
| bool | rootIsValid () const |
| const hit::Node * | queryRoot () const |
| MooseApp & | getCheckApp () |
| const hit::Node & | getRoot () const |
| const CheckState * | queryCheckState () const |
| CheckState * | queryCheckState () |
| const MooseApp * | queryCheckApp () const |
| MooseApp * | queryCheckApp () |
| const Parser * | queryCheckParser () const |
| Parser * | queryCheckParser () |
Private Attributes | |
| MooseApp & | _moose_app |
| _moose_app - reference to parent application that owns this server More... | |
| std::map< std::string, CheckState > | _check_state |
| _check_state - map from document paths to state (parser, app, text) More... | |
| std::shared_ptr< wasp::lsp::IOStreamConnection > | _connection |
| _connection - shared pointer to this server's read / write iostream More... | |
| std::map< std::string, std::set< std::string > > | _syntax_to_subblocks |
| _syntax_to_subblocks - map of syntax paths to valid subblocks More... | |
| std::map< std::string, std::set< std::string > > | _type_to_input_paths |
| _type_to_input_paths - map of parameter types to lookup paths More... | |
| std::map< std::string, std::set< std::string > > | _input_path_to_types |
| _type_to_input_paths - map of lookup paths to parameter types More... | |
| std::size_t | _formatting_tab_size |
| _formatting_tab_size - number of indent spaces for formatting More... | |
Definition at line 29 of file MooseServer.h.
|
private |
SortedLocationNodes - type alias for set of nodes sorted by location.
Definition at line 48 of file MooseServer.h.
| MooseServer::MooseServer | ( | MooseApp & | moose_app | ) |
Definition at line 39 of file MooseServer.C.
|
virtualdefault |
|
private |
Add set of nodes sorted by location to definition or reference list.
| defsOrRefsLocations | - data array of locations objects to fill |
| location_nodes | - set of nodes that have locations to be added |
Definition at line 1171 of file MooseServer.C.
Referenced by gatherDocumentDefinitionLocations(), and gatherDocumentReferencesLocations().
|
private |
Add parameters that were previously gathered to list for completion.
| completionItems | - list of completion objects to be filled out |
| valid_params | - all valid parameters to add to completion list |
| existing_params | - set of parameters already existing in input |
| replace_line_beg | - start line of autocompletion replace range |
| replace_char_beg | - start column of autocomplete replace range |
| replace_line_end | - end line of autocomplete replacement range |
| replace_char_end | - end column of autocompletion replace range |
| filtering_prefix | - beginning text to filter list if not empty |
Definition at line 635 of file MooseServer.C.
Referenced by gatherDocumentCompletionItems().
|
private |
Add paths from includes and FileName parameters for client to watch.
Definition at line 249 of file MooseServer.C.
Referenced by parseDocumentForDiagnostics().
|
private |
Add subblocks to completion list for request path, line, and column.
| completionItems | - list of completion objects to be filled out |
| object_path | - full node path where autocomplete was requested |
| replace_line_beg | - start line of autocompletion replace range |
| replace_char_beg | - start column of autocomplete replace range |
| replace_line_end | - end line of autocomplete replacement range |
| replace_char_end | - end column of autocompletion replace range |
| filtering_prefix | - beginning text to filter list if not empty |
Definition at line 745 of file MooseServer.C.
Referenced by gatherDocumentCompletionItems().
|
private |
Add parameter values to completion list for request line and column.
| completionItems | - list of completion objects to be filled out |
| valid_params | - all valid parameters used for value completion |
| existing_params | - set of parameters already existing in input |
| existing_subblocks | - active and inactive subblock name values |
| param_name | - name of input parameter for value autocompletion |
| obj_act_tasks | - tasks to verify object type with valid syntax |
| object_path | - full node path where autocomplete was requested |
| replace_line_beg | - start line of autocompletion replace range |
| replace_char_beg | - start column of autocomplete replace range |
| replace_line_end | - end line of autocomplete replacement range |
| replace_char_end | - end column of autocompletion replace range |
Definition at line 847 of file MooseServer.C.
Referenced by gatherDocumentCompletionItems().
|
private |
Build CustomPlot graph with provided keys, values, and plot title.
| plot_object | - CustomPlot object to be built into line graph |
| plot_title | - title for plot composed of block name and type |
| graph_keys | - abscissa values from function for graph x-axis |
| graph_vals | - ordinate values from function for graph y-axis |
Definition at line 1799 of file MooseServer.C.
Referenced by gatherPlottingResponses().
|
inlineprivate |
Read from connection into object - specific to this server's connection.
| object | - reference to object to be read into |
Definition at line 372 of file MooseServer.h.
|
inlineprivate |
Write object json to connection - specific to this server's connection.
| object | - reference to object with contents to write to connection |
Definition at line 379 of file MooseServer.h.
|
private |
Recursively walk down whole nodeview tree while formatting document.
| parent | - nodeview for recursive tree traversal starting point |
| prev_line | - line of last print for blanks and inline comments |
| level | - current level in document tree to use for indentation |
Definition at line 1450 of file MooseServer.C.
Referenced by gatherDocumentFormattingTextEdits().
|
private |
Gather document completion items - specific to this server implemention.
| completionItems | - data array of completion item objects to fill |
| is_incomplete | - flag indicating if the completions are complete |
| line | - line to be used for completions gathering logic |
| character | - column to be used for completions gathering logic |
Definition at line 348 of file MooseServer.C.
|
private |
Gather definition locations - specific to this server implemention.
| definitionLocations | - data array of locations objects to fill |
| line | - line to be used for locations gathering logic |
| character | - column to be used for locations gathering logic |
Definition at line 1020 of file MooseServer.C.
|
private |
Gather formatting text edits - specific to this server implemention.
| formattingTextEdits | - data array of text edit objects to fill |
| tab_size | - value of the size of a tab in spaces for formatting |
| insert_spaces | - flag indicating whether to use spaces for tabs |
Definition at line 1401 of file MooseServer.C.
|
private |
Gather references locations - specific to this server implemention.
| referencesLocations | - data array of locations objects to fill |
| line | - line to be used for locations gathering logic |
| character | - column to be used for locations gathering logic |
| include_declaration | - flag indicating declaration inclusion |
Definition at line 1282 of file MooseServer.C.
|
private |
Gather document symbols - specific to this server implemention.
| documentSymbols | - data array of symbols data objects to fill |
Definition at line 1516 of file MooseServer.C.
|
private |
Gather extension responses - specific to this server implemention.
| extensionResponses | - data array of custom responses to fill |
| extensionMethod | - name for current extension request method |
| line | - zero-based line to use for logic of custom extension |
| character | - zero-based column for logic of custom extension |
Definition at line 1723 of file MooseServer.C.
|
private |
Build CustomPlot extension responses when method name is plotting.
| plottingResponses | - array to fill with CustomPlot responses |
| line | - zero-based line to use for logic of custom extension |
| character | - zero-based column for logic of custom extension |
Definition at line 1736 of file MooseServer.C.
Referenced by gatherExtensionResponses().
|
private |
Get all action parameters using requested object path to collection.
| valid_params | - collection for filling action input parameters |
| object_path | - full node path where autocomplete was requested |
| obj_act_tasks | - set for adding in all MooseObjectAction tasks |
Definition at line 537 of file MooseServer.C.
Referenced by getAllValidParameters().
|
private |
Get all global parameters, action parameters, and object parameters.
| valid_params | - collection to fill with valid input parameters |
| object_path | - full node path where autocomplete was requested |
| object_type | - type of object where autocomplete was requested |
| obj_act_tasks | - set for adding in all MooseObjectAction tasks |
Definition at line 525 of file MooseServer.C.
Referenced by gatherDocumentCompletionItems(), gatherDocumentDefinitionLocations(), getFileNameTypeValues(), getHoverDisplayText(), getNodesByValueAndTypes(), and getRequiredParamsText().
|
private |
Definition at line 1908 of file MooseServer.C.
Referenced by parseDocumentForDiagnostics().
|
private |
Get completion item kind value that client may use for icon in list.
| valid_params | - valid parameters used for completion item kind |
| param_name | - name of input parameter for completion item kind |
| clean_type | - type to decide if reference completion item kind |
| is_param | - boolean denoting if kind is for parameter or value |
Definition at line 1624 of file MooseServer.C.
Referenced by addParametersToList(), and addValuesToList().
|
inline |
Get read / write connection - specific to this server implemention.
Definition at line 40 of file MooseServer.h.
|
private |
Get document symbol kind value that client may use for outline icon.
| symbol_node | - node that will be added to symbol tree for kind |
Definition at line 1655 of file MooseServer.C.
Referenced by gatherDocumentSymbols(), and traverseParseTreeAndFillSymbols().
|
private |
Fill map of all options and descriptions if parameter is moose enum.
| moose_enum_param | - parameter to get documentation and options |
| options_and_descs | - map to fill with options and descriptions |
Definition at line 1008 of file MooseServer.C.
Referenced by addValuesToList(), and getHoverDisplayText().
|
private |
Get names of parameters and subblocks specified in given input node.
| parent_node | - object node context under which to gather input |
| existing_params | - set to fill with parameter names from input |
| existing_subblocks | - set to fill with subblock names in input |
Definition at line 507 of file MooseServer.C.
Referenced by gatherDocumentCompletionItems().
|
private |
Recursively walk input to gather all FileName type parameter values.
| filename_vals | - set to fill up with FileName parameter values |
| parent | - nodeview for recursive tree traversal starting point |
Definition at line 292 of file MooseServer.C.
Referenced by addResourcesForDocument().
|
private |
Get hover display text - logic specific to this server implemention.
| display_text | - string reference to add hover text for display |
| line | - zero-based line to use for finding node and hover text |
| character | - zero-based column for finding node and hover text |
Definition at line 1198 of file MooseServer.C.
|
private |
Get set of nodes from associated path lookups matching value string.
| location_nodes | - set to fill with lookup nodes matching value |
| clean_type | - cpp type string used for key finding input paths |
| val_string | - specified value used for gathering input lookups |
Definition at line 1125 of file MooseServer.C.
Referenced by gatherDocumentDefinitionLocations().
|
private |
Recursively walk input to gather all nodes matching value and types.
| match_nodes | - set to fill with nodes matching value and types |
| view_parent | - nodeview used to start recursive tree traversal |
| target_value | - |
| target_types | - |
Definition at line 1356 of file MooseServer.C.
Referenced by gatherDocumentReferencesLocations().
|
private |
Get all object parameters using requested object path to collection.
| valid_params | - collection for filling object input parameters |
| object_type | - type of object where autocomplete was requested |
| obj_act_tasks | - tasks to verify object type with valid syntax |
Definition at line 582 of file MooseServer.C.
Referenced by getAllValidParameters().
|
private |
Get required parameter completion text list for given subblock path.
| subblock_path | - subblock path for finding required parameters |
| subblock_type | - subblock type for finding required parameters |
| existing_params | - set of parameters already existing in input |
| indent_spaces | - indentation to be added before each parameter |
Definition at line 1693 of file MooseServer.C.
Referenced by addSubblocksToList(), and addValuesToList().
|
private |
Definition at line 1921 of file MooseServer.C.
Referenced by addValuesToList(), and getInputLookupDefinitionNodes().
|
private |
Parse document for diagnostics - specific to this server implemention.
| diagnosticsList | - data array of diagnostics data objects to fill |
Definition at line 57 of file MooseServer.C.
|
private |
Definition at line 1894 of file MooseServer.C.
Referenced by gatherPlottingResponses(), getCheckApp(), and queryRoot().
|
private |
Definition at line 1902 of file MooseServer.C.
|
private |
Definition at line 1881 of file MooseServer.C.
Referenced by getCheckApp(), and queryRoot().
|
private |
Definition at line 1888 of file MooseServer.C.
|
private |
Definition at line 1868 of file MooseServer.C.
Referenced by queryCheckApp(), and queryCheckParser().
|
private |
Definition at line 1875 of file MooseServer.C.
|
private |
Definition at line 1852 of file MooseServer.C.
Referenced by addResourcesForDocument(), gatherDocumentCompletionItems(), gatherDocumentDefinitionLocations(), gatherDocumentReferencesLocations(), gatherDocumentSymbols(), gatherPlottingResponses(), getHoverDisplayText(), and getRoot().
|
private |
Will be true if the app is valid, the root is not nullptr, and the root node view is not null
|
private |
Recursively fill document symbols from the given node.
| view_parent | - nodeview used in recursive tree traversal |
| data_parent | - data object with array of symbol children |
Definition at line 1572 of file MooseServer.C.
Referenced by gatherDocumentSymbols().
|
private |
_check_state - map from document paths to state (parser, app, text)
Definition at line 442 of file MooseServer.h.
Referenced by parseDocumentForDiagnostics(), and queryCheckState().
|
private |
_connection - shared pointer to this server's read / write iostream
Definition at line 447 of file MooseServer.h.
Referenced by connectionRead(), connectionWrite(), and getConnection().
|
private |
_formatting_tab_size - number of indent spaces for formatting
Definition at line 467 of file MooseServer.h.
Referenced by formatDocument(), and gatherDocumentFormattingTextEdits().
|
private |
_type_to_input_paths - map of lookup paths to parameter types
Definition at line 462 of file MooseServer.h.
Referenced by gatherDocumentReferencesLocations().
|
private |
_moose_app - reference to parent application that owns this server
Definition at line 437 of file MooseServer.h.
Referenced by addSubblocksToList(), addValuesToList(), gatherDocumentDefinitionLocations(), gatherDocumentReferencesLocations(), getActionParameters(), getCompletionItemKind(), getHoverDisplayText(), getInputLookupDefinitionNodes(), getObjectParameters(), and parseDocumentForDiagnostics().
|
private |
_syntax_to_subblocks - map of syntax paths to valid subblocks
Definition at line 452 of file MooseServer.h.
Referenced by addSubblocksToList().
|
private |
_type_to_input_paths - map of parameter types to lookup paths
Definition at line 457 of file MooseServer.h.
Referenced by addValuesToList(), and getInputLookupDefinitionNodes().
1.8.14