{"id":14991097,"url":"https://github.com/llvm/vscode-mlir","last_synced_at":"2025-10-18T06:18:54.197Z","repository":{"id":47482017,"uuid":"390488698","full_name":"llvm/vscode-mlir","owner":"llvm","description":null,"archived":false,"fork":false,"pushed_at":"2024-05-17T16:01:42.000Z","size":152,"stargazers_count":62,"open_issues_count":11,"forks_count":15,"subscribers_count":394,"default_branch":"main","last_synced_at":"2025-09-20T06:36:34.565Z","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":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/llvm.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":"2021-07-28T20:03:48.000Z","updated_at":"2025-07-08T18:43:36.000Z","dependencies_parsed_at":"2024-11-08T09:48:22.160Z","dependency_job_id":null,"html_url":"https://github.com/llvm/vscode-mlir","commit_stats":{"total_commits":41,"total_committers":4,"mean_commits":10.25,"dds":"0.31707317073170727","last_synced_commit":"ed85c0b4a22d5afb2077342b4d06825856bc1277"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/llvm/vscode-mlir","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/llvm%2Fvscode-mlir","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/llvm%2Fvscode-mlir/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/llvm%2Fvscode-mlir/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/llvm%2Fvscode-mlir/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/llvm","download_url":"https://codeload.github.com/llvm/vscode-mlir/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/llvm%2Fvscode-mlir/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279294352,"owners_count":26141931,"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","status":"online","status_checked_at":"2025-10-17T02:00:07.504Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-09-24T14:21:28.185Z","updated_at":"2025-10-18T06:18:54.176Z","avatar_url":"https://github.com/llvm.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MLIR\n\nThe [MLIR extension](https://marketplace.visualstudio.com/items?itemName=llvm-vs-code-extensions.vscode-mlir)\nprovides language IDE features for [MLIR](https://mlir.llvm.org/) related\nlanguages: [MLIR](#mlir---mlir-textual-assembly-format),\n[PDLL](#pdll---mlir-pdll-pattern-files), and [TableGen](#td---tablegen-files)\n\n## `.mlir` - MLIR textual assembly format:\n\nThe MLIR extension adds language support for the\n[MLIR textual assembly format](https://mlir.llvm.org/docs/LangRef/):\n\n### Features\n\n- Syntax highlighting for `.mlir` files and `mlir` markdown blocks\n- go-to-definition and cross references\n- Detailed information when hovering over IR entities\n- Outline and navigation of symbols and symbol tables\n- Code completion\n- Live parser and verifier diagnostics\n\n#### Diagnostics\n\nThe language server actively runs verification on the IR as you type, showing\nany generated diagnostics in-place.\n\n![IMG](https://mlir.llvm.org/mlir-lsp-server/diagnostics.png)\n\n##### Automatically insert `expected-` diagnostic checks\n\nMLIR provides\n[infrastructure](https://mlir.llvm.org/docs/Diagnostics/#sourcemgr-diagnostic-verifier-handler)\nfor checking expected diagnostics, which is heavily utilized when defining IR\nparsing and verification. The language server provides code actions for\nautomatically inserting the checks for diagnostics it knows about.\n\n![IMG](https://mlir.llvm.org/mlir-lsp-server/diagnostics_action.gif)\n\n#### Code completion\n\nThe language server provides suggestions as you type, offering completions for\ndialect constructs (such as attributes, operations, and types), block names, SSA\nvalue names, keywords, and more.\n\n![IMG](https://mlir.llvm.org/mlir-lsp-server/code_complete.gif)\n\n#### Cross-references\n\nCross references allow for navigating the use/def chains of SSA values (i.e.\noperation results and block arguments), [Symbols](../SymbolsAndSymbolTables.md),\nand Blocks.\n\n##### Find definition\n\nJump to the definition of the IR entity under the cursor. A few examples are\nshown below:\n\n- SSA Values\n\n![SSA](https://mlir.llvm.org/mlir-lsp-server/goto_def_ssa.gif)\n\n- Symbol References\n\n![Symbols](https://mlir.llvm.org/mlir-lsp-server/goto_def_symbol.gif)\n\nThe definition of an operation will also take into account the source location\nattached, allowing for navigating into the source file that generated the\noperation.\n\n![External Locations](https://mlir.llvm.org/mlir-lsp-server/goto_def_external.gif)\n\n##### Find references\n\nShow all references of the IR entity under the cursor.\n\n![IMG](https://mlir.llvm.org/mlir-lsp-server/find_references.gif)\n\n#### Hover\n\nHover over an IR entity to see more information about it. The exact information\ndisplayed is dependent on the type of IR entity under the cursor. For example,\nhovering over an `Operation` may show its generic format.\n\n![IMG](https://mlir.llvm.org/mlir-lsp-server/hover.png)\n\n#### Navigation\n\nThe language server will also inform the editor about the structure of symbol\ntables within the IR. This allows for jumping directly to the definition of a\nsymbol, such as a `func.func`, within the file.\n\n![IMG](https://mlir.llvm.org/mlir-lsp-server/navigation.gif)\n\n#### Bytecode Editing and Inspection\n\nThe language server provides support for interacting with MLIR bytecode files,\nenabling IDEs to transparently view and edit bytecode files in the same way\nas textual `.mlir` files.\n\n![IMG](https://mlir.llvm.org/mlir-lsp-server/bytecode_edit.gif)\n\n### Setup\n\n#### `mlir-lsp-server`\n\nThe various `.mlir` language features require the\n[`mlir-lsp-server` language server](https://mlir.llvm.org/docs/Tools/MLIRLSP/#mlir-lsp-language-server--mlir-lsp-server).\nIf `mlir-lsp-server` is not found within your workspace path, you must specify\nthe path of the server via the `mlir.server_path` setting. The path of the\nserver may be absolute or relative within your workspace.\n\n## `.pdll` - MLIR PDLL pattern files:\n\nThe MLIR extension adds language support for the\n[PDLL pattern language](https://mlir.llvm.org/docs/PDLL/).\n\n### Features\n\n- Syntax highlighting for `.pdll` files and `pdll` markdown blocks\n- go-to-definition and cross references\n- Types and documentation on hover\n- Code completion and signature help\n- View intermediate AST, MLIR, or C++ output\n\n#### Diagnostics\n\nThe language server actively runs verification as you type, showing any\ngenerated diagnostics in-place.\n\n![IMG](https://mlir.llvm.org/mlir-pdll-lsp-server/diagnostics.png)\n\n#### Code completion and signature help\n\nThe language server provides suggestions as you type based on what constraints,\nrewrites, dialects, operations, etc are available in this context. The server\nalso provides information about the structure of constraint and rewrite calls,\noperations, and more as you fill them in.\n\n![IMG](https://mlir.llvm.org/mlir-pdll-lsp-server/code_complete.gif)\n\n#### Cross-references\n\nCross references allow for navigating the code base.\n\n##### Find definition\n\nJump to the definition of a symbol under the cursor:\n\n![IMG](https://mlir.llvm.org/mlir-pdll-lsp-server/goto_def.gif)\n\nIf ODS information is available, we can also jump to the definition of operation\nnames and more:\n\n![IMG](https://mlir.llvm.org/mlir-pdll-lsp-server/goto_def_ods.gif)\n\n##### Find references\n\nShow all references of the symbol under the cursor.\n\n![IMG](https://mlir.llvm.org/mlir-pdll-lsp-server/find_references.gif)\n\n#### Hover\n\nHover over a symbol to see more information about it, such as its type,\ndocumentation, and more.\n\n![IMG](https://mlir.llvm.org/mlir-pdll-lsp-server/hover.png)\n\nIf ODS information is available, we can also show information directly from the\noperation definitions:\n\n![IMG](https://mlir.llvm.org/mlir-pdll-lsp-server/hover_ods.png)\n\n#### Navigation\n\nThe language server will also inform the editor about the structure of symbols\nwithin the IR.\n\n![IMG](https://mlir.llvm.org/mlir-pdll-lsp-server/navigation.gif)\n\n#### View intermediate output\n\nThe language server provides support for introspecting various intermediate\nstages of compilation, such as the AST, the `.mlir` containing the generated\nPDL, and the generated C++ glue. This is a custom LSP extension, and is not\nnecessarily provided by all IDE clients.\n\n![IMG](https://mlir.llvm.org/mlir-pdll-lsp-server/view_output.gif)\n\n#### Inlay hints\n\nThe language server provides additional information inline with the source code.\nEditors usually render this using read-only virtual text snippets interspersed\nwith code. Hints may be shown for:\n\n- types of local variables\n- names of operand and result groups\n- constraint and rewrite arguments\n\n![IMG](https://mlir.llvm.org/mlir-pdll-lsp-server/inlay_hints.png)\n\n### Setup\n\n#### `mlir-pdll-lsp-server`\n\nThe various `.pdll` language features require the\n[`mlir-pdll-lsp-server` language server](https://mlir.llvm.org/docs/Tools/MLIRLSP/#pdll-lsp-language-server--mlir-pdll-lsp-server).\nIf `mlir-pdll-lsp-server` is not found within your workspace path, you must\nspecify the path of the server via the `mlir.pdll_server_path` setting. The path\nof the server may be absolute or relative within your workspace.\n\n#### Project setup\n\nTo properly understand and interact with `.pdll` files, the language server must\nunderstand how the project is built (compile flags).\n[`pdll_compile_commands.yml` files](https://mlir.llvm.org/docs/Tools/MLIRLSP/#compilation-database)\nrelated to your project should be provided to ensure files are properly\nprocessed. These files can usually be generated by the build system, and the\nserver will attempt to find them within your `build/` directory. If not\navailable in or a unique location, additional `pdll_compile_commands.yml` files\nmay be specified via the `mlir.pdll_compilation_databases` setting. The paths of\nthese databases may be absolute or relative within your workspace.\n\n## `.td` - TableGen files:\n\nThe MLIR extension adds language support for the\n[TableGen language](https://llvm.org/docs/TableGen/ProgRef.html).\n\n### Features\n\n- Syntax highlighting for `.td` files and `tablegen` markdown blocks\n- go-to-definition and cross references\n- Types and documentation on hover\n\n#### Diagnostics\n\nThe language server actively runs verification as you type, showing any\ngenerated diagnostics in-place.\n\n![IMG](https://mlir.llvm.org/tblgen-lsp-server/diagnostics.png)\n\n#### Cross-references\n\nCross references allow for navigating the code base.\n\n##### Find definition\n\nJump to the definition of a symbol under the cursor:\n\n![IMG](https://mlir.llvm.org/tblgen-lsp-server/goto_def.gif)\n\n##### Find references\n\nShow all references of the symbol under the cursor.\n\n![IMG](https://mlir.llvm.org/tblgen-lsp-server/find_references.gif)\n\n#### Hover\n\nHover over a symbol to see more information about it, such as its type,\ndocumentation, and more.\n\n![IMG](https://mlir.llvm.org/tblgen-lsp-server/hover_def.png)\n\nHovering over an overridden field will also show you information such as\ndocumentation from the base value:\n\n![IMG](https://mlir.llvm.org/tblgen-lsp-server/hover_field.png)\n\n### Setup\n\n#### `tblgen-lsp-server`\n\nThe various `.td` language features require the\n[`tblgen-lsp-server` language server](https://mlir.llvm.org/docs/Tools/MLIRLSP/#tablegen-lsp-language-server--tblgen-lsp-server).\nIf `tblgen-lsp-server` is not found within your workspace path, you must specify\nthe path of the server via the `mlir.tablegen_server_path` setting. The path of\nthe server may be absolute or relative within your workspace.\n\n#### Project setup\n\nTo properly understand and interact with `.td` files, the language server must\nunderstand how the project is built (compile flags).\n[`tablegen_compile_commands.yml` files](https://mlir.llvm.org/docs/Tools/MLIRLSP/#compilation-database-1)\nrelated to your project should be provided to ensure files are properly\nprocessed. These files can usually be generated by the build system, and the\nserver will attempt to find them within your `build/` directory. If not\navailable in or a unique location, additional `tablegen_compile_commands.yml`\nfiles may be specified via the `mlir.tablegen_compilation_databases` setting.\nThe paths of these databases may be absolute or relative within your workspace.\n\n## Contributing\n\nThis extension is actively developed within the\n[LLVM monorepo](https://github.com/llvm/llvm-project), at\n[`mlir/utils/vscode`](https://github.com/llvm/llvm-project/tree/main/mlir/utils/vscode).\nAs such, contributions should follow the\n[normal LLVM guidelines](https://llvm.org/docs/Contributing.html), with code\nreviews sent to\n[GitHub](https://llvm.org/docs/Contributing.html#how-to-submit-a-patch).\n\nWhen developing or deploying this extension within the LLVM monorepo, a few\nextra setup steps are required:\n\n- Copy `mlir/utils/textmate/mlir.json` to the extension directory and rename to\n  `grammar.json`.\n- Copy `llvm/utils/textmate/tablegen.json` to the extension directory and rename\n  to `tablegen-grammar.json`.\n- Copy\n  `https://mlir.llvm.org//LogoAssets/logo/PNG/full_color/mlir-identity-03.png`\n  to the extension directory and rename to `icon.png`.\n\nPlease follow the existing code style when contributing to the extension, we\nrecommend to run `npm run format` before sending a patch.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fllvm%2Fvscode-mlir","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fllvm%2Fvscode-mlir","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fllvm%2Fvscode-mlir/lists"}