Skip to content

Commit

Permalink
Revert "remove non-standard title in executeCommand"
Browse files Browse the repository at this point in the history
This reverts commit 06bd5b5.
  • Loading branch information
lieryan committed Mar 11, 2024
1 parent c2eabbe commit 10b379e
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions pylsp_rope/refactoring.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ def get_code_action(self, title: str) -> typing.CodeAction:
"title": title,
"kind": self.kind,
"command": {
"title": title,
"command": self.name,
"arguments": [self.arguments],
},
Expand Down
1 change: 1 addition & 0 deletions pylsp_rope/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class Command(TypedDict):


class CodeAction(TypedDict):
title: str
kind: Optional[CodeActionKind]
# diagnostics: Optional[List[Diagnostic]]
# isPreferred: Optional[bool]
Expand Down
8 changes: 8 additions & 0 deletions test/test_extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def test_extract_variable(config, workspace, code_action_context):
"title": "Extract variable",
"kind": "refactor.extract",
"command": {
"title": "Extract variable",
"command": commands.COMMAND_REFACTOR_EXTRACT_VARIABLE,
"arguments": [
{
Expand Down Expand Up @@ -79,6 +80,7 @@ def test_extract_variable_with_similar(config, workspace, code_action_context):
"title": "Extract variable including similar statements",
"kind": "refactor.extract",
"command": {
"title": "Extract variable including similar statements",
"command": commands.COMMAND_REFACTOR_EXTRACT_VARIABLE,
"arguments": [
{
Expand Down Expand Up @@ -133,6 +135,7 @@ def test_extract_global_variable(config, workspace, code_action_context):
"title": "Extract global variable",
"kind": "refactor.extract",
"command": {
"title": "Extract global variable",
"command": commands.COMMAND_REFACTOR_EXTRACT_VARIABLE,
"arguments": [
{
Expand Down Expand Up @@ -188,6 +191,7 @@ def test_extract_global_variable_with_similar(config, workspace, code_action_con
"title": "Extract global variable including similar statements",
"kind": "refactor.extract",
"command": {
"title": "Extract global variable including similar statements",
"command": commands.COMMAND_REFACTOR_EXTRACT_VARIABLE,
"arguments": [
{
Expand Down Expand Up @@ -262,6 +266,7 @@ def test_extract_method(config, workspace, code_action_context):
"title": "Extract method",
"kind": "refactor.extract",
"command": {
"title": "Extract method",
"command": commands.COMMAND_REFACTOR_EXTRACT_METHOD,
"arguments": [
{
Expand Down Expand Up @@ -312,6 +317,7 @@ def test_extract_method_with_similar(config, workspace, code_action_context):
"title": "Extract method including similar statements",
"kind": "refactor.extract",
"command": {
"title": "Extract method including similar statements",
"command": commands.COMMAND_REFACTOR_EXTRACT_METHOD,
"arguments": [
{
Expand Down Expand Up @@ -367,6 +373,7 @@ def test_extract_global_method(config, workspace, code_action_context):
"title": "Extract global method",
"kind": "refactor.extract",
"command": {
"title": "Extract global method",
"command": commands.COMMAND_REFACTOR_EXTRACT_METHOD,
"arguments": [
{
Expand Down Expand Up @@ -423,6 +430,7 @@ def test_extract_method_global_with_similar(config, workspace, code_action_conte
"title": "Extract global method including similar statements",
"kind": "refactor.extract",
"command": {
"title": "Extract global method including similar statements",
"command": commands.COMMAND_REFACTOR_EXTRACT_METHOD,
"arguments": [
{
Expand Down
3 changes: 3 additions & 0 deletions test/test_generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ def test_generate_variable(config, workspace, code_action_context):
"title": "Generate variable",
"kind": "quickfix",
"command": {
"title": "Generate variable",
"command": commands.COMMAND_GENERATE_CODE,
"arguments": [
{
Expand Down Expand Up @@ -71,6 +72,7 @@ def test_generate_function(config, workspace, code_action_context):
"title": "Generate function",
"kind": "quickfix",
"command": {
"title": "Generate function",
"command": commands.COMMAND_GENERATE_CODE,
"arguments": [
{
Expand Down Expand Up @@ -120,6 +122,7 @@ def test_generate_class(config, workspace, code_action_context):
"title": "Generate class",
"kind": "quickfix",
"command": {
"title": "Generate class",
"command": commands.COMMAND_GENERATE_CODE,
"arguments": [
{
Expand Down
1 change: 1 addition & 0 deletions test/test_import_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def test_organize_import(config, workspace, document, code_action_context):
"title": "Organize import",
"kind": "source.organizeImports",
"command": {
"title": "Organize import",
"command": commands.COMMAND_SOURCE_ORGANIZE_IMPORT,
"arguments": [
{
Expand Down
1 change: 1 addition & 0 deletions test/test_inline.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def test_inline(config, workspace, code_action_context):
"title": "Inline method/variable/parameter",
"kind": "refactor.inline",
"command": {
"title": "Inline method/variable/parameter",
"command": commands.COMMAND_REFACTOR_INLINE,
"arguments": [
{
Expand Down
1 change: 1 addition & 0 deletions test/test_introduce_parameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def test_introduce_parameter(config, workspace, code_action_context):
"title": "Introduce parameter",
"kind": "refactor",
"command": {
"title": "Introduce parameter",
"command": commands.COMMAND_INTRODUCE_PARAMETER,
"arguments": [
{
Expand Down
1 change: 1 addition & 0 deletions test/test_local_to_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def test_local_to_field(config, workspace, code_action_context):
"title": "Convert local variable to field",
"kind": "refactor.rewrite",
"command": {
"title": "Convert local variable to field",
"command": commands.COMMAND_REFACTOR_LOCAL_TO_FIELD,
"arguments": [
{
Expand Down
1 change: 1 addition & 0 deletions test/test_method_to_method_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def test_method_to_method_object(config, workspace, code_action_context):
"title": "To method object",
"kind": "refactor.rewrite",
"command": {
"title": "To method object",
"command": commands.COMMAND_REFACTOR_METHOD_TO_METHOD_OBJECT,
"arguments": [
{
Expand Down
2 changes: 2 additions & 0 deletions test/test_usefunction.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def test_use_function_globally(config, workspace, code_action_context):
"title": "Use function",
"kind": "refactor",
"command": {
"title": "Use function",
"command": commands.COMMAND_REFACTOR_USE_FUNCTION,
"arguments": [
{
Expand Down Expand Up @@ -88,6 +89,7 @@ def test_use_function_in_current_file(config, workspace, code_action_context):
"title": "Use function for current file only",
"kind": "refactor",
"command": {
"title": "Use function for current file only",
"command": commands.COMMAND_REFACTOR_USE_FUNCTION,
"arguments": [
{
Expand Down

0 comments on commit 10b379e

Please sign in to comment.