Ellisande / atom-gherkin-autocomplete

Atom package for autocompleting steps from your feature files.
MIT License
2 stars 4 forks source link

rootDirectory function always scan the first project directory #5

Open anxuae opened 6 years ago

anxuae commented 6 years ago

I regularly work on several projects with gherkin scenarios. It will be really useful to scan the project folder of the currently edited file.

I suggest to update the rootDirectory function with the following code, it should work fine:

  rootDirectory: function() {
    filePath = atom.workspace.getActivePaneItem().buffer.file.path;
    let projectPath = "";
    atom.project.getDirectories().forEach(function(dir){
        if (dir.contains(filePath)) {
            projectPath = dir.path;
        }
    });
    return projectPath
  },
tilsammans commented 6 years ago

Nice.

Here's hoping it will get merged. It would be good to find out which Cucumber plugins on Atom are still maintained.