Skip to content

Commit

Permalink
regression fix attempt 2
Browse files Browse the repository at this point in the history
  • Loading branch information
rszyma committed Jan 31, 2024
1 parent 714ae52 commit add2c94
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions kls/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -527,11 +527,12 @@ impl KanataLanguageServer {
err: &CustomParseError,
) -> anyhow::Result<Option<TextDocumentItem>> {
let url: Url = match &self.workspace_options {
WorkspaceOptions::Workspace { root, .. } => {
WorkspaceOptions::Workspace { root, .. }
| WorkspaceOptions::Single { root: Some(root) } => {
let filename = err.span.file_name();
Url::join(root, &filename).map_err(|e| anyhow!(e.to_string()))?
}
WorkspaceOptions::Single { .. } => match &self.documents.first_key_value() {
WorkspaceOptions::Single { root: None } => match &self.documents.first_key_value() {
Some(entry) => entry.0.to_owned(),
None => bail!("no kanata files are opened"),
},
Expand Down

0 comments on commit add2c94

Please sign in to comment.