Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
d0098ce
minimal changes to inject new grammar into directives
phryneas Oct 18, 2024
2637e5c
minimal (wrong) syntax highlighting for body & selection
phryneas Oct 18, 2024
1ae4203
body...
phryneas Oct 18, 2024
5e7f3dd
first attempt at jsonselection textmate grammar
phryneas Oct 18, 2024
839a650
injection not working yet
phryneas Oct 18, 2024
53c4a31
embed jsonselection as language
phryneas Oct 23, 2024
e4c6c87
some minor highlighting
phryneas Oct 23, 2024
60814f7
change to new ebnf, start over
phryneas Oct 24, 2024
c30aaf4
progress
phryneas Oct 24, 2024
bda40e6
progress
phryneas Oct 28, 2024
d0d2c77
getting somewhere
phryneas Oct 28, 2024
ab78a30
JSONSelectionString
phryneas Oct 28, 2024
e20832b
add comments, snapshot tests
phryneas Oct 28, 2024
b1ff896
update one grammar, move things
phryneas Oct 28, 2024
0ea12de
uncomment
phryneas Oct 28, 2024
5b85408
flip some priorities
phryneas Oct 29, 2024
51c573d
allow leading underscore in identifiers/keys/aliases
phryneas Oct 29, 2024
39c29d2
allow PUT|PATCH|DELETE
phryneas Oct 29, 2024
2a72811
split out connect-jsonselection-nested-argument, test
phryneas Oct 29, 2024
8711cf3
add schema ref
phryneas Oct 29, 2024
7c1fd89
fix: correct handling of nested objects
phryneas Oct 30, 2024
1483930
special highlighting for `({` `})` bracket pairs
phryneas Oct 30, 2024
073162f
fix typo
phryneas Oct 30, 2024
4deca72
highlighting of `@`, `$.` and `$.foo`
phryneas Oct 30, 2024
810cf1a
undo `{(` grouping
phryneas Oct 30, 2024
5c2ea2f
set apart `{` in `JSONSelectionString` visually
phryneas Oct 30, 2024
07b9f61
redo accidental wrong edit
phryneas Oct 30, 2024
f433e14
update snapshots, run more tests in CI
phryneas Oct 31, 2024
304b70c
also write graphql.connectors with a yaml source
phryneas Oct 31, 2024
5738e9a
rename scope according to recommendations
phryneas Oct 31, 2024
c84606b
rename things to "Apollo Connectors Mapping Syntax"
phryneas Oct 31, 2024
4280f23
sort the language at the end of the list
phryneas Oct 31, 2024
9c2ede1
reduce diff to original graphql grammar
phryneas Oct 31, 2024
ca52e1f
add comments to document injection logic
phryneas Oct 31, 2024
37f9377
Merge remote-tracking branch 'origin/main' into pr/textmate
phryneas Jan 7, 2025
8ccd383
add accurate link
phryneas Jul 7, 2025
dffbbfa
add build script, extract common variables
phryneas Jul 8, 2025
c7acd53
WIP
phryneas Jul 8, 2025
3783595
more build logging
phryneas Jul 8, 2025
3cd4eb8
add "debug" mode to build step, remove hand-debugging names from grammar
phryneas Jul 9, 2025
8daa803
wip
phryneas Jul 9, 2025
60f0723
progress
phryneas Jul 9, 2025
3e7cf90
LitExpr mostly done
phryneas Jul 9, 2025
80f7d48
NamedSelection
phryneas Jul 9, 2025
da2d8ed
Merge commit 'dc6b7bb5c10272a506edb867a3f018b7b40193d3' as 'sampleWor…
phryneas Jul 9, 2025
dc6b7bb
Squashed 'sampleWorkspace/connectors-community/' content from commit …
phryneas Jul 9, 2025
053d752
add connectors to sampleWorkspace
phryneas Jul 9, 2025
58e3179
add command to update subtree, semgrep
phryneas Jul 10, 2025
2f5c129
add back `NamedFieldSelection`
phryneas Jul 10, 2025
20b07fc
extract styling
phryneas Jul 10, 2025
c7e131e
adjust semgrepignore
phryneas Jul 10, 2025
1cab50a
fix up cross-referencing styles
phryneas Jul 10, 2025
7ef7363
test1
phryneas Jul 10, 2025
2a234cd
embed test
phryneas Jul 10, 2025
79543bf
allow comments
phryneas Jul 10, 2025
0715cf0
add circleCI run
phryneas Jul 10, 2025
6a41e1c
re-add working dir
phryneas Jul 10, 2025
ad0d4e1
add job to workflow
phryneas Jul 10, 2025
5735652
allow for single-line selection string
phryneas Jul 10, 2025
9377d31
more one-line string handling
phryneas Jul 10, 2025
dcfeeab
CI
phryneas Jul 10, 2025
add545a
rename file
phryneas Jul 10, 2025
56eda2d
remove "Run other tests" step
phryneas Jul 10, 2025
52c4604
basic addition for headers
phryneas Jul 10, 2025
1045a89
apply to `@connect` and `@source`
phryneas Jul 10, 2025
0bfd99f
multiline string support
phryneas Jul 11, 2025
9dfe949
highlight string contents
phryneas Jul 11, 2025
d5b2b05
highlight known builtin functions
phryneas Jul 11, 2025
91fc53b
change property/aliases to be more in line with graphql highlighting
phryneas Jul 11, 2025
a52c6b4
Squashed 'sampleWorkspace/connectors-community/' changes from 31a2203…
phryneas Jul 11, 2025
4c2fb07
Merge commit 'a52c6b4b839001d2c18e63080e41193539dbd4d6' into pr/textmate
phryneas Jul 11, 2025
cd985b5
highlight embedded quotes
phryneas Jul 11, 2025
f6dd085
rename all jsonselection to connectors.mapping
phryneas Jul 11, 2025
3db4ab8
"change language" in embedded selection string
phryneas Jul 11, 2025
97b5cac
add `oniguruma-parser/optimizer` to build step
phryneas Jul 14, 2025
f24e9a5
add option
phryneas Jul 14, 2025
b31cdc5
review session with Dylan
phryneas Jul 15, 2025
4bc1050
add changeset
phryneas Jul 15, 2025
59a455f
Merge branch 'main' into pr/textmate
phryneas Jul 15, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/rare-frogs-melt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"vscode-apollo": minor
---

