mirror of
https://github.com/latex-lsp/texlab.git
synced 2025-08-04 02:39:21 +00:00
Fix detecting document language in symbol tests
This commit is contained in:
parent
2b11488d4a
commit
03dac41136
1 changed files with 4 additions and 6 deletions
|
@ -1,3 +1,5 @@
|
|||
use std::path::PathBuf;
|
||||
|
||||
use base_db::{Owner, Workspace};
|
||||
use rowan::{TextRange, TextSize};
|
||||
use url::Url;
|
||||
|
@ -25,12 +27,8 @@ impl Fixture {
|
|||
|
||||
let mut workspace = Workspace::default();
|
||||
for document in &documents {
|
||||
let language = document
|
||||
.uri
|
||||
.to_file_path()
|
||||
.ok()
|
||||
.and_then(|path| distro::Language::from_path(&path))
|
||||
.unwrap_or(distro::Language::Tex);
|
||||
let path = PathBuf::from(document.uri.path());
|
||||
let language = distro::Language::from_path(&path).unwrap_or(distro::Language::Tex);
|
||||
|
||||
workspace.open(
|
||||
document.uri.clone(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue