Code Monkey home page Code Monkey logo

Comments (6)

userabuser avatar userabuser commented on May 26, 2024

@CallumCarmicheal in your settings.json add the following property:

"artisan.location": ["${workspaceFolder}\\artisan"]

...looking through the source of the plugin I noticed this object property after erroneously missing it in the Settings UI which I don't use as much as going straight to the *.json file.

So your settings.json might look like:

{
    // ...snipped...

    // with or without extension depending if loading from WSL etcy
    "artisan.php.location": "C:/path/to/php.exe",  

    // one or more locations to artisan
    "artisan.location": ["${workspaceFolder}\\artisan"]

    // ...snipped...
}

Useful reading: https://code.visualstudio.com/docs/editor/variables-reference

from vscode-laravel-artisan.

CallumCarmicheal avatar CallumCarmicheal commented on May 26, 2024

@userabuser I have tried to set this setting with the variable although it gets printed out as a literal.

[CMD] "php" artisan route:list
[ERR] Command failed: cd /d "\${workspaceFolder}\chaotic" && "php" artisan route:list
The system cannot find the path specified.

It states in the documentation that the variables are only supported inside tasks.json and launch.json.

Variable substitution is supported inside key and value strings in launch.json and tasks.json files using ${variableName} syntax.

After checking this issue was gone when i decided to open the folder (not the workspace), which allowed me to see another problem. Even when the path is fully inside the command it still fails, i believe that might have something to do with powershell as i get this error when running the command (which will work fine in CMD)

Set-Location : A positional parameter cannot be found that accepts argument 'd:\Programming\laravel\chaotic'.
At line:1 char:1
+ cd /d "d:\Programming\larvel\cha...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Set-Location], ParameterBindingException
    + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.SetLocationCommand

from vscode-laravel-artisan.

TheColorRed avatar TheColorRed commented on May 26, 2024

Within the code, the only thing I can really think of is that that it is finding an "additional location" somehow, which is empty. and returning that value which it looks for all artisan locations within your project.

Does this possibly help? I added an additional check to see if the artisan path is not an empty string:

if (list.length == 1 && list[0].fsPath.length) return list[0].fsPath

laravel-artisan-0.0.26.vsix.zip

Side Note: I believe that Powershell, cmd, etc. support / as well as \

from vscode-laravel-artisan.

CallumCarmicheal avatar CallumCarmicheal commented on May 26, 2024

Im still getting the same output,

workbench.main.js:238 [Extension Host] 
Error: Command failed: cd /d "d:\Programming\Reversing\Xbox\Resources\Development\C360\Panel\laravel\chaotic" && "php" artisan route:list
 (See output console for more details)

I'm not really sure what this issue is, I'll clone the repo and do some testing on my side tomorrow when I get home, thank you for the help.

from vscode-laravel-artisan.

TheColorRed avatar TheColorRed commented on May 26, 2024

Housekeeping, closing due to inactivity.

from vscode-laravel-artisan.

uzor64 avatar uzor64 commented on May 26, 2024

The solution to this is to set settings.json artisan.location to the root or your project, where the artisan file is located.

for example in settings.json: "artisan.location": "C:/xampp/htdocs/ProjectName"

from vscode-laravel-artisan.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.