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>
66 lines
3.2 KiB
Text
66 lines
3.2 KiB
Text
{"textDocument": {"uri": "file:///hoverDot.lean"},
|
|
"position": {"line": 8, "character": 11}}
|
|
{"range":
|
|
{"start": {"line": 8, "character": 7}, "end": {"line": 8, "character": 14}},
|
|
"contents": {"value": "```lean\nFoo.foo : Foo\n```", "kind": "markdown"}}
|
|
{"textDocument": {"uri": "file:///hoverDot.lean"},
|
|
"position": {"line": 12, "character": 7}}
|
|
{"range":
|
|
{"start": {"line": 12, "character": 7}, "end": {"line": 12, "character": 10}},
|
|
"contents": {"value": "```lean\nFoo.foo : Foo\n```", "kind": "markdown"}}
|
|
{"textDocument": {"uri": "file:///hoverDot.lean"},
|
|
"position": {"line": 12, "character": 11}}
|
|
{"range":
|
|
{"start": {"line": 12, "character": 11}, "end": {"line": 12, "character": 13}},
|
|
"contents":
|
|
{"value": "```lean\nFoo.f₁ (self : Foo) : Nat\n```", "kind": "markdown"}}
|
|
{"textDocument": {"uri": "file:///hoverDot.lean"},
|
|
"position": {"line": 12, "character": 14}}
|
|
{"range":
|
|
{"start": {"line": 12, "character": 14}, "end": {"line": 12, "character": 18}},
|
|
"contents":
|
|
{"value":
|
|
"```lean\nNat.succ (n : Nat) : Nat\n```\n***\nThe successor function on natural numbers, `succ n = n + 1`.\nThis is one of the two constructors of `Nat`. \n***\n*import Init.Prelude*",
|
|
"kind": "markdown"}}
|
|
{"textDocument": {"uri": "file:///hoverDot.lean"},
|
|
"position": {"line": 16, "character": 11}}
|
|
{"range":
|
|
{"start": {"line": 16, "character": 11}, "end": {"line": 16, "character": 13}},
|
|
"contents":
|
|
{"value": "```lean\nFoo.f₂ (f : Foo) : Nat\n```", "kind": "markdown"}}
|
|
{"textDocument": {"uri": "file:///hoverDot.lean"},
|
|
"position": {"line": 16, "character": 14}}
|
|
{"range":
|
|
{"start": {"line": 16, "character": 14}, "end": {"line": 16, "character": 18}},
|
|
"contents":
|
|
{"value":
|
|
"```lean\nNat.succ (n : Nat) : Nat\n```\n***\nThe successor function on natural numbers, `succ n = n + 1`.\nThis is one of the two constructors of `Nat`. \n***\n*import Init.Prelude*",
|
|
"kind": "markdown"}}
|
|
{"textDocument": {"uri": "file:///hoverDot.lean"},
|
|
"position": {"line": 19, "character": 13}}
|
|
{"range":
|
|
{"start": {"line": 19, "character": 13}, "end": {"line": 19, "character": 15}},
|
|
"contents":
|
|
{"value": "```lean\nFoo.f₂ (f : Foo) : Nat\n```", "kind": "markdown"}}
|
|
{"textDocument": {"uri": "file:///hoverDot.lean"},
|
|
"position": {"line": 19, "character": 16}}
|
|
{"range":
|
|
{"start": {"line": 19, "character": 16}, "end": {"line": 19, "character": 20}},
|
|
"contents":
|
|
{"value":
|
|
"```lean\nNat.succ (n : Nat) : Nat\n```\n***\nThe successor function on natural numbers, `succ n = n + 1`.\nThis is one of the two constructors of `Nat`. \n***\n*import Init.Prelude*",
|
|
"kind": "markdown"}}
|
|
{"textDocument": {"uri": "file:///hoverDot.lean"},
|
|
"position": {"line": 22, "character": 14}}
|
|
{"range":
|
|
{"start": {"line": 22, "character": 14}, "end": {"line": 22, "character": 16}},
|
|
"contents":
|
|
{"value": "```lean\nFoo.f₂ (f : Foo) : Nat\n```", "kind": "markdown"}}
|
|
{"textDocument": {"uri": "file:///hoverDot.lean"},
|
|
"position": {"line": 22, "character": 17}}
|
|
{"range":
|
|
{"start": {"line": 22, "character": 17}, "end": {"line": 22, "character": 21}},
|
|
"contents":
|
|
{"value":
|
|
"```lean\nNat.succ (n : Nat) : Nat\n```\n***\nThe successor function on natural numbers, `succ n = n + 1`.\nThis is one of the two constructors of `Nat`. \n***\n*import Init.Prelude*",
|
|
"kind": "markdown"}}
|