mirror of
https://github.com/godotengine/godot.git
synced 2026-01-06 10:11:57 +03:00
Changed some code found by Clang Tidy and Coverity
This commit is contained in:
@@ -1399,9 +1399,6 @@ GDScriptParser::Node *GDScriptParser::_parse_expression(Node *p_parent, bool p_s
|
||||
unary = true;
|
||||
break;
|
||||
case OperatorNode::OP_NEG:
|
||||
priority = 1;
|
||||
unary = true;
|
||||
break;
|
||||
case OperatorNode::OP_POS:
|
||||
priority = 1;
|
||||
unary = true;
|
||||
|
||||
@@ -189,6 +189,7 @@ void ExtendGDScriptParser::parse_class_symbol(const GDScriptParser::ClassNode *p
|
||||
lsp::DocumentSymbol symbol;
|
||||
const GDScriptParser::ClassNode::Constant &c = E->value();
|
||||
const GDScriptParser::ConstantNode *node = dynamic_cast<const GDScriptParser::ConstantNode *>(c.expression);
|
||||
ERR_FAIL_COND(!node);
|
||||
symbol.name = E->key();
|
||||
symbol.kind = lsp::SymbolKind::Constant;
|
||||
symbol.deprecated = false;
|
||||
@@ -674,6 +675,7 @@ Dictionary ExtendGDScriptParser::dump_class_api(const GDScriptParser::ClassNode
|
||||
|
||||
const GDScriptParser::ClassNode::Constant &c = E->value();
|
||||
const GDScriptParser::ConstantNode *node = dynamic_cast<const GDScriptParser::ConstantNode *>(c.expression);
|
||||
ERR_FAIL_COND_V(!node, class_api);
|
||||
|
||||
Dictionary api;
|
||||
api["name"] = E->key();
|
||||
|
||||
@@ -100,9 +100,10 @@ Dictionary GDScriptLanguageProtocol::initialize(const Dictionary &p_params) {
|
||||
|
||||
String root_uri = p_params["rootUri"];
|
||||
String root = p_params["rootPath"];
|
||||
bool is_same_workspace = root == workspace->root;
|
||||
bool is_same_workspace;
|
||||
#ifndef WINDOWS_ENABLED
|
||||
is_same_workspace = root.to_lower() == workspace->root.to_lower();
|
||||
#ifdef WINDOWS_ENABLED
|
||||
#else
|
||||
is_same_workspace = root.replace("\\", "/").to_lower() == workspace->root.to_lower();
|
||||
#endif
|
||||
|
||||
@@ -142,6 +143,7 @@ void GDScriptLanguageProtocol::poll() {
|
||||
Error GDScriptLanguageProtocol::start(int p_port) {
|
||||
if (server == NULL) {
|
||||
server = dynamic_cast<WebSocketServer *>(ClassDB::instance("WebSocketServer"));
|
||||
ERR_FAIL_COND_V(!server, FAILED);
|
||||
server->set_buffers(8192, 1024, 8192, 1024); // 8mb should be way more than enough
|
||||
server->connect("data_received", this, "on_data_received");
|
||||
server->connect("client_connected", this, "on_client_connected");
|
||||
|
||||
@@ -380,8 +380,8 @@ GDScriptTextDocument::~GDScriptTextDocument() {
|
||||
memdelete(file_checker);
|
||||
}
|
||||
|
||||
void GDScriptTextDocument::sync_script_content(const String &p_uri, const String &p_content) {
|
||||
String path = GDScriptLanguageProtocol::get_singleton()->get_workspace()->get_file_path(p_uri);
|
||||
void GDScriptTextDocument::sync_script_content(const String &p_path, const String &p_content) {
|
||||
String path = GDScriptLanguageProtocol::get_singleton()->get_workspace()->get_file_path(p_path);
|
||||
GDScriptLanguageProtocol::get_singleton()->get_workspace()->parse_script(path, p_content);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user