Accept .luau files (#552)

* accept .luau files

* Accept .luau in snapshot creation

* Update versioning and snapshots.

* fix versioning

* Run rustfmt

* Reduce repetition in extension detection

* Tidy build script change

Co-authored-by: Lucien Greathouse <me@lpghatguy.com>
This commit is contained in:
Samuel P
2022-06-29 16:53:10 -06:00
committed by GitHub
parent 8ea41480b7
commit acf7456371
7 changed files with 45 additions and 5 deletions

View File

@@ -244,7 +244,7 @@ impl ApiService {
}
}
/// If this instance is represented by a script, try to find the correct .lua
/// If this instance is represented by a script, try to find the correct .lua or .luau
/// file to open to edit it.
fn pick_script_path(instance: InstanceWithMeta<'_>) -> Option<PathBuf> {
match instance.class_name() {
@@ -252,16 +252,17 @@ fn pick_script_path(instance: InstanceWithMeta<'_>) -> Option<PathBuf> {
_ => return None,
}
// Pick the first listed relevant path that has an extension of .lua that
// Pick the first listed relevant path that has an extension of .lua or .luau that
// exists.
instance
.metadata()
.relevant_paths
.iter()
.find(|path| {
// We should only ever open Lua files to be safe.
// We should only ever open Lua or Luau files to be safe.
match path.extension().and_then(|ext| ext.to_str()) {
Some("lua") => {}
Some("luau") => {}
_ => return false,
}