Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve leiningen project search #1403

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Commits on Nov 30, 2021

  1. Improve leiningen project search

    I have a problem when I use Calva's Jack In command - I have to run to
    open my project.clj file in the root of the repo before I Jack In. If
    I run the command when I have any source files open in the editor, the
    Jack In fails.
    
    The reason for this is that Calva will search from the directory
    containing the current file down to the workspace root.
    
    There are many projects named `project.clj` in the main CircleCI repo,
    since a project one of our core domain objects:
    
    ```
    marc@blaster ~/dev/circleci/circle $ find . -name project.clj
    ./project.clj
    ./src/circle/project.clj
    ./src/circle/http/api/v1/v1_0/project.clj
    ./src/circle/http/api/v1/v1_1/project.clj
    ./src/circle/http/api/v1/shared/project.clj
    ./src/circle/http/api/v2/insights/project.clj
    ./src/circle/http/api/v2/project.clj
    ./src/circle/http/api/v2/entities/insights/project.clj
    ./src/circle/http/api/v2/entities/project.clj
    ./src/circle/model/project.clj
    ./src/circle/model/api/project.clj
    ```
    
    If I have any file open in `src/circle`, (which is the location of all
    source files), Calva will find `src/circle/project.clj` before it
    considers the project.clj in the root. As far as I understand, this is a
    desirable search behaviour, since it allows folks to use Calva in
    projects that contain multiple leiningen projects.
    
    This change alters the search behaviour to only consider files that
    don't begin with the string `(ns ` when attempting the determine the
    project path.
    
    Fixes BetterThanTomorrow#871
    marcomorain committed Nov 30, 2021
    Configuration menu
    Copy the full SHA
    1fb466d View commit details
    Browse the repository at this point in the history