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

projectile can't identity .NET Core project root #1432

Closed
stardiviner opened this issue Jun 25, 2019 · 2 comments
Closed

projectile can't identity .NET Core project root #1432

stardiviner opened this issue Jun 25, 2019 · 2 comments

Comments

@stardiviner
Copy link
Contributor

Expected behavior

Actual behavior

I have open a dotnet project file Program.cs, omnisharp auto start server.

omnisharp: starting server on project root: "/home/stardiviner/"

But my Program.cs is under /home/stardiviner/Documents/learning/.NET/myApp/Program.cs

It should identify project root on /home/stardiviner/Documents/learning/.NET/myApp/.

I checked out part of projectile source code. Seems does not handle this case. Because .NET Core project doesn't have a static project filename. It's dependent on project name which is myApp.csproj. I guess projectile can add an advanced function to detect this and add in custom variable projectile-project-root-files-functions.

FOr now, I have to manually add .projectile to let projectile works.

Steps to reproduce the problem

Environment & Version information

Projectile version information

Projectile version: Projectile 20190624.1802

Emacs version

GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.5) of 2019-02-22

Operating system

Arch Linux

@bbatsov
Copy link
Owner

bbatsov commented Jun 25, 2019

Something like this is easy to implement with projectile-verify-file-wildcard. We basically need the same thing we did for cabal projects. (see projectile-cabal-project-p).

@stardiviner
Copy link
Contributor Author

Here is my code, if need, I can create a PR.

(defun projectile-dotnet-project-p ()
    (or (projectile-verify-file-wildcard "?*.csproj")
        (projectile-verify-file-wildcard "?*.fsproj")))
  (projectile-register-project-type 'dotnet #'projectile-dotnet-project-p
                                    :compile "dotnet build"
                                    :run "dotnet run"
                                    :test "dotnet test")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants