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

customize bucklescript projects #88

Open
bobzhang opened this issue Apr 8, 2017 · 3 comments
Open

customize bucklescript projects #88

bobzhang opened this issue Apr 8, 2017 · 3 comments

Comments

@bobzhang
Copy link

bobzhang commented Apr 8, 2017

If we find it is a bucklescript project (see if it has bsconfig.json in toplevel),
We disable ocaml.lintOnSave and use problem matcher as bewl, it is better than merlin
for error reporting since it is project aware and more solid(And I solved column-1 based issue in bucklescript compiler).
Currently I need type Tasks: Build to start a task, is there a way to automatically start when open such project? thanks!

{
    "version": "0.1.0",
    "command": "bsb",
    "options": {
        "cwd": "${workspaceRoot}"
    },
    "isShellCommand": true,
    "args": [
        "-w"
    ],
    "showOutput": "always",
    "isWatching": true,
    "problemMatcher": {
        "fileLocation": "absolute",
        "owner": "ocaml",
        "watching": {
            "activeOnStart": true,
            "beginsPattern": ">>>> Start compiling",
            "endsPattern": ">>>> Finish compiling"
        },
        "pattern": [
            {
                "regexp": "^File \"(.*)\", line (\\d+)(?:, characters (\\d+)-(\\d+))?:$",
                "file": 1,
                "line": 2,
                "column": 3,
                "endColumn": 4
            },
            {
                "regexp": "^(?:(?:Parse\\s+)?(Warning|[Ee]rror)(?:\\s+\\d+)?:)?\\s+(.*)$",
                "severity": 1,
                "message": 2,
                "loop": true
            }
        ]
    }
}
@hackwaly
Copy link
Owner

hackwaly commented Apr 9, 2017

I can't find that vscode provides any api for opening project event. but there is https://code.visualstudio.com/docs/extensionAPI/activation-events#_activationeventsworkspacecontains. So it's possible to achieve it by create another extension that execute "Build Task" command when it activate.

You can disable ocaml.lintOnSave by using workspace settings.

@bobzhang
Copy link
Author

@hackwaly Currently, whenever user create a new project, it still need create a tasks.json and copy it into that project such configuration, could we make it by default?

@hackwaly
Copy link
Owner

hackwaly commented Apr 14, 2017

Maybe we can submit some project generators for yeoman? So we can easily generate bucklescript project and other kind of projects.

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