{"id":18244251,"url":"https://github.com/stackb/bazel-stack-vscode-api","last_synced_at":"2025-04-08T18:33:27.964Z","repository":{"id":74737536,"uuid":"300648314","full_name":"stackb/bazel-stack-vscode-api","owner":"stackb","description":"VSCode API for the bazel-stack-vscode extension","archived":false,"fork":false,"pushed_at":"2020-10-03T16:41:15.000Z","size":89,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-15T10:34:48.843Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stackb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-10-02T14:54:57.000Z","updated_at":"2024-09-21T03:33:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"b3be434f-a487-41a4-813b-024633208ec8","html_url":"https://github.com/stackb/bazel-stack-vscode-api","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackb%2Fbazel-stack-vscode-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackb%2Fbazel-stack-vscode-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackb%2Fbazel-stack-vscode-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackb%2Fbazel-stack-vscode-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stackb","download_url":"https://codeload.github.com/stackb/bazel-stack-vscode-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247902258,"owners_count":21015416,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T09:15:54.412Z","updated_at":"2025-04-08T18:33:27.944Z","avatar_url":"https://github.com/stackb.png","language":"TypeScript","readme":"# bazel-stack-vscode API\n\nThis package contains the APIs used to interact with the\n[bazel-stack-vscode](https://marketplace.visualstudio.com/items?itemName=StackBuild.bazel-stack-vscode)\nextension.\n\n## Implementing Problem Matchers\n\nProblem matchers can be registered with the bazel-stack-vscode extension to\nextend its diagnostic capabilities.  Problem Matchers are named regular expressions\nthat are used to match lines in the stdout/stderr of a particular tool.\nMatching results are displayed in the editor making it easy to see and navigate\nto problem areas in a source file.\n\nFor example, consider the `proto_library` rule.  When a rule of this class is\nexecuted, a `ProtoCompile` action is spawned that performs the actual work and\nruns the `protoc` tool (the name `ProtoCompile` is called the *action\nmnemonic*). The `protoc` tool complains about errors in a format like\n`proto/example.proto:111:17: Field number 5 has already been used in\n\"foo.Message\" by field \"finished\"`.\n\nThe corresponding *problem matcher* associates the mnemonic name `ProtoCompile`\nwith a regular expression (as well as metadata that instructs how to map the\nmatching parts into meaningful tokens):\n\n```json\n{\n    \"name\": \"ProtoCompile\",\n    \"fileLocation\": [\n        \"relative\",\n        \"${workspaceRoot}\"\n    ],\n    \"pattern\": [\n        {\n            \"regexp\": \"(.*):(\\\\d+):(\\\\d+): (.*)$\",\n            \"file\": 1,\n            \"line\": 2,\n            \"column\": 3,\n            \"message\": 4\n        }\n    ]\n}\n```\n\nNote that the format \u0026 design of problem matchers is nearly identical to\nhttps://code.visualstudio.com/docs/editor/tasks#_defining-a-problem-matcher.\nPlease refer to that documentation for more specifics about the format.\n\nTo register the same matcher under multiple names, use a comma-separated list\nfor the `name: ` field (e.g. `ProtoCompile,GenProtoDescriptorSet`).\n\n## Creating a Problem Matcher Extension\n\nFor example, let's say you are working with haskell, and you'd like to make it\neasier to find problems in `ghc` output.  Here are the steps you'd take to\ncreate this extension:\n\n1. Fork an existing example such as\n[stackb/bazel-stack-vscode-go](https://github.com/stackb/bazel-stack-vscode-go).\n1. Replace the name to match the language or tool:\n   `s/bazel-stack-vscode-rules-go/bazel-stack-vscode-rules-haskell/g`.\n1. Delete the golang problem matchers in `package.json` and replace with your\n   tool specific matchers in your `package.json`.  In order to do this properly,\n   you'll need to know the mnemonic names of the actions spawned by haskell\n   rules and ensure these are an exact string match (the mnemonic name of the\n   action is used to find the correct problem matcher).\n1. Make sure your problem matcher definitions have tests.  The API has a test\n   runner that makes it easy to [write tests with examples](https://github.com/stackb/bazel-stack-vscode-go/blob/master/src/test/suite/extension.test.ts).\n1. [Publish your extension](https://code.visualstudio.com/api/working-with-extensions/publishing-extension) to the vscode marketplace.\n1. Install the extension within vscode.  At extension load time, your extension\n   will find the `bazel-stack-vscode` extension and populate it with your\n   problem matchers.  At runtime, these problem matchers will be used to create\n   tool-specific diagnostics.\n\n## Problem Matcher Extensions\n\n- [stackb/bazel-stack-vscode-go](https://github.com/stackb/bazel-stack-vscode-go)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackb%2Fbazel-stack-vscode-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstackb%2Fbazel-stack-vscode-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackb%2Fbazel-stack-vscode-api/lists"}