summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/language_server/gdscript_workspace.h
diff options
context:
space:
mode:
authorgeequlim <geequlim@gmail.com>2019-06-23 01:48:31 +0800
committergeequlim <geequlim@gmail.com>2019-08-11 13:30:15 +0800
commit37aafaaa9cc7d66c85fd9395e46b2386d899ba12 (patch)
tree2eef77e9c4ffe73e8de284567cf81dd6d5be642e /modules/gdscript/language_server/gdscript_workspace.h
parentf58560ac361fbe0fcc38df6a8f80818e55517aef (diff)
downloadredot-engine-37aafaaa9cc7d66c85fd9395e46b2386d899ba12.tar.gz
Add a symbol pool to cache all native symbols and workspackes symbols.
Implement hover Implement completion documentation resolve Implement hover documentation Implement go to definition
Diffstat (limited to 'modules/gdscript/language_server/gdscript_workspace.h')
-rw-r--r--modules/gdscript/language_server/gdscript_workspace.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/modules/gdscript/language_server/gdscript_workspace.h b/modules/gdscript/language_server/gdscript_workspace.h
index 02ddc7cd71..ebefd12587 100644
--- a/modules/gdscript/language_server/gdscript_workspace.h
+++ b/modules/gdscript/language_server/gdscript_workspace.h
@@ -42,6 +42,17 @@ class GDScriptWorkspace : public Reference {
protected:
static void _bind_methods();
void remove_cache_parser(const String &p_path);
+ bool initialized = false;
+ Map<StringName, lsp::DocumentSymbol> native_symbols;
+
+ const lsp::DocumentSymbol *get_native_symbol(const String &p_class, const String &p_member = "") const;
+ const lsp::DocumentSymbol *get_script_symbol(const String &p_path) const;
+
+ void reload_all_workspace_scripts();
+
+ void list_script_files(const String &p_root_dir, List<String> &r_files);
+ ExtendGDScriptParser *get_parse_successed_script(const String &p_path);
+ ExtendGDScriptParser *get_parse_result(const String &p_path);
public:
String root;
@@ -52,11 +63,15 @@ public:
Array symbol(const Dictionary &p_params);
public:
+ Error initialize();
Error parse_script(const String &p_path, const String &p_content);
+ Error parse_local_script(const String &p_path);
String get_file_path(const String &p_uri) const;
String get_file_uri(const String &p_path) const;
void publish_diagnostics(const String &p_path);
void completion(const lsp::CompletionParams &p_params, List<ScriptCodeCompletionOption> *r_options);
+ const lsp::DocumentSymbol *resolve_symbol(const lsp::TextDocumentPositionParams &p_doc_pos, const String &p_symbol_name = "", bool p_func_requred = false);
+ static String marked_documentation(const String &p_bbcode);
GDScriptWorkspace();
~GDScriptWorkspace();