Problem statement
The extension currently registers a custom gitlab-ci language for .gitlab-ci.yml and .gitlab-ci.yaml files (see contributes.languages and contributes.grammars in package.json). This claims the language ID away from VS Code's built-in yaml, which has two consequences:
- Red Hat's YAML extension stops working on GitLab CI files. Once the document's language ID is
gitlab-ci rather than yaml, Red Hat's schema validation, formatting, folding, and GitLab CI schema integration no longer fire. Users lose the richest YAML experience on exactly the files where they need it most.
- The custom grammar adds limited value over the built-in YAML grammar. It recolours roughly 13 well-known top-level keys (
image:, stages:, include:, etc.) to slightly different TextMate scopes. It also defines a gitlab-ci-components rule keyed off a job-name suffix convention that doesn't match how GitLab actually identifies components in CI files, and two further rules (job-definition, job-keywords) that are declared in the grammar's repository but aren't referenced from the top-level patterns block, so they don't run. There's also no embedded shell highlighting inside script: blocks, no !reference handling, and no $CI_* variable highlighting — the kinds of things that would be a meaningful upgrade over plain YAML.
The net effect is that the extension takes a significant feature (full YAML tooling) away from users in exchange for relatively minor cosmetic differences.
Proposed solution
Remove the contributes.languages and contributes.grammars entries from package.json and delete the now-unused syntaxes/gitlab-ci.tmLanguage.json and language-configuration.json files. .gitlab-ci.yml files will then keep their natural yaml language ID and be handled by Red Hat's YAML extension (or the built-in YAML grammar if Red Hat isn't installed).
The extension's own providers (hover, completion, validation, code actions) already register against language: 'yaml' and filter by filename — they will keep working unchanged. The dead { language: 'gitlab-ci' } selectors and the document.languageId === 'gitlab-ci' defensive branches can be removed at the same time.
Optionally, add "extensionPack": ["redhat.vscode-yaml"] to nudge users to install the Red Hat YAML extension alongside this one.
Example .gitlab-ci.yml usage
Command/UI impact
New command: none.
Setting changes: none.
Browser/hover/completion changes: hover, completion, validation, and code action providers register against language: 'yaml' only; the redundant { language: 'gitlab-ci' } selectors are removed. User-visible behaviour for these providers is unchanged because the filename-based filter is the load-bearing check.
Acceptance criteria
Priority
Important
Alternatives considered
- Add a setting to disable the language contribution at runtime. Not viable: VS Code reads
contributes.languages and contributes.grammars from package.json at extension-load time only; there is no API to unregister a language contribution from activate(). A setting could only mutate the user's files.associations, which is surprising behaviour and still requires a reload.
- Switch to an injection grammar (
injectTo: ["source.yaml"]). Architecturally the most correct alternative — layers GitLab-specific scopes on top of the host YAML grammar without claiming the language ID. Rejected because the current grammar's actual contribution is minimal and largely redundant; the cost/benefit doesn't justify the work over simply removing it.
- Document the user workaround (
files.associations override). Useful as a transitional note but doesn't fix the default experience for users who never read the README.
Target GitLab instance(s)
both
Pre-submit checks
Problem statement
The extension currently registers a custom
gitlab-cilanguage for.gitlab-ci.ymland.gitlab-ci.yamlfiles (seecontributes.languagesandcontributes.grammarsinpackage.json). This claims the language ID away from VS Code's built-inyaml, which has two consequences:gitlab-cirather thanyaml, Red Hat's schema validation, formatting, folding, and GitLab CI schema integration no longer fire. Users lose the richest YAML experience on exactly the files where they need it most.image:,stages:,include:, etc.) to slightly different TextMate scopes. It also defines agitlab-ci-componentsrule keyed off a job-name suffix convention that doesn't match how GitLab actually identifies components in CI files, and two further rules (job-definition,job-keywords) that are declared in the grammar'srepositorybut aren't referenced from the top-levelpatternsblock, so they don't run. There's also no embedded shell highlighting insidescript:blocks, no!referencehandling, and no$CI_*variable highlighting — the kinds of things that would be a meaningful upgrade over plain YAML.The net effect is that the extension takes a significant feature (full YAML tooling) away from users in exchange for relatively minor cosmetic differences.
Proposed solution
Remove the
contributes.languagesandcontributes.grammarsentries frompackage.jsonand delete the now-unusedsyntaxes/gitlab-ci.tmLanguage.jsonandlanguage-configuration.jsonfiles..gitlab-ci.ymlfiles will then keep their naturalyamllanguage ID and be handled by Red Hat's YAML extension (or the built-in YAML grammar if Red Hat isn't installed).The extension's own providers (hover, completion, validation, code actions) already register against
language: 'yaml'and filter by filename — they will keep working unchanged. The dead{ language: 'gitlab-ci' }selectors and thedocument.languageId === 'gitlab-ci'defensive branches can be removed at the same time.Optionally, add
"extensionPack": ["redhat.vscode-yaml"]to nudge users to install the Red Hat YAML extension alongside this one.Example .gitlab-ci.yml usage
N/ACommand/UI impact
New command: none.
Setting changes: none.
Browser/hover/completion changes: hover, completion, validation, and code action providers register against
language: 'yaml'only; the redundant{ language: 'gitlab-ci' }selectors are removed. User-visible behaviour for these providers is unchanged because the filename-based filter is the load-bearing check.Acceptance criteria
.gitlab-ci.ymlfile shows language IDyamlin the status bar..gitlab-ci.ymlfiles.include: - component:line still shows the component card.component:and versions after@.npm run check-typespasses;npm testpasses.Priority
Important
Alternatives considered
contributes.languagesandcontributes.grammarsfrompackage.jsonat extension-load time only; there is no API to unregister a language contribution fromactivate(). A setting could only mutate the user'sfiles.associations, which is surprising behaviour and still requires a reload.injectTo: ["source.yaml"]). Architecturally the most correct alternative — layers GitLab-specific scopes on top of the host YAML grammar without claiming the language ID. Rejected because the current grammar's actual contribution is minimal and largely redundant; the cost/benefit doesn't justify the work over simply removing it.files.associationsoverride). Useful as a transitional note but doesn't fix the default experience for users who never read the README.Target GitLab instance(s)
both
Pre-submit checks