You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-15 13:51:40 +00:00
Omit quotes from completion if triggered with quote
Typing a single or double quote in an external editor triggers auto-completion. The returned CompletionItem should not include quotes since they're already in the editor. CompletionParams was missing context in to_json() and this is required to detect whether a quote was typed.
This commit is contained in:
@@ -1429,6 +1429,17 @@ struct CompletionParams : public TextDocumentPositionParams {
|
||||
TextDocumentPositionParams::load(p_params);
|
||||
context.load(p_params["context"]);
|
||||
}
|
||||
|
||||
Dictionary to_json() {
|
||||
Dictionary ctx;
|
||||
ctx["triggerCharacter"] = context.triggerCharacter;
|
||||
ctx["triggerKind"] = context.triggerKind;
|
||||
|
||||
Dictionary dict;
|
||||
dict = TextDocumentPositionParams::to_json();
|
||||
dict["context"] = ctx;
|
||||
return dict;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user