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

[Windows] Fix issue with Laravel Herd #62

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

Conversation

vikas5914
Copy link

@vikas5914 vikas5914 commented May 6, 2024

Fix #61

Copy link
Member

@d8vjork d8vjork left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this particularly to a OS? As plenty of other users had an issue with other OS like Mac OS or Linux I'm curious if this will solve all the problems

@d8vjork
Copy link
Member

d8vjork commented May 7, 2024

Also please do check this with WSL so we don't break stuff that was working before (I believe many will not attempt to change all their working environment to Laravel Herd) 😄

@vikas5914
Copy link
Author

@d8vjork The code only changes stuff for the Windows OS system. so I will change the PR title.

I checked with MacOS. It's working without any issues.

For WSL, you mean Laravel Sail, right? I will ask around if someone is already using it.

Linux will be tough since I do not have a machine.

@vikas5914 vikas5914 changed the title Fix issue with Laravel Herd [Windows] Fix issue with Laravel Herd May 7, 2024
@vikas5914
Copy link
Author

@d8vjork I checked the code, and it does not run the sail command.

The format file function does not use sail. Am I missing something?

let command = workspaceFolder
? await this.commandResolver.getPintCommand(workspaceFolder, file.fsPath, isFormatWorkspace)
: await this.commandResolver.getGlobalPintCommand([file.fsPath]);
.

@d8vjork
Copy link
Member

d8vjork commented May 14, 2024

@vikas5914 That's in the workspace formatting, the save has the pint within sail resolver

const pintCommand = getWorkspaceConfig('runInLaravelSail', false)
? await this.commandResolver.getPintCommandWithinSail(workspaceFolder)
: await this.commandResolver.getPintCommand(workspaceFolder);

@vikas5914
Copy link
Author

@vikas5914 That's in the workspace formatting, the save has the pint within sail resolver

const pintCommand = getWorkspaceConfig('runInLaravelSail', false)
? await this.commandResolver.getPintCommandWithinSail(workspaceFolder)
: await this.commandResolver.getPintCommand(workspaceFolder);

I checked the code again, but the function handleActiveTextEditorChanged (line # 101-152) does not execute the run() command.

Also, I put the console log in the run() command, and it's not using the sail command at all.

@d8vjork
Copy link
Member

d8vjork commented May 14, 2024

@vikas5914 are you trying to save a changed .php file? Also did you configure the extension so it formats on save (or manually triggering this format)

@vikas5914
Copy link
Author

@d8vjork d8vjork yes.. I am trying to save a changed.PHP file, and I have set its format to save. This is my settings

{
  "[php]": {
      "editor.insertSpaces": false,
      "editor.formatOnSave": true,
      "editor.defaultFormatter": "open-southeners.laravel-pint"
    },
  
 "laravel-pint.enableDebugLogs": true,
  "laravel-pint.preset": "laravel",
 "laravel-pint.fallbackToGlobalBin": false,
  "laravel-pint.enable": true,
  "laravel-pint.runInLaravelSail": true
}

@vikas5914
Copy link
Author

@d8vjork, any comment on the above info?

@vikas5914
Copy link
Author

@d8vjork hey.,. any update on this PR?

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

Successfully merging this pull request may close these issues.

LaravelPint does not work with the Windows version of laravelHerd
2 participants