Skip to content

Commit

Permalink
ccproject: transform filename with realpath()
Browse files Browse the repository at this point in the history
This should hopefully fix problems with the `compile_commands.json` file
not being relative to the root directory on Windows, since sometimes the
case of the drive letter can vary in the path names.

See #58
  • Loading branch information
Prince781 committed Apr 17, 2020
1 parent 0ba22e4 commit 39172e1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main.vala
Expand Up @@ -318,12 +318,13 @@ class Vls.Server : Object {
// try compile_commands.json if Meson failed
if (project == null && !cc_files.is_empty) {
foreach (var cc_file in cc_files) {
string cc_file_path = Util.realpath (cc_file.get_path ());
try {
project = new CcProject (root_path, cc_file.get_path (), cancellable);
debug ("[initialize] initialized CcProject with %s", cc_file.get_path ());
project = new CcProject (root_path, cc_file_path, cancellable);
debug ("[initialize] initialized CcProject with %s", cc_file_path);
break;
} catch (Error e) {
debug ("[initialize] CcProject failed with %s - %s", cc_file.get_path (), e.message);
debug ("[initialize] CcProject failed with %s - %s", cc_file_path, e.message);
continue;
}
}
Expand Down

0 comments on commit 39172e1

Please sign in to comment.