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>
123 lines
4.2 KiB
Text
123 lines
4.2 KiB
Text
{"textDocument": {"uri": "file:///highlight.lean"},
|
|
"position": {"line": 1, "character": 23}}
|
|
[{"range":
|
|
{"start": {"line": 1, "character": 22}, "end": {"line": 1, "character": 26}},
|
|
"kind": 1}]
|
|
{"textDocument": {"uri": "file:///highlight.lean"},
|
|
"position": {"line": 5, "character": 7}}
|
|
[{"range":
|
|
{"start": {"line": 1, "character": 4}, "end": {"line": 1, "character": 8}},
|
|
"kind": 1},
|
|
{"range":
|
|
{"start": {"line": 4, "character": 6}, "end": {"line": 4, "character": 10}},
|
|
"kind": 1},
|
|
{"range":
|
|
{"start": {"line": 5, "character": 6}, "end": {"line": 5, "character": 10}},
|
|
"kind": 1}]
|
|
{"textDocument": {"uri": "file:///highlight.lean"},
|
|
"position": {"line": 10, "character": 3}}
|
|
[{"range":
|
|
{"start": {"line": 9, "character": 6}, "end": {"line": 9, "character": 9}},
|
|
"kind": 1},
|
|
{"range":
|
|
{"start": {"line": 10, "character": 2}, "end": {"line": 10, "character": 5}},
|
|
"kind": 1}]
|
|
{"textDocument": {"uri": "file:///highlight.lean"},
|
|
"position": {"line": 15, "character": 3}}
|
|
[{"range":
|
|
{"start": {"line": 15, "character": 2}, "end": {"line": 15, "character": 6}},
|
|
"kind": 1},
|
|
{"range":
|
|
{"start": {"line": 23, "character": 16},
|
|
"end": {"line": 23, "character": 20}},
|
|
"kind": 1}]
|
|
{"textDocument": {"uri": "file:///highlight.lean"},
|
|
"position": {"line": 19, "character": 7}}
|
|
[{"range":
|
|
{"start": {"line": 14, "character": 2}, "end": {"line": 14, "character": 5}},
|
|
"kind": 1},
|
|
{"range":
|
|
{"start": {"line": 19, "character": 6}, "end": {"line": 19, "character": 9}},
|
|
"kind": 1},
|
|
{"range":
|
|
{"start": {"line": 23, "character": 4}, "end": {"line": 23, "character": 7}},
|
|
"kind": 1}]
|
|
{"textDocument": {"uri": "file:///highlight.lean"},
|
|
"position": {"line": 23, "character": 5}}
|
|
[{"range":
|
|
{"start": {"line": 14, "character": 2}, "end": {"line": 14, "character": 5}},
|
|
"kind": 1},
|
|
{"range":
|
|
{"start": {"line": 19, "character": 6}, "end": {"line": 19, "character": 9}},
|
|
"kind": 1},
|
|
{"range":
|
|
{"start": {"line": 23, "character": 4}, "end": {"line": 23, "character": 7}},
|
|
"kind": 1}]
|
|
{"textDocument": {"uri": "file:///highlight.lean"},
|
|
"position": {"line": 23, "character": 12}}
|
|
[{"range":
|
|
{"start": {"line": 22, "character": 10},
|
|
"end": {"line": 22, "character": 13}},
|
|
"kind": 1},
|
|
{"range":
|
|
{"start": {"line": 23, "character": 11},
|
|
"end": {"line": 23, "character": 14}},
|
|
"kind": 1},
|
|
{"range":
|
|
{"start": {"line": 23, "character": 24},
|
|
"end": {"line": 23, "character": 27}},
|
|
"kind": 1}]
|
|
{"textDocument": {"uri": "file:///highlight.lean"},
|
|
"position": {"line": 30, "character": 2}}
|
|
[{"range":
|
|
{"start": {"line": 28, "character": 10},
|
|
"end": {"line": 28, "character": 11}},
|
|
"kind": 1},
|
|
{"range":
|
|
{"start": {"line": 29, "character": 2}, "end": {"line": 29, "character": 3}},
|
|
"kind": 1},
|
|
{"range":
|
|
{"start": {"line": 30, "character": 2}, "end": {"line": 30, "character": 3}},
|
|
"kind": 1}]
|
|
{"textDocument": {"uri": "file:///highlight.lean"},
|
|
"position": {"line": 41, "character": 7}}
|
|
[{"range":
|
|
{"start": {"line": 34, "character": 10},
|
|
"end": {"line": 34, "character": 11}},
|
|
"kind": 1},
|
|
{"range":
|
|
{"start": {"line": 36, "character": 4}, "end": {"line": 36, "character": 5}},
|
|
"kind": 1},
|
|
{"range":
|
|
{"start": {"line": 36, "character": 9}, "end": {"line": 36, "character": 10}},
|
|
"kind": 1},
|
|
{"range":
|
|
{"start": {"line": 38, "character": 4}, "end": {"line": 38, "character": 5}},
|
|
"kind": 1},
|
|
{"range":
|
|
{"start": {"line": 38, "character": 9}, "end": {"line": 38, "character": 10}},
|
|
"kind": 1},
|
|
{"range":
|
|
{"start": {"line": 40, "character": 11},
|
|
"end": {"line": 40, "character": 12}},
|
|
"kind": 1},
|
|
{"range":
|
|
{"start": {"line": 41, "character": 7}, "end": {"line": 41, "character": 8}},
|
|
"kind": 1}]
|
|
{"textDocument": {"uri": "file:///highlight.lean"},
|
|
"position": {"line": 48, "character": 9}}
|
|
[{"range":
|
|
{"start": {"line": 45, "character": 10},
|
|
"end": {"line": 45, "character": 11}},
|
|
"kind": 1},
|
|
{"range":
|
|
{"start": {"line": 47, "character": 4}, "end": {"line": 47, "character": 5}},
|
|
"kind": 1},
|
|
{"range":
|
|
{"start": {"line": 48, "character": 9}, "end": {"line": 48, "character": 10}},
|
|
"kind": 1}]
|
|
{"textDocument": {"uri": "file:///highlight.lean"},
|
|
"position": {"line": 53, "character": 9}}
|
|
[{"range":
|
|
{"start": {"line": 53, "character": 9}, "end": {"line": 53, "character": 10}},
|
|
"kind": 1}]
|