Skip to content

Conversation

@TitasGailius
Copy link
Collaborator

This PR adds a new "Run PHP Template" command that is only available while developing the extension.
It's intended to make debugging the php templates easier during development.

Demo

demo

Implementation details

Visual Studio Code requires commands and command palette entries to be registered in package.json.

We only want this command to be visible in development mode. Since none of the existing context keys indicate whether the extension is running in development, we manually add a custom context key:

vscode.commands.executeCommand("setContext", "laravel.inDevMode", true);

If you are authoring your own VS Code extension and need to enable/disable commands, menus, or views using a when clause context and none of the existing keys suit your needs, you can add your own context key with the setContext command.

Reference: https://code.visualstudio.com/api/references/when-clause-contexts#add-a-custom-when-clause-context

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.

1 participant