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

beginners guide to using extension after installation #100

Open
abulka opened this issue Oct 11, 2019 · 1 comment
Open

beginners guide to using extension after installation #100

abulka opened this issue Oct 11, 2019 · 1 comment
Assignees

Comments

@abulka
Copy link

abulka commented Oct 11, 2019

Just starting out with crystal and the vscode extension. I am suprised that there is no documentation on how to use the extension after installing it.

Attempting to 'add a configuration' from the vscode debug panel drops down a list of language options, but crystal is not one of them.

Hitting CMD-SHIFT-P (on Mac) then selecting 'configure default build task' lists crystal items in the drop down (yey!) and selecting Crystal Run creates a configuration - however it does not work for me:

        {
            "type": "crystal",
            "command": "run",
            "file": "",
            "group": {
                "kind": "build",
                "isDefault": true
            }
        }

After adding ${file} to the "file" entry, the error (when I press CMD SHIFT B to build) is:

Error: The crystal task detection didn't contribute a task for the following configuration:
{
    "type": "crystal",
    "command": "run",
    "file": "${file}",
    "group": {
        "kind": "build",
        "isDefault": true
    }
}
The task will be ignored.

Huh? Presumably all vscode users know about all the tricks with launch.json and tasks.json - however a bit of a guide would be nice, with specific configurations supplied for crystal use. Based on my previous experience with nim tasks in vscode I finally created this:

    "tasks": [
        {
            "label": "Run crystal stuff",
            "type": "shell",
            "command": "crystal",
            "args": ["run", "${file}"],
            "options": {
                "cwd": "${workspaceRoot}"
            },            
            "group": {
                "kind": "build",
                "isDefault": true
            }
        },
    ]

which seems to work when I hit CMD-SHIFT-B on my Mac.

Any clarification or improvements on configuations would be gratefully appreciated. My main development experience recently has been Python where I can create launch configurations really easily - the tasks.json approach used by crystal and nim is new territory. Still, I think some getting started instructions would be helpful to newcomers like me. And a default configuration that actually works?

@max-bertinetti
Copy link

I'll see what is still valid and add to the docs for v1.0.0

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

No branches or pull requests

2 participants