This PR fixes a bug where tactic auto-completion would produce tactic completion items in the entire trailing whitespace of an empty tactic block. Since #13229 further restricted top-level `by` blocks to be indentation- sensitive, this PR adjusts the logic to only display completion items at a "proper" indentation level. Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
405 lines
18 KiB
Text
405 lines
18 KiB
Text
{"textDocument": {"uri": "file:///completionEmptyByBracketed.lean"},
|
|
"position": {"line": 33, "character": 4}}
|
|
{"items":
|
|
[{"label": "open",
|
|
"kind": 14,
|
|
"documentation":
|
|
{"value":
|
|
"`open Foo in tacs` (the tactic) acts like `open Foo` at command level,\nbut it opens a namespace only within the tactics `tacs`. ",
|
|
"kind": "markdown"},
|
|
"data": ["file:///completionEmptyByBracketed.lean", 33, 4, 0]},
|
|
{"label": "match",
|
|
"kind": 14,
|
|
"documentation":
|
|
{"value":
|
|
"`match` performs case analysis on one or more expressions.\nSee [Induction and Recursion][tpil4].\nThe syntax for the `match` tactic is the same as term-mode `match`, except that\nthe match arms are tactics instead of expressions.\n```\nexample (n : Nat) : n = n := by\n match n with\n | 0 => rfl\n | i+1 => simp\n```\n\n[tpil4]: https://lean-lang.org/theorem_proving_in_lean4/induction_and_recursion.html\n",
|
|
"kind": "markdown"},
|
|
"data": ["file:///completionEmptyByBracketed.lean", 33, 4, 0]},
|
|
{"label": "set_option",
|
|
"kind": 14,
|
|
"documentation":
|
|
{"value":
|
|
"`set_option opt val in tacs` (the tactic) acts like `set_option opt val` at the command level,\nbut it sets the option only within the tactics `tacs`. ",
|
|
"kind": "markdown"},
|
|
"data": ["file:///completionEmptyByBracketed.lean", 33, 4, 0]},
|
|
{"label": "skip",
|
|
"kind": 14,
|
|
"documentation": {"value": "A docstring ", "kind": "markdown"},
|
|
"data": ["file:///completionEmptyByBracketed.lean", 33, 4, 0]},
|
|
{"label": "refine",
|
|
"kind": 14,
|
|
"documentation": {"value": "A docstring ", "kind": "markdown"},
|
|
"data": ["file:///completionEmptyByBracketed.lean", 33, 4, 0]},
|
|
{"label": "ident",
|
|
"kind": 14,
|
|
"data": ["file:///completionEmptyByBracketed.lean", 33, 4, 0]},
|
|
{"label": "intro",
|
|
"kind": 14,
|
|
"data": ["file:///completionEmptyByBracketed.lean", 33, 4, 0]}],
|
|
"isIncomplete": true}
|
|
Resolution of open:
|
|
{"label": "open",
|
|
"kind": 14,
|
|
"documentation":
|
|
{"value":
|
|
"`open Foo in tacs` (the tactic) acts like `open Foo` at command level,\nbut it opens a namespace only within the tactics `tacs`. ",
|
|
"kind": "markdown"},
|
|
"data": ["file:///completionEmptyByBracketed.lean", 33, 4, 0]}
|
|
Resolution of match:
|
|
{"label": "match",
|
|
"kind": 14,
|
|
"documentation":
|
|
{"value":
|
|
"`match` performs case analysis on one or more expressions.\nSee [Induction and Recursion][tpil4].\nThe syntax for the `match` tactic is the same as term-mode `match`, except that\nthe match arms are tactics instead of expressions.\n```\nexample (n : Nat) : n = n := by\n match n with\n | 0 => rfl\n | i+1 => simp\n```\n\n[tpil4]: https://lean-lang.org/theorem_proving_in_lean4/induction_and_recursion.html\n",
|
|
"kind": "markdown"},
|
|
"data": ["file:///completionEmptyByBracketed.lean", 33, 4, 0]}
|
|
Resolution of set_option:
|
|
{"label": "set_option",
|
|
"kind": 14,
|
|
"documentation":
|
|
{"value":
|
|
"`set_option opt val in tacs` (the tactic) acts like `set_option opt val` at the command level,\nbut it sets the option only within the tactics `tacs`. ",
|
|
"kind": "markdown"},
|
|
"data": ["file:///completionEmptyByBracketed.lean", 33, 4, 0]}
|
|
Resolution of skip:
|
|
{"label": "skip",
|
|
"kind": 14,
|
|
"documentation": {"value": "A docstring ", "kind": "markdown"},
|
|
"data": ["file:///completionEmptyByBracketed.lean", 33, 4, 0]}
|
|
Resolution of refine:
|
|
{"label": "refine",
|
|
"kind": 14,
|
|
"documentation": {"value": "A docstring ", "kind": "markdown"},
|
|
"data": ["file:///completionEmptyByBracketed.lean", 33, 4, 0]}
|
|
Resolution of ident:
|
|
{"label": "ident",
|
|
"kind": 14,
|
|
"data": ["file:///completionEmptyByBracketed.lean", 33, 4, 0]}
|
|
Resolution of intro:
|
|
{"label": "intro",
|
|
"kind": 14,
|
|
"data": ["file:///completionEmptyByBracketed.lean", 33, 4, 0]}
|
|
{"textDocument": {"uri": "file:///completionEmptyByBracketed.lean"},
|
|
"position": {"line": 40, "character": 6}}
|
|
{"items":
|
|
[{"label": "open",
|
|
"kind": 14,
|
|
"documentation":
|
|
{"value":
|
|
"`open Foo in tacs` (the tactic) acts like `open Foo` at command level,\nbut it opens a namespace only within the tactics `tacs`. ",
|
|
"kind": "markdown"},
|
|
"data": ["file:///completionEmptyByBracketed.lean", 40, 6, 0]},
|
|
{"label": "match",
|
|
"kind": 14,
|
|
"documentation":
|
|
{"value":
|
|
"`match` performs case analysis on one or more expressions.\nSee [Induction and Recursion][tpil4].\nThe syntax for the `match` tactic is the same as term-mode `match`, except that\nthe match arms are tactics instead of expressions.\n```\nexample (n : Nat) : n = n := by\n match n with\n | 0 => rfl\n | i+1 => simp\n```\n\n[tpil4]: https://lean-lang.org/theorem_proving_in_lean4/induction_and_recursion.html\n",
|
|
"kind": "markdown"},
|
|
"data": ["file:///completionEmptyByBracketed.lean", 40, 6, 0]},
|
|
{"label": "set_option",
|
|
"kind": 14,
|
|
"documentation":
|
|
{"value":
|
|
"`set_option opt val in tacs` (the tactic) acts like `set_option opt val` at the command level,\nbut it sets the option only within the tactics `tacs`. ",
|
|
"kind": "markdown"},
|
|
"data": ["file:///completionEmptyByBracketed.lean", 40, 6, 0]},
|
|
{"label": "skip",
|
|
"kind": 14,
|
|
"documentation": {"value": "A docstring ", "kind": "markdown"},
|
|
"data": ["file:///completionEmptyByBracketed.lean", 40, 6, 0]},
|
|
{"label": "refine",
|
|
"kind": 14,
|
|
"documentation": {"value": "A docstring ", "kind": "markdown"},
|
|
"data": ["file:///completionEmptyByBracketed.lean", 40, 6, 0]},
|
|
{"label": "ident",
|
|
"kind": 14,
|
|
"data": ["file:///completionEmptyByBracketed.lean", 40, 6, 0]},
|
|
{"label": "intro",
|
|
"kind": 14,
|
|
"data": ["file:///completionEmptyByBracketed.lean", 40, 6, 0]}],
|
|
"isIncomplete": true}
|
|
Resolution of open:
|
|
{"label": "open",
|
|
"kind": 14,
|
|
"documentation":
|
|
{"value":
|
|
"`open Foo in tacs` (the tactic) acts like `open Foo` at command level,\nbut it opens a namespace only within the tactics `tacs`. ",
|
|
"kind": "markdown"},
|
|
"data": ["file:///completionEmptyByBracketed.lean", 40, 6, 0]}
|
|
Resolution of match:
|
|
{"label": "match",
|
|
"kind": 14,
|
|
"documentation":
|
|
{"value":
|
|
"`match` performs case analysis on one or more expressions.\nSee [Induction and Recursion][tpil4].\nThe syntax for the `match` tactic is the same as term-mode `match`, except that\nthe match arms are tactics instead of expressions.\n```\nexample (n : Nat) : n = n := by\n match n with\n | 0 => rfl\n | i+1 => simp\n```\n\n[tpil4]: https://lean-lang.org/theorem_proving_in_lean4/induction_and_recursion.html\n",
|
|
"kind": "markdown"},
|
|
"data": ["file:///completionEmptyByBracketed.lean", 40, 6, 0]}
|
|
Resolution of set_option:
|
|
{"label": "set_option",
|
|
"kind": 14,
|
|
"documentation":
|
|
{"value":
|
|
"`set_option opt val in tacs` (the tactic) acts like `set_option opt val` at the command level,\nbut it sets the option only within the tactics `tacs`. ",
|
|
"kind": "markdown"},
|
|
"data": ["file:///completionEmptyByBracketed.lean", 40, 6, 0]}
|
|
Resolution of skip:
|
|
{"label": "skip",
|
|
"kind": 14,
|
|
"documentation": {"value": "A docstring ", "kind": "markdown"},
|
|
"data": ["file:///completionEmptyByBracketed.lean", 40, 6, 0]}
|
|
Resolution of refine:
|
|
{"label": "refine",
|
|
"kind": 14,
|
|
"documentation": {"value": "A docstring ", "kind": "markdown"},
|
|
"data": ["file:///completionEmptyByBracketed.lean", 40, 6, 0]}
|
|
Resolution of ident:
|
|
{"label": "ident",
|
|
"kind": 14,
|
|
"data": ["file:///completionEmptyByBracketed.lean", 40, 6, 0]}
|
|
Resolution of intro:
|
|
{"label": "intro",
|
|
"kind": 14,
|
|
"data": ["file:///completionEmptyByBracketed.lean", 40, 6, 0]}
|
|
{"textDocument": {"uri": "file:///completionEmptyByBracketed.lean"},
|
|
"position": {"line": 47, "character": 0}}
|
|
{"items":
|
|
[{"label": "open",
|
|
"kind": 14,
|
|
"documentation":
|
|
{"value":
|
|
"`open Foo in tacs` (the tactic) acts like `open Foo` at command level,\nbut it opens a namespace only within the tactics `tacs`. ",
|
|
"kind": "markdown"},
|
|
"data": ["file:///completionEmptyByBracketed.lean", 47, 0, 0]},
|
|
{"label": "match",
|
|
"kind": 14,
|
|
"documentation":
|
|
{"value":
|
|
"`match` performs case analysis on one or more expressions.\nSee [Induction and Recursion][tpil4].\nThe syntax for the `match` tactic is the same as term-mode `match`, except that\nthe match arms are tactics instead of expressions.\n```\nexample (n : Nat) : n = n := by\n match n with\n | 0 => rfl\n | i+1 => simp\n```\n\n[tpil4]: https://lean-lang.org/theorem_proving_in_lean4/induction_and_recursion.html\n",
|
|
"kind": "markdown"},
|
|
"data": ["file:///completionEmptyByBracketed.lean", 47, 0, 0]},
|
|
{"label": "set_option",
|
|
"kind": 14,
|
|
"documentation":
|
|
{"value":
|
|
"`set_option opt val in tacs` (the tactic) acts like `set_option opt val` at the command level,\nbut it sets the option only within the tactics `tacs`. ",
|
|
"kind": "markdown"},
|
|
"data": ["file:///completionEmptyByBracketed.lean", 47, 0, 0]},
|
|
{"label": "skip",
|
|
"kind": 14,
|
|
"documentation": {"value": "A docstring ", "kind": "markdown"},
|
|
"data": ["file:///completionEmptyByBracketed.lean", 47, 0, 0]},
|
|
{"label": "refine",
|
|
"kind": 14,
|
|
"documentation": {"value": "A docstring ", "kind": "markdown"},
|
|
"data": ["file:///completionEmptyByBracketed.lean", 47, 0, 0]},
|
|
{"label": "ident",
|
|
"kind": 14,
|
|
"data": ["file:///completionEmptyByBracketed.lean", 47, 0, 0]},
|
|
{"label": "intro",
|
|
"kind": 14,
|
|
"data": ["file:///completionEmptyByBracketed.lean", 47, 0, 0]}],
|
|
"isIncomplete": true}
|
|
Resolution of open:
|
|
{"label": "open",
|
|
"kind": 14,
|
|
"documentation":
|
|
{"value":
|
|
"`open Foo in tacs` (the tactic) acts like `open Foo` at command level,\nbut it opens a namespace only within the tactics `tacs`. ",
|
|
"kind": "markdown"},
|
|
"data": ["file:///completionEmptyByBracketed.lean", 47, 0, 0]}
|
|
Resolution of match:
|
|
{"label": "match",
|
|
"kind": 14,
|
|
"documentation":
|
|
{"value":
|
|
"`match` performs case analysis on one or more expressions.\nSee [Induction and Recursion][tpil4].\nThe syntax for the `match` tactic is the same as term-mode `match`, except that\nthe match arms are tactics instead of expressions.\n```\nexample (n : Nat) : n = n := by\n match n with\n | 0 => rfl\n | i+1 => simp\n```\n\n[tpil4]: https://lean-lang.org/theorem_proving_in_lean4/induction_and_recursion.html\n",
|
|
"kind": "markdown"},
|
|
"data": ["file:///completionEmptyByBracketed.lean", 47, 0, 0]}
|
|
Resolution of set_option:
|
|
{"label": "set_option",
|
|
"kind": 14,
|
|
"documentation":
|
|
{"value":
|
|
"`set_option opt val in tacs` (the tactic) acts like `set_option opt val` at the command level,\nbut it sets the option only within the tactics `tacs`. ",
|
|
"kind": "markdown"},
|
|
"data": ["file:///completionEmptyByBracketed.lean", 47, 0, 0]}
|
|
Resolution of skip:
|
|
{"label": "skip",
|
|
"kind": 14,
|
|
"documentation": {"value": "A docstring ", "kind": "markdown"},
|
|
"data": ["file:///completionEmptyByBracketed.lean", 47, 0, 0]}
|
|
Resolution of refine:
|
|
{"label": "refine",
|
|
"kind": 14,
|
|
"documentation": {"value": "A docstring ", "kind": "markdown"},
|
|
"data": ["file:///completionEmptyByBracketed.lean", 47, 0, 0]}
|
|
Resolution of ident:
|
|
{"label": "ident",
|
|
"kind": 14,
|
|
"data": ["file:///completionEmptyByBracketed.lean", 47, 0, 0]}
|
|
Resolution of intro:
|
|
{"label": "intro",
|
|
"kind": 14,
|
|
"data": ["file:///completionEmptyByBracketed.lean", 47, 0, 0]}
|
|
{"textDocument": {"uri": "file:///completionEmptyByBracketed.lean"},
|
|
"position": {"line": 54, "character": 4}}
|
|
{"items":
|
|
[{"label": "open",
|
|
"kind": 14,
|
|
"documentation":
|
|
{"value":
|
|
"`open Foo in tacs` (the tactic) acts like `open Foo` at command level,\nbut it opens a namespace only within the tactics `tacs`. ",
|
|
"kind": "markdown"},
|
|
"data": ["file:///completionEmptyByBracketed.lean", 54, 4, 0]},
|
|
{"label": "match",
|
|
"kind": 14,
|
|
"documentation":
|
|
{"value":
|
|
"`match` performs case analysis on one or more expressions.\nSee [Induction and Recursion][tpil4].\nThe syntax for the `match` tactic is the same as term-mode `match`, except that\nthe match arms are tactics instead of expressions.\n```\nexample (n : Nat) : n = n := by\n match n with\n | 0 => rfl\n | i+1 => simp\n```\n\n[tpil4]: https://lean-lang.org/theorem_proving_in_lean4/induction_and_recursion.html\n",
|
|
"kind": "markdown"},
|
|
"data": ["file:///completionEmptyByBracketed.lean", 54, 4, 0]},
|
|
{"label": "set_option",
|
|
"kind": 14,
|
|
"documentation":
|
|
{"value":
|
|
"`set_option opt val in tacs` (the tactic) acts like `set_option opt val` at the command level,\nbut it sets the option only within the tactics `tacs`. ",
|
|
"kind": "markdown"},
|
|
"data": ["file:///completionEmptyByBracketed.lean", 54, 4, 0]},
|
|
{"label": "skip",
|
|
"kind": 14,
|
|
"documentation": {"value": "A docstring ", "kind": "markdown"},
|
|
"data": ["file:///completionEmptyByBracketed.lean", 54, 4, 0]},
|
|
{"label": "refine",
|
|
"kind": 14,
|
|
"documentation": {"value": "A docstring ", "kind": "markdown"},
|
|
"data": ["file:///completionEmptyByBracketed.lean", 54, 4, 0]},
|
|
{"label": "ident",
|
|
"kind": 14,
|
|
"data": ["file:///completionEmptyByBracketed.lean", 54, 4, 0]},
|
|
{"label": "intro",
|
|
"kind": 14,
|
|
"data": ["file:///completionEmptyByBracketed.lean", 54, 4, 0]}],
|
|
"isIncomplete": true}
|
|
Resolution of open:
|
|
{"label": "open",
|
|
"kind": 14,
|
|
"documentation":
|
|
{"value":
|
|
"`open Foo in tacs` (the tactic) acts like `open Foo` at command level,\nbut it opens a namespace only within the tactics `tacs`. ",
|
|
"kind": "markdown"},
|
|
"data": ["file:///completionEmptyByBracketed.lean", 54, 4, 0]}
|
|
Resolution of match:
|
|
{"label": "match",
|
|
"kind": 14,
|
|
"documentation":
|
|
{"value":
|
|
"`match` performs case analysis on one or more expressions.\nSee [Induction and Recursion][tpil4].\nThe syntax for the `match` tactic is the same as term-mode `match`, except that\nthe match arms are tactics instead of expressions.\n```\nexample (n : Nat) : n = n := by\n match n with\n | 0 => rfl\n | i+1 => simp\n```\n\n[tpil4]: https://lean-lang.org/theorem_proving_in_lean4/induction_and_recursion.html\n",
|
|
"kind": "markdown"},
|
|
"data": ["file:///completionEmptyByBracketed.lean", 54, 4, 0]}
|
|
Resolution of set_option:
|
|
{"label": "set_option",
|
|
"kind": 14,
|
|
"documentation":
|
|
{"value":
|
|
"`set_option opt val in tacs` (the tactic) acts like `set_option opt val` at the command level,\nbut it sets the option only within the tactics `tacs`. ",
|
|
"kind": "markdown"},
|
|
"data": ["file:///completionEmptyByBracketed.lean", 54, 4, 0]}
|
|
Resolution of skip:
|
|
{"label": "skip",
|
|
"kind": 14,
|
|
"documentation": {"value": "A docstring ", "kind": "markdown"},
|
|
"data": ["file:///completionEmptyByBracketed.lean", 54, 4, 0]}
|
|
Resolution of refine:
|
|
{"label": "refine",
|
|
"kind": 14,
|
|
"documentation": {"value": "A docstring ", "kind": "markdown"},
|
|
"data": ["file:///completionEmptyByBracketed.lean", 54, 4, 0]}
|
|
Resolution of ident:
|
|
{"label": "ident",
|
|
"kind": 14,
|
|
"data": ["file:///completionEmptyByBracketed.lean", 54, 4, 0]}
|
|
Resolution of intro:
|
|
{"label": "intro",
|
|
"kind": 14,
|
|
"data": ["file:///completionEmptyByBracketed.lean", 54, 4, 0]}
|
|
{"textDocument": {"uri": "file:///completionEmptyByBracketed.lean"},
|
|
"position": {"line": 60, "character": 2}}
|
|
{"items":
|
|
[{"label": "open",
|
|
"kind": 14,
|
|
"documentation":
|
|
{"value":
|
|
"`open Foo in tacs` (the tactic) acts like `open Foo` at command level,\nbut it opens a namespace only within the tactics `tacs`. ",
|
|
"kind": "markdown"},
|
|
"data": ["file:///completionEmptyByBracketed.lean", 60, 2, 0]},
|
|
{"label": "match",
|
|
"kind": 14,
|
|
"documentation":
|
|
{"value":
|
|
"`match` performs case analysis on one or more expressions.\nSee [Induction and Recursion][tpil4].\nThe syntax for the `match` tactic is the same as term-mode `match`, except that\nthe match arms are tactics instead of expressions.\n```\nexample (n : Nat) : n = n := by\n match n with\n | 0 => rfl\n | i+1 => simp\n```\n\n[tpil4]: https://lean-lang.org/theorem_proving_in_lean4/induction_and_recursion.html\n",
|
|
"kind": "markdown"},
|
|
"data": ["file:///completionEmptyByBracketed.lean", 60, 2, 0]},
|
|
{"label": "set_option",
|
|
"kind": 14,
|
|
"documentation":
|
|
{"value":
|
|
"`set_option opt val in tacs` (the tactic) acts like `set_option opt val` at the command level,\nbut it sets the option only within the tactics `tacs`. ",
|
|
"kind": "markdown"},
|
|
"data": ["file:///completionEmptyByBracketed.lean", 60, 2, 0]},
|
|
{"label": "skip",
|
|
"kind": 14,
|
|
"documentation": {"value": "A docstring ", "kind": "markdown"},
|
|
"data": ["file:///completionEmptyByBracketed.lean", 60, 2, 0]},
|
|
{"label": "refine",
|
|
"kind": 14,
|
|
"documentation": {"value": "A docstring ", "kind": "markdown"},
|
|
"data": ["file:///completionEmptyByBracketed.lean", 60, 2, 0]},
|
|
{"label": "ident",
|
|
"kind": 14,
|
|
"data": ["file:///completionEmptyByBracketed.lean", 60, 2, 0]},
|
|
{"label": "intro",
|
|
"kind": 14,
|
|
"data": ["file:///completionEmptyByBracketed.lean", 60, 2, 0]}],
|
|
"isIncomplete": true}
|
|
Resolution of open:
|
|
{"label": "open",
|
|
"kind": 14,
|
|
"documentation":
|
|
{"value":
|
|
"`open Foo in tacs` (the tactic) acts like `open Foo` at command level,\nbut it opens a namespace only within the tactics `tacs`. ",
|
|
"kind": "markdown"},
|
|
"data": ["file:///completionEmptyByBracketed.lean", 60, 2, 0]}
|
|
Resolution of match:
|
|
{"label": "match",
|
|
"kind": 14,
|
|
"documentation":
|
|
{"value":
|
|
"`match` performs case analysis on one or more expressions.\nSee [Induction and Recursion][tpil4].\nThe syntax for the `match` tactic is the same as term-mode `match`, except that\nthe match arms are tactics instead of expressions.\n```\nexample (n : Nat) : n = n := by\n match n with\n | 0 => rfl\n | i+1 => simp\n```\n\n[tpil4]: https://lean-lang.org/theorem_proving_in_lean4/induction_and_recursion.html\n",
|
|
"kind": "markdown"},
|
|
"data": ["file:///completionEmptyByBracketed.lean", 60, 2, 0]}
|
|
Resolution of set_option:
|
|
{"label": "set_option",
|
|
"kind": 14,
|
|
"documentation":
|
|
{"value":
|
|
"`set_option opt val in tacs` (the tactic) acts like `set_option opt val` at the command level,\nbut it sets the option only within the tactics `tacs`. ",
|
|
"kind": "markdown"},
|
|
"data": ["file:///completionEmptyByBracketed.lean", 60, 2, 0]}
|
|
Resolution of skip:
|
|
{"label": "skip",
|
|
"kind": 14,
|
|
"documentation": {"value": "A docstring ", "kind": "markdown"},
|
|
"data": ["file:///completionEmptyByBracketed.lean", 60, 2, 0]}
|
|
Resolution of refine:
|
|
{"label": "refine",
|
|
"kind": 14,
|
|
"documentation": {"value": "A docstring ", "kind": "markdown"},
|
|
"data": ["file:///completionEmptyByBracketed.lean", 60, 2, 0]}
|
|
Resolution of ident:
|
|
{"label": "ident",
|
|
"kind": 14,
|
|
"data": ["file:///completionEmptyByBracketed.lean", 60, 2, 0]}
|
|
Resolution of intro:
|
|
{"label": "intro",
|
|
"kind": 14,
|
|
"data": ["file:///completionEmptyByBracketed.lean", 60, 2, 0]}
|