#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... | |
| MooseApp & | getCheckApp () |
| Public interface for writable check app reference with error checks. More... | |
| void | setDistPlotNumPoints (std::size_t num_points) |
| Override number of discrete points in continuous distribution plots. 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... | |
| void | addObjectsFromWarehouses (const std::string ¶m_type, std::map< std::string, std::string > &options_and_descs) |
| Supplement completion list with objects in warehouses if applicable. 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 &plotting_responses, int line, int character) |
| Build CustomPlot extension responses when method name is plotting. More... | |
| void | buildFuncPlotResponse (wasp::DataArray &plotting_responses, FEProblemBase &problem, const std::string &object_name, const std::string &object_type) |
| Gather function data, build CustomPlot object, and add to responses. More... | |
| void | buildDistPlotResponses (wasp::DataArray &plotting_responses, FEProblemBase &problem, const std::string &object_name, const std::string &object_type) |
| Compute PDF and CDF, build CustomPlot objects, and add to responses. More... | |
| void | buildLineGraphPlot (wasp::CustomPlot &plot_object, const std::string &plot_title, const std::string &x_axis_label, const std::string &y_axis_label, 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 |
| 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... | |
| std::size_t | _dist_plot_num_points |
| _dist_plot_num_points - distribution plot sampling resolution More... | |
| double | _dist_plot_quantile_bound |
| _dist_plot_quantile_bound - epsilon to bound plot range tails More... | |
Definition at line 29 of file MooseServer.h.
|
private |
SortedLocationNodes - type alias for set of nodes sorted by location.
Definition at line 61 of file MooseServer.h.
| MooseServer::MooseServer | ( | MooseApp & | moose_app | ) |
Definition at line 51 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 1261 of file MooseServer.C.
Referenced by gatherDocumentDefinitionLocations(), and gatherDocumentReferencesLocations().
|
private |
Supplement completion list with objects in warehouses if applicable.
| param_type | - parameter type string to pick suitable warehouse |
| options_and_descs | - map to fill with options and descriptions |
Definition at line 1039 of file MooseServer.C.
Referenced by addValuesToList().
|
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 649 of file MooseServer.C.
Referenced by gatherDocumentCompletionItems().
|
private |
Add paths from includes and FileName parameters for client to watch.
Definition at line 263 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 759 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 861 of file MooseServer.C.
Referenced by gatherDocumentCompletionItems().
|
private |
Compute PDF and CDF, build CustomPlot objects, and add to responses.
| plotting_responses | - array to be filled by CustomPlot objects |
| problem | - problem to query warehouses when building plot data |
| object_name | - name of request object to use for problem query |
| object_type | - type of request object to use in title for plot |
Definition at line 1922 of file MooseServer.C.
Referenced by gatherPlottingResponses().
|
private |
Gather function data, build CustomPlot object, and add to responses.
| plotting_responses | - array to be filled by CustomPlot objects |
| problem | - problem to query warehouses when building plot data |
| object_name | - name of request object to use for problem query |
| object_type | - type of request object to use in title for plot |
Definition at line 1890 of file MooseServer.C.
Referenced by gatherPlottingResponses().
|
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 |
| x_axis_label | - label for x-axis of plot dependent upon type |
| y_axis_label | - label for y-axis of plot dependent upon type |
| graph_keys | - x values of function or distribution for graph |
| graph_vals | - y values of function or distribution for graph |
Definition at line 1975 of file MooseServer.C.
Referenced by buildDistPlotResponses(), and buildFuncPlotResponse().
|
inlineprivate |
Read from connection into object - specific to this server's connection.
| object | - reference to object to be read into |
Definition at line 421 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 428 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 1559 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 362 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 1110 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 1510 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 1391 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 1626 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 1833 of file MooseServer.C.
|
private |
Build CustomPlot extension responses when method name is plotting.
| plotting_responses | - array for CustomPlot responses to fill |
| line | - zero-based line to use for logic of custom extension |
| character | - zero-based column for logic of custom extension |
Definition at line 1846 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 551 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 539 of file MooseServer.C.
Referenced by gatherDocumentCompletionItems(), gatherDocumentDefinitionLocations(), getFileNameTypeValues(), getHoverDisplayText(), getNodesByValueAndTypes(), and getRequiredParamsText().
| MooseApp & MooseServer::getCheckApp | ( | ) |
Public interface for writable check app reference with error checks.
Definition at line 2088 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 1734 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 1765 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 1027 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 521 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 306 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 1288 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 1215 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 1465 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 596 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 1803 of file MooseServer.C.
Referenced by addSubblocksToList(), and addValuesToList().
|
private |
Definition at line 2101 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 71 of file MooseServer.C.
|
private |
Definition at line 2074 of file MooseServer.C.
Referenced by addObjectsFromWarehouses(), gatherPlottingResponses(), getCheckApp(), and queryRoot().
|
private |
Definition at line 2082 of file MooseServer.C.
|
private |
Definition at line 2061 of file MooseServer.C.
Referenced by getCheckApp(), and queryRoot().
|
private |
Definition at line 2068 of file MooseServer.C.
|
private |
Definition at line 2048 of file MooseServer.C.
Referenced by queryCheckApp(), and queryCheckParser().
|
private |
Definition at line 2055 of file MooseServer.C.
|
private |
Definition at line 2032 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
|
inline |
Override number of discrete points in continuous distribution plots.
Used by plotting unit test to lower sampling resolution for testing.
| num_points | - number of discrete points for distribution plots |
Definition at line 53 of file MooseServer.h.
|
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 1682 of file MooseServer.C.
Referenced by gatherDocumentSymbols().
|
private |
_check_state - map from document paths to state (parser, app, text)
Definition at line 487 of file MooseServer.h.
Referenced by parseDocumentForDiagnostics(), and queryCheckState().
|
private |
_connection - shared pointer to this server's read / write iostream
Definition at line 492 of file MooseServer.h.
Referenced by connectionRead(), connectionWrite(), and getConnection().
|
private |
_dist_plot_num_points - distribution plot sampling resolution
Definition at line 517 of file MooseServer.h.
Referenced by buildDistPlotResponses(), and setDistPlotNumPoints().
|
private |
_dist_plot_quantile_bound - epsilon to bound plot range tails
Definition at line 522 of file MooseServer.h.
Referenced by buildDistPlotResponses().
|
private |
_formatting_tab_size - number of indent spaces for formatting
Definition at line 512 of file MooseServer.h.
Referenced by formatDocument(), and gatherDocumentFormattingTextEdits().
|
private |
_type_to_input_paths - map of lookup paths to parameter types
Definition at line 507 of file MooseServer.h.
Referenced by gatherDocumentReferencesLocations().
|
private |
_moose_app - reference to parent application that owns this server
Definition at line 482 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 497 of file MooseServer.h.
Referenced by addSubblocksToList().
|
private |
_type_to_input_paths - map of parameter types to lookup paths
Definition at line 502 of file MooseServer.h.
Referenced by addValuesToList(), and getInputLookupDefinitionNodes().
1.8.14