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
2 KiB
Text
48 lines
2 KiB
Text
{"textDocument": {"uri": "file:///1265.lean"},
|
||
"position": {"line": 0, "character": 51}}
|
||
{"items":
|
||
[{"label": "getHygieneInfo",
|
||
"kind": 3,
|
||
"detail": "Lean.HygieneInfo → Lean.Name"},
|
||
{"label": "getId", "kind": 3, "detail": "Lean.Ident → Lean.Name"},
|
||
{"label": "getName", "kind": 3, "detail": "Lean.NameLit → Lean.Name"},
|
||
{"label": "expandInterpolatedStr",
|
||
"kind": 3,
|
||
"detail":
|
||
"Lean.TSyntax Lean.interpolatedStrKind → Lean.Term → Lean.Term → Lean.MacroM Lean.Term"},
|
||
{"label": "getChar", "kind": 3, "detail": "Lean.CharLit → Char"},
|
||
{"label": "getNat", "kind": 3, "detail": "Lean.NumLit → Nat"},
|
||
{"label": "getScientific",
|
||
"kind": 3,
|
||
"detail": "Lean.ScientificLit → Nat × Bool × Nat"},
|
||
{"label": "getString", "kind": 3, "detail": "Lean.StrLit → String"},
|
||
{"label": "raw",
|
||
"kind": 5,
|
||
"documentation":
|
||
{"value": "The underlying `Syntax` value. ", "kind": "markdown"},
|
||
"detail": "Lean.TSyntax ks → Lean.Syntax"}],
|
||
"isIncomplete": true}
|
||
{"textDocument": {"uri": "file:///1265.lean"},
|
||
"position": {"line": 2, "character": 53}}
|
||
{"items":
|
||
[{"label": "getHygieneInfo",
|
||
"kind": 3,
|
||
"detail": "Lean.HygieneInfo → Lean.Name"},
|
||
{"label": "getId", "kind": 3, "detail": "Lean.Ident → Lean.Name"},
|
||
{"label": "getName", "kind": 3, "detail": "Lean.NameLit → Lean.Name"},
|
||
{"label": "expandInterpolatedStr",
|
||
"kind": 3,
|
||
"detail":
|
||
"Lean.TSyntax Lean.interpolatedStrKind → Lean.Term → Lean.Term → Lean.MacroM Lean.Term"},
|
||
{"label": "getChar", "kind": 3, "detail": "Lean.CharLit → Char"},
|
||
{"label": "getNat", "kind": 3, "detail": "Lean.NumLit → Nat"},
|
||
{"label": "getScientific",
|
||
"kind": 3,
|
||
"detail": "Lean.ScientificLit → Nat × Bool × Nat"},
|
||
{"label": "getString", "kind": 3, "detail": "Lean.StrLit → String"},
|
||
{"label": "raw",
|
||
"kind": 5,
|
||
"documentation":
|
||
{"value": "The underlying `Syntax` value. ", "kind": "markdown"},
|
||
"detail": "Lean.TSyntax ks → Lean.Syntax"}],
|
||
"isIncomplete": true}
|