Add syntax highlighting for the Apollo Connectors Mapping language
17 changes: 17 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ executors:
docker:
- image: cimg/node:22.12.0
working_directory: ~/vscode-graphql
node24:
docker:
- image: cimg/node:24.4.0
working_directory: ~/vscode-graphql

commands:
npm-install:
Expand Down Expand Up @@ -53,12 +57,25 @@ jobs:
name: Test
command: npm run test -- --runInBand

textmate:
executor: node24
steps:
- checkout
- npm-install
- run:
name: Build TextMate Grammar
command: npm run build:textmate
- run:
name: Test TextMate Grammar
command: npm run test:textmate

workflows:
build-test-deploy:
jobs:
- lint
- typescript
- test
- textmate
security-scans:
jobs:
- secops/gitleaks:
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/E2E.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches:
- main
jobs:
test:
e2e:
name: Run E2E tests
runs-on: "${{ matrix.os }}"
strategy:
Expand All @@ -22,7 +22,8 @@ jobs:
- uses: actions/setup-node@v4
with:
cache: "npm"
- run: npm install
node-version: 24
- run: npm ci
- run: echo 'APOLLO_KEY="service:bob-123:489fhseo4"' > ./sampleWorkspace/spotifyGraph/.env
shell: bash

Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/build-prs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ jobs:
- uses: actions/setup-node@v4
with:
cache: "npm"
- run: npm install
node-version: 24
- run: npm ci
- run: echo PKG_VERSION="$(git show --no-patch --format=0.0.0-build-%ct.pr-${{ github.event.pull_request.number }}.commit-%h)" >> $GITHUB_ENV
- run: npm pkg set "version=${{ env.PKG_VERSION }}"
- run: npx -y @vscode/vsce package --out vscode-apollo-${{ env.PKG_VERSION }}.vsix
Expand Down
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
src/language-server/graphqlTypes.ts
src/language-server/__tests__/fixtures/documents/commentWithTemplate.ts
schemas/*.json
syntaxes/*.json
src/__tests__/fixtures/textmate/*
README.md
2 changes: 2 additions & 0 deletions .semgrepignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
sampleWorkspace/connectors-community/**
syntaxes/build.ts
9 changes: 7 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
{
"editor.tabSize": 2,
"editor.insertSpaces": true,
"editor.rulers": [110],
"editor.rulers": [
110
],
"editor.wordWrapColumn": 110,
"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true,
Expand All @@ -12,5 +14,8 @@
"node_modules": false
},
"typescript.tsdk": "node_modules/typescript/lib",
"debug.node.autoAttach": "on"
"debug.node.autoAttach": "on",
"yaml.schemas": {
"https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json": "/syntaxes/*.yaml"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found this JSONSchema which somehow adds a tiny little bit of documentation to the textmate format.

}
}
10 changes: 10 additions & 0 deletions apollo.connectors.mapping.configuration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"comments": {
"lineComment": "#"
},
"brackets": [
["[", "]"],
["{", "}"],
["(", ")"]
]
}
8 changes: 8 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 36 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@
"types": "lib/index.d.ts",
"scripts": {
"build": "node ./src/build.js",
"build:full": "npm run typecheck && rimraf lib && npm run build --",
"build:full": "npm run typecheck && rimraf lib && npm run build -- && npm run build:textmate",
"build:production": "npm run build:full -- --production",
"build:textmate": "node ./syntaxes/build.ts",
"watch": "rimraf lib; npm-run-all -p watch:*",
"watch:esbuild": "npm run build -- --watch",
"watch:tsc": "npm run typecheck -- --watch",
"watch:textmate-yaml": "npm run build:textmate -- --debug --watch",
"sampleWorkspace:run": "node src/__e2e__/mockServer.js",
"changeset-version": "changeset version && npm i",
"changeset-publish": "npm run build -- --production && changeset publish",
Expand All @@ -29,7 +31,11 @@
"format": "prettier --write .",
"test": "NODE_OPTIONS=--experimental-vm-modules jest",
"test:extension": "node src/__e2e__/runTests.js",
"test:textmate": "npx vscode-tmgrammar-snap -s source.ts -g src/language-server/__tests__/fixtures/TypeScript.tmLanguage.json src/language-server/__tests__/fixtures/documents/*.ts",
"test:textmate": "npm run test:textmate-ts && npm run test:textmate-connectors-mapping && npm run test:textmate-graphql-connectors-mapping",
"test:textmate-ts": "npx vscode-tmgrammar-snap -s source.ts -g src/language-server/__tests__/fixtures/TypeScript.tmLanguage.json src/language-server/__tests__/fixtures/documents/*.ts",
"test:textmate-connectors-mapping": "npm run build:textmate -- --snapshot connectors.mapping.yaml; npx vscode-tmgrammar-test src/__tests__/fixtures/textmate/*.connectors.mapping",
"test:textmate-graphql-connectors-mapping": "npm run build:textmate -- --snapshot connectors.mapping.yaml; npx vscode-tmgrammar-test src/__tests__/fixtures/textmate/*.graphql",
"update-connectors-community": "git subtree pull --prefix sampleWorkspace/connectors-community https://github.com/apollographql/connectors-community.git main --squash",
"codegen": "graphql-codegen",
"vscode:prepublish": "npm run build:production"
},
Expand Down Expand Up @@ -93,6 +99,7 @@
"jest-environment-node": "29.7.0",
"memfs": "4.15.0",
"npm-run-all": "4.1.5",
"oniguruma-parser": "^0.12.1",
"prettier": "3.4.2",
"rimraf": "6.0.1",
"ts-jest": "29.2.5",
Expand Down Expand Up @@ -172,6 +179,16 @@
],
"configuration": "./graphql.configuration.json"
},
{
"id": "apollo.connectors.mapping",
"aliases": [
"[Apollo Connectors Mapping Syntax]"
],
"filenames": [
"test.apollo.connectors.mapping"
],
"configuration": "./apollo.connectors.mapping.configuration.json"
},
{
"id": "jsonc",
"filenames": [
Expand All @@ -185,6 +202,23 @@
"scopeName": "source.graphql",
"path": "./syntaxes/graphql.json"
},
{
"language": "apollo.connectors.mapping",
"scopeName": "source.apollo.connectors.mapping",
"path": "./syntaxes/connectors.mapping.json"
},
{
"injectTo": [
"source.graphql"
],
"scopeName": "source.apollo.connectors.graphql",
"path": "./syntaxes/graphql.connectors.json",
"embeddedLanguages": {
"meta.embedded.block.connectors.mapping.graphql": "apollo.connectors.mapping",
"meta.embedded.line.connectors.mapping.graphql": "apollo.connectors.mapping",
"meta.embedded.string.connectors.mapping.selectionstring.graphql": "apollo.connectors.mapping"
}
},
{
"injectTo": [
"source.js",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
name: Connector Bug Report
about: Create a report to help us fix a connector issue
title: "[Connector Name] - Bug Title"
labels: bug
assignees: michael-watson

---

**Connector**:
**Connector Module**: *if any*

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Start [Connector Name] name
2. Execute this operation:

```graphql
query {

}
```

3. Results:

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Additional context or recommended fixes**
Add any other context about the problem here.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
name: New Connector
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this intentionally a full clone of that repo? Should we trim out some bits like this one?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's a subtree as that's the easiest way to keep those in sync.

git subtree pull --prefix sampleWorkspace/connectors-community https://github.com/apollographql/connectors-community.git main --squash

There are ways of syncing with subfolders of subtrees, but honestly that didn't seem to be worth the added complexity.

about: To create a new connector that is available in the connectors-community
title: "{NAME} Connector"
labels: new
assignees: ''

---


3 changes: 3 additions & 0 deletions sampleWorkspace/connectors-community/.github/renovate.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json"
}
6 changes: 6 additions & 0 deletions sampleWorkspace/connectors-community/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.env

.DS_Store
*/.DS_Store

node_modules
3 changes: 3 additions & 0 deletions sampleWorkspace/connectors-community/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["apollographql.vscode-apollo","redhat.vscode-yaml"]
}
13 changes: 13 additions & 0 deletions sampleWorkspace/connectors-community/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"terminal.integrated.profiles.osx": {
"graphos": {
"path": "zsh",
"args": ["-l"],
"env": {
"APOLLO_KEY": "",
"APOLLO_GRAPH_REF": "",
}
}
},
"terminal.integrated.defaultProfile.osx": "graphos"
}
10 changes: 10 additions & 0 deletions sampleWorkspace/connectors-community/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"version": "2.0.0",
"tasks": [{
"label": "rover dev",
"command": "rover", // Could be any other shell command
"args": ["dev", "--supergraph-config","supergraph.yaml", "--router-config","router.yaml"],
"type": "shell",
"problemMatcher": [],
}]
}
Loading
Loading