mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 15:41:04 +01:00
Language server: prelude support. (#7417)
Support multi-file compilation, and in particular imports of files from the prelude, in `carbon language_server`. In order to properly interface with `CompileDriver`, also switch over to building a proper VFS from the documents we're given. Assisted-by: Gemini via Antigravity
This commit is contained in:
@@ -76,14 +76,14 @@ auto FormatSubcommand::Run(DriverEnv& driver_env) -> DriverResult {
|
||||
// TODO: Consider refactoring this for sharing with compile.
|
||||
// TODO: Decide what to do with `-` when there are multiple arguments.
|
||||
auto source = SourceBuffer::MakeFromFileOrStdin(*driver_env.fs, f,
|
||||
driver_env.consumer);
|
||||
*driver_env.consumer);
|
||||
if (!source) {
|
||||
mark_per_file_error();
|
||||
continue;
|
||||
}
|
||||
SharedValueStores value_stores;
|
||||
Lex::LexOptions lex_options;
|
||||
lex_options.consumer = &driver_env.consumer;
|
||||
lex_options.consumer = driver_env.consumer;
|
||||
auto tokens = Lex::Lex(value_stores, *source, lex_options);
|
||||
|
||||
RawStringOstream buffer;
|
||||
|
||||
Reference in New Issue
Block a user