13 #include "wasplsp/LSP.h" 14 #include "wasplsp/ServerImpl.h" 15 #include "wasplsp/Connection.h" 16 #include "libmesh/ignore_warnings.h" 17 #include "wasplsp/IOStreamConnection.h" 18 #include "libmesh/restore_warnings.h" 19 #include "waspcore/Object.h" 20 #include "wasphit/HITNodeView.h" 21 #include "waspsiren/SIRENInterpreter.h" 22 #include "waspsiren/SIRENResultSet.h" 46 std::set<wasp::HITNodeView,
47 std::function<bool(const wasp::HITNodeView &, const wasp::HITNodeView &)>>;
93 std::set<std::string> & existing_params,
94 std::set<std::string> & existing_subblocks);
104 const std::string & object_path,
105 const std::string & object_type,
106 std::set<std::string> & obj_act_tasks);
115 const std::string & object_path,
116 std::set<std::string> & obj_act_tasks);
125 std::string object_type,
126 const std::set<std::string> & obj_act_tasks);
142 const std::set<std::string> & existing_params,
143 int replace_line_beg,
144 int replace_char_beg,
145 int replace_line_end,
146 int replace_char_end,
147 const std::string & filtering_prefix);
161 const std::string & object_path,
162 int replace_line_beg,
163 int replace_char_beg,
164 int replace_line_end,
165 int replace_char_end,
166 const std::string & filtering_prefix,
167 bool request_on_block_decl);
186 const std::set<std::string> & existing_params,
187 const std::set<std::string> & existing_subblocks,
188 const std::string & param_name,
189 const std::set<std::string> & obj_act_tasks,
190 const std::string & object_path,
191 int replace_line_beg,
192 int replace_char_beg,
193 int replace_line_end,
194 int replace_char_end);
201 template <
typename MooseEnumType>
203 std::map<std::string, std::string> & options_and_descs);
222 const std::string & clean_type,
223 const std::string & val_string);
254 bool include_declaration);
264 wasp::HITNodeView view_parent,
265 const std::string & target_value,
266 const std::set<std::string> & target_types);
286 std::string
formatDocument(wasp::HITNodeView parent, std::size_t & prev_line, std::size_t level);
302 wasp::DataObject & data_parent);
313 const std::string & param_name,
314 const std::string & clean_type,
333 const std::string & subblock_type,
334 const std::set<std::string> & existing_params,
335 const std::string & indent_spaces);
int getDocumentSymbolKind(wasp::HITNodeView symbol_node)
Get document symbol kind value that client may use for outline icon.
std::map< std::string, std::set< std::string > > _type_to_input_paths
_type_to_input_paths - map of parameter types to lookup paths
std::shared_ptr< MooseApp > getCheckApp() const
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.
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.
std::map< std::string, std::set< std::string > > _input_path_to_types
_type_to_input_paths - map of lookup paths to parameter types
const std::string & getDocumentText() const
MooseServer(MooseApp &moose_app)
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.
bool gatherDocumentSymbols(wasp::DataArray &documentSymbols)
Gather document symbols - specific to this server implemention.
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.
Base class for MOOSE-based applications.
bool getHoverDisplayText(std::string &display_text, int line, int character)
Get hover display text - logic specific to this server implemention.
bool updateDocumentTextChanges(const std::string &replacement_text, int start_line, int start_character, int end_line, int end_character, int range_length)
Update document text changes - specific to this server implemention.
std::set< wasp::HITNodeView, std::function< bool(const wasp::HITNodeView &, const wasp::HITNodeView &)> > SortedLocationNodes
SortedLocationNodes - type alias for set of nodes sorted by location.
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.
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.
std::shared_ptr< wasp::lsp::Connection > getConnection()
Get read / write connection - specific to this server implemention.
std::shared_ptr< wasp::lsp::IOStreamConnection > _connection
_connection - shared pointer to this server's read / write iostream
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.
bool gatherDocumentFormattingTextEdits(wasp::DataArray &formattingTextEdits, int tab_size, bool insert_spaces)
Gather formatting text edits - specific to this server implemention.
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.
bool traverseParseTreeAndFillSymbols(wasp::HITNodeView view_parent, wasp::DataObject &data_parent)
Recursively fill document symbols from the given node.
MooseApp & _moose_app
_moose_app - reference to parent application that owns this server
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.
bool gatherDocumentCompletionItems(wasp::DataArray &completionItems, bool &is_incomplete, int line, int character)
Gather document completion items - specific to this server implemention.
bool gatherDocumentReferencesLocations(wasp::DataArray &referencesLocations, int line, int character, bool include_declaration)
Gather references locations - specific to this server implemention.
std::size_t _formatting_tab_size
_formatting_tab_size - number of indent spaces for formatting
bool connectionRead(wasp::DataObject &object)
Read from connection into object - specific to this server's connection.
bool parseDocumentForDiagnostics(wasp::DataArray &diagnosticsList)
Parse document for diagnostics - specific to this server implemention.
bool gatherDocumentDefinitionLocations(wasp::DataArray &definitionLocations, int line, int character)
Gather definition locations - specific to this server implemention.
std::map< std::string, std::string > _path_to_text
_path_to_text - map of document paths to current text strings
bool addLocationNodesToList(wasp::DataArray &defsOrRefsLocations, const SortedLocationNodes &location_nodes)
Add set of nodes sorted by location to definition or reference list.
bool connectionWrite(wasp::DataObject &object)
Write object json to connection - specific to this server's connection.
std::map< std::string, std::set< std::string > > _syntax_to_subblocks
_syntax_to_subblocks - map of syntax paths to valid subblocks
virtual ~MooseServer()=default
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.
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.
std::string formatDocument(wasp::HITNodeView parent, std::size_t &prev_line, std::size_t level)
Recursively walk down whole nodeview tree while formatting document.
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.
std::map< std::string, std::shared_ptr< MooseApp > > _check_apps
_check_apps - map from document paths to input check applications