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>
48 lines
3.4 KiB
Text
48 lines
3.4 KiB
Text
{"textDocument": {"uri": "file:///catHover.lean"},
|
|
"position": {"line": 4, "character": 33}}
|
|
{"range":
|
|
{"start": {"line": 4, "character": 32}, "end": {"line": 4, "character": 36}},
|
|
"contents":
|
|
{"value":
|
|
"```lean\nLean.Parser.Category.term : Lean.Parser.Category\n```\n***\n`term` is the builtin syntax category for terms. A term denotes an expression\nin lean's type theory, for example `2 + 2` is a term. The difference between\n`Term` and `Expr` is that the former is a kind of syntax, while the latter is\nthe result of elaboration. For example `by simp` is also a `Term`, but it elaborates\nto different `Expr`s depending on the context. \n***\n*import Init.Notation*",
|
|
"kind": "markdown"}}
|
|
{"textDocument": {"uri": "file:///catHover.lean"},
|
|
"position": {"line": 4, "character": 14}}
|
|
{"range":
|
|
{"start": {"line": 4, "character": 14}, "end": {"line": 4, "character": 18}},
|
|
"contents":
|
|
{"value":
|
|
"```lean\nLean.Parser.Category.term : Lean.Parser.Category\n```\n***\n`term` is the builtin syntax category for terms. A term denotes an expression\nin lean's type theory, for example `2 + 2` is a term. The difference between\n`Term` and `Expr` is that the former is a kind of syntax, while the latter is\nthe result of elaboration. For example `by simp` is also a `Term`, but it elaborates\nto different `Expr`s depending on the context. \n***\n*import Init.Notation*",
|
|
"kind": "markdown"}}
|
|
{"textDocument": {"uri": "file:///catHover.lean"},
|
|
"position": {"line": 4, "character": 25}}
|
|
{"range":
|
|
{"start": {"line": 4, "character": 24}, "end": {"line": 4, "character": 29}},
|
|
"contents":
|
|
{"value":
|
|
"```lean\nLean.Parser.Category.index : Lean.Parser.Category\n```\n***\nIndex syntax categoy ",
|
|
"kind": "markdown"}}
|
|
{"textDocument": {"uri": "file:///catHover.lean"},
|
|
"position": {"line": 12, "character": 16}}
|
|
{"range":
|
|
{"start": {"line": 12, "character": 14}, "end": {"line": 12, "character": 19}},
|
|
"contents":
|
|
{"value":
|
|
"```lean\nLean.Parser.Category.value : Lean.Parser.Category\n```\n***\nValue syntax category ",
|
|
"kind": "markdown"}}
|
|
{"textDocument": {"uri": "file:///catHover.lean"},
|
|
"position": {"line": 17, "character": 15}}
|
|
{"range":
|
|
{"start": {"line": 17, "character": 15}, "end": {"line": 17, "character": 19}},
|
|
"contents":
|
|
{"value":
|
|
"```lean\nLean.Parser.Category.term : Lean.Parser.Category\n```\n***\n`term` is the builtin syntax category for terms. A term denotes an expression\nin lean's type theory, for example `2 + 2` is a term. The difference between\n`Term` and `Expr` is that the former is a kind of syntax, while the latter is\nthe result of elaboration. For example `by simp` is also a `Term`, but it elaborates\nto different `Expr`s depending on the context. \n***\n*import Init.Notation*",
|
|
"kind": "markdown"}}
|
|
{"textDocument": {"uri": "file:///catHover.lean"},
|
|
"position": {"line": 20, "character": 9}}
|
|
{"range":
|
|
{"start": {"line": 20, "character": 7}, "end": {"line": 20, "character": 11}},
|
|
"contents":
|
|
{"value":
|
|
"```lean\nLean.Parser.Category.term : Lean.Parser.Category\n```\n***\n`term` is the builtin syntax category for terms. A term denotes an expression\nin lean's type theory, for example `2 + 2` is a term. The difference between\n`Term` and `Expr` is that the former is a kind of syntax, while the latter is\nthe result of elaboration. For example `by simp` is also a `Term`, but it elaborates\nto different `Expr`s depending on the context. \n***\n*import Init.Notation*",
|
|
"kind": "markdown"}}
|