Skip to content

vale-ls doesn't work on Windows (fix included) #9

Closed
@veksha

Description

uri.path() will return /C:/file.txt on windows and call to vale.exe will fail.
uri.path() is returning uri component called "path" (not what we want), i think it's better to use uri.to_file_path() to get file path in correct format.

diff --git a/src/server.rs b/src/server.rs
index c84f874..a3242c0 100644
--- a/src/server.rs
+++ b/src/server.rs
@@ -380,7 +380,7 @@ impl Backend {
 
         self.update(params.clone());
         if self.cli.is_installed() {
-            match self.cli.run(uri.path(), self.config_path(), self.config_filter()) {
+            match self.cli.run(uri.to_file_path().unwrap().to_str().unwrap(), self.config_path(), self.config_filter()) {
                 Ok(result) => {
                     let mut diagnostics = Vec::new();
                     for (_, v) in result.iter() {

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions