This PR adds per-package server options to resolve #2455. It is based on the previous work in #2456, but takes a different approach: options are loaded for the specific file in the file worker when `print-paths` is called, instead of loading them in the watchdog with a separate Lake command. This change addresses review comments made in #2456. In doing so, it introduces two new Lake config fields: - `leanOptions`: `-D` flag options that are passed to both the language server and `lean` when building. - `moreServerOptions`: `-D` flag options that are passed to the language server. Since `print-paths` must also accept a file path to compute the options for that file, this PR is changing the API for `print-paths`. As there have been numerous complaints about the name `print-paths`, I also decided to change it to `setup-file` in this PR, since it would break compatibility with the old Lake API anyways. This PR deprecates the Lakefile field `moreServerArgs` in favor of `moreGlobalServerArgs`, as suggested in the review for #2456. Fixes #2455 --------- Co-authored-by: digama0 <mcarneir@andrew.cmu.edu>
50 lines
3.8 KiB
Text
50 lines
3.8 KiB
Text
{"textDocument": {"uri": "file:///lean3HoverIssue.lean"},
|
||
"position": {"line": 0, "character": 55}}
|
||
{"range":
|
||
{"start": {"line": 0, "character": 54}, "end": {"line": 0, "character": 58}},
|
||
"contents":
|
||
{"value":
|
||
"```lean\nEq.symm.{u} {α : Sort u} {a b : α} (h : a = b) : b = a\n```\n***\nEquality is symmetric: if `a = b` then `b = a`.\n\nBecause this is in the `Eq` namespace, if you have a variable `h : a = b`,\n`h.symm` can be used as shorthand for `Eq.symm h` as a proof of `b = a`.\n\nFor more information: [Equality](https://lean-lang.org/theorem_proving_in_lean4/quantifiers_and_equality.html#equality)\n\n***\n*import Init.Prelude*",
|
||
"kind": "markdown"}}
|
||
{"textDocument": {"uri": "file:///lean3HoverIssue.lean"},
|
||
"position": {"line": 0, "character": 52}}
|
||
{"range":
|
||
{"start": {"line": 0, "character": 52}, "end": {"line": 0, "character": 53}},
|
||
"contents": {"value": "```lean\nh : x = y\n```", "kind": "markdown"}}
|
||
{"textDocument": {"uri": "file:///lean3HoverIssue.lean"},
|
||
"position": {"line": 4, "character": 46}}
|
||
{"range":
|
||
{"start": {"line": 4, "character": 45}, "end": {"line": 4, "character": 49}},
|
||
"contents":
|
||
{"value":
|
||
"```lean\nEq.symm.{u} {α : Sort u} {a b : α} (h : a = b) : b = a\n```\n***\nEquality is symmetric: if `a = b` then `b = a`.\n\nBecause this is in the `Eq` namespace, if you have a variable `h : a = b`,\n`h.symm` can be used as shorthand for `Eq.symm h` as a proof of `b = a`.\n\nFor more information: [Equality](https://lean-lang.org/theorem_proving_in_lean4/quantifiers_and_equality.html#equality)\n\n***\n*import Init.Prelude*",
|
||
"kind": "markdown"}}
|
||
{"textDocument": {"uri": "file:///lean3HoverIssue.lean"},
|
||
"position": {"line": 7, "character": 54}}
|
||
{"range":
|
||
{"start": {"line": 7, "character": 53}, "end": {"line": 7, "character": 60}},
|
||
"contents":
|
||
{"value":
|
||
"```lean\nEq.symm.{u} {α : Sort u} {a b : α} (h : a = b) : b = a\n```\n***\nEquality is symmetric: if `a = b` then `b = a`.\n\nBecause this is in the `Eq` namespace, if you have a variable `h : a = b`,\n`h.symm` can be used as shorthand for `Eq.symm h` as a proof of `b = a`.\n\nFor more information: [Equality](https://lean-lang.org/theorem_proving_in_lean4/quantifiers_and_equality.html#equality)\n\n***\n*import Init.Prelude*",
|
||
"kind": "markdown"}}
|
||
{"textDocument": {"uri": "file:///lean3HoverIssue.lean"},
|
||
"position": {"line": 7, "character": 65}}
|
||
{"range":
|
||
{"start": {"line": 7, "character": 62}, "end": {"line": 7, "character": 69}},
|
||
"contents":
|
||
{"value":
|
||
"```lean\nEq.symm.{u} {α : Sort u} {a b : α} (h : a = b) : b = a\n```\n***\nEquality is symmetric: if `a = b` then `b = a`.\n\nBecause this is in the `Eq` namespace, if you have a variable `h : a = b`,\n`h.symm` can be used as shorthand for `Eq.symm h` as a proof of `b = a`.\n\nFor more information: [Equality](https://lean-lang.org/theorem_proving_in_lean4/quantifiers_and_equality.html#equality)\n\n***\n*import Init.Prelude*",
|
||
"kind": "markdown"}}
|
||
{"textDocument": {"uri": "file:///lean3HoverIssue.lean"},
|
||
"position": {"line": 7, "character": 70}}
|
||
{"range":
|
||
{"start": {"line": 7, "character": 70}, "end": {"line": 7, "character": 71}},
|
||
"contents": {"value": "```lean\nh : x = y\n```", "kind": "markdown"}}
|
||
{"textDocument": {"uri": "file:///lean3HoverIssue.lean"},
|
||
"position": {"line": 7, "character": 72}}
|
||
{"range":
|
||
{"start": {"line": 7, "character": 72}, "end": {"line": 7, "character": 76}},
|
||
"contents":
|
||
{"value":
|
||
"```lean\nEq.symm.{u} {α : Sort u} {a b : α} (h : a = b) : b = a\n```\n***\nEquality is symmetric: if `a = b` then `b = a`.\n\nBecause this is in the `Eq` namespace, if you have a variable `h : a = b`,\n`h.symm` can be used as shorthand for `Eq.symm h` as a proof of `b = a`.\n\nFor more information: [Equality](https://lean-lang.org/theorem_proving_in_lean4/quantifiers_and_equality.html#equality)\n\n***\n*import Init.Prelude*",
|
||
"kind": "markdown"}}
|