mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-23 05:51:39 +00:00
Update Luau LSP and project configurations
- Upgraded `luau-lsp` dependency to version 1.62.0 for improved features and bug fixes. - Modified sourcemap generator command in VSCode settings for better output handling. - Enabled `fillCallArguments` in project template settings to enhance code completion. - Added new configuration options for fragment autocomplete and quote conversion in project template settings. - Introduced a `sourcemap` flag in `SyncbackCommand` to allow optional sourcemap generation during syncback operations. These changes enhance the development experience and improve the functionality of the Luau language server integration.
This commit is contained in:
parent
4564ea242f
commit
a6341783ef
7 changed files with 67 additions and 37 deletions
|
|
@ -84,6 +84,7 @@ impl CloneCommand {
|
|||
dry_run: false,
|
||||
interactive: false,
|
||||
incremental: false,
|
||||
sourcemap: false,
|
||||
working_dir: path.clone(),
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -71,6 +71,10 @@ pub struct SyncbackCommand {
|
|||
#[clap(long, short = 'n')]
|
||||
pub incremental: bool,
|
||||
|
||||
/// Generate a sourcemap.json file after syncback.
|
||||
#[clap(long)]
|
||||
pub sourcemap: bool,
|
||||
|
||||
/// Base directory for resolving relative paths (project, input).
|
||||
/// Defaults to the current working directory.
|
||||
#[clap(long, hide = true, default_value = ".")]
|
||||
|
|
@ -229,45 +233,53 @@ impl SyncbackCommand {
|
|||
}
|
||||
|
||||
log::info!("Writing to the file system...");
|
||||
let sourcemap_path = base_path.join("sourcemap.json");
|
||||
|
||||
// Run file writes and sourcemap generation in parallel.
|
||||
// The sourcemap is built entirely from in-memory data (WeakDom + path map),
|
||||
// so it doesn't need to wait for files to be on disk.
|
||||
let (write_result, sourcemap_result) = std::thread::scope(|s| {
|
||||
let write_handle = s.spawn(|| {
|
||||
result
|
||||
.fs_snapshot
|
||||
.write_to_vfs_parallel(base_path, session_old.vfs())
|
||||
});
|
||||
if self.sourcemap {
|
||||
let sourcemap_path = base_path.join("sourcemap.json");
|
||||
|
||||
let sourcemap_handle = s.spawn(|| {
|
||||
write_sourcemap_from_syncback(
|
||||
&result.new_tree,
|
||||
&result.instance_paths,
|
||||
base_path,
|
||||
&sourcemap_path,
|
||||
// Run file writes and sourcemap generation in parallel.
|
||||
// The sourcemap is built entirely from in-memory data (WeakDom + path map),
|
||||
// so it doesn't need to wait for files to be on disk.
|
||||
let (write_result, sourcemap_result) = std::thread::scope(|s| {
|
||||
let write_handle = s.spawn(|| {
|
||||
result
|
||||
.fs_snapshot
|
||||
.write_to_vfs_parallel(base_path, session_old.vfs())
|
||||
});
|
||||
|
||||
let sourcemap_handle = s.spawn(|| {
|
||||
write_sourcemap_from_syncback(
|
||||
&result.new_tree,
|
||||
&result.instance_paths,
|
||||
base_path,
|
||||
&sourcemap_path,
|
||||
)
|
||||
});
|
||||
|
||||
(
|
||||
write_handle.join().unwrap(),
|
||||
sourcemap_handle.join().unwrap(),
|
||||
)
|
||||
});
|
||||
|
||||
(
|
||||
write_handle.join().unwrap(),
|
||||
sourcemap_handle.join().unwrap(),
|
||||
)
|
||||
});
|
||||
write_result?;
|
||||
|
||||
match sourcemap_result {
|
||||
Ok(()) => log::info!("Generated sourcemap at {}", sourcemap_path.display()),
|
||||
Err(e) => log::warn!("Could not generate sourcemap: {}", e),
|
||||
}
|
||||
} else {
|
||||
result
|
||||
.fs_snapshot
|
||||
.write_to_vfs_parallel(base_path, session_old.vfs())?;
|
||||
}
|
||||
|
||||
write_result?;
|
||||
log::info!(
|
||||
"Finished syncback: wrote {} files/folders, removed {}.",
|
||||
result.fs_snapshot.added_paths().len(),
|
||||
result.fs_snapshot.removed_paths().len()
|
||||
);
|
||||
|
||||
match sourcemap_result {
|
||||
Ok(()) => log::info!("Generated sourcemap at {}", sourcemap_path.display()),
|
||||
Err(e) => log::warn!("Could not generate sourcemap: {}", e),
|
||||
}
|
||||
|
||||
// Refresh git index if in a git repository
|
||||
refresh_git_index(base_path);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue