Skip to content

Commit 8d2f68a

Browse files
authored
fix: begin adding semantics to parser package (#3)
* chore: init workflows chore: bump vite chore: wip symbols chore: wip chore: more chore: modifiers chore: methods and symbol modifiers chore: fix sample code in test to use single quote chore: add semantic tests chore: wip semantic/syntax error capture chore: fix lexer error listener type chore: duplicate symbols chore: duplicate symbol tests chore: remove dup checks for class,interface,enum chore: fix modifiers for interfaces chore: record modifers at symbol exit chore: modifiers fixed chore: remove unneeded condition * chore: modifier semantics * chore: modifier semantics * refactor: modifier validation to separate artifacts * refactor: interface modifiers * refactor: modifiers in interfaces * chore: add interface semantics test * chore: capture variable declarations * chore: remove unneeded source file * chore: fqn * chore: add namespace to compiler service * chore: fqn tests * chore: add std apex library * chore: add std apex classes * chore: use URIs to expose std apex resources * chore: add annotations * chore: annotation sematics * build: project code coverage * chore: remove old test * chore: extension tests w/o vscode is hard * chore: inheritence * chore: inner class semantics name cannot be same as outer class inner classes cannot contain inner classes * chore: improve unit code coverage * chore: remove for now * chore: update package-lock * chore: resolve conflicts * chore: fix codeowners * chore: fix build and run for vscode extension
1 parent e167bb2 commit 8d2f68a

File tree

4,794 files changed

+91559
-7246
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

4,794 files changed

+91559
-7246
lines changed

.github/CODEOWNERS

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# CODEOWNERS adds reviewers depending on the location of the change.
2+
# Each line is a file pattern followed by one or more owners.
3+
# Order is important; the last matching pattern takes the most
4+
# precedence. When someone opens a pull request that only
5+
# modifies JS files, only @js-owner and not the global
6+
# owner(s) will be requested for a review.
7+
# These owners will be the default owners for everything in
8+
# the repo. Unless a later match takes precedence,
9+
# @forcedotcom/ide-experience will be requested for
10+
# review when someone opens a pull request.
11+
12+
#ECCN:Open Source
13+
#GUSINFO: Platform Dev Tools Scrum Team, IDE Experience Team
14+
* @forcedotcom/ide-experience
15+
16+
# Package specific owners
17+
/packages/apex-parser-ast/ @forcedotcom/ide-experience
18+
/packages/lsp-compliant-services/ @forcedotcom/ide-experience
19+
/packages/custom-services/ @forcedotcom/ide-experience
20+
/packages/web-apex-ls-ts/ @forcedotcom/ide-experience
21+
/packages/extension-apex-ls-ts/ @forcedotcom/ide-experience

.github/dependabot.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "npm"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
labels:
8+
- "dependencies"
9+
open-pull-requests-limit: 10
10+
11+
- package-ecosystem: "github-actions"
12+
directory: "/"
13+
schedule:
14+
interval: "weekly"
15+
labels:
16+
- "dependencies"

.github/scripts/slack-notify.js

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
module.exports = async ({ github, context, core }) => {
2+
const axios = require('axios');
3+
4+
try {
5+
const repoName = context.repo.repo;
6+
const owner = context.repo.owner;
7+
const runId = context.runId;
8+
const runNumber = context.runNumber;
9+
const workflowName = context.workflow;
10+
const sha = context.sha;
11+
const ref = context.ref;
12+
const eventName = context.eventName;
13+
14+
const isSuccess = context.job === 'success';
15+
const status = isSuccess ? 'Success' : 'Failure';
16+
const color = isSuccess ? '#36a64f' : '#ff0000';
17+
18+
const commitMessage = await github.rest.repos
19+
.getCommit({
20+
owner,
21+
repo: repoName,
22+
ref: sha,
23+
})
24+
.then((res) => res.data.commit.message.split('\n')[0]);
25+
26+
const runUrl = `https://github.com/${owner}/${repoName}/actions/runs/${runId}`;
27+
28+
const payload = {
29+
attachments: [
30+
{
31+
color,
32+
fallback: `${repoName} publish ${status}: ${runUrl}`,
33+
blocks: [
34+
{
35+
type: 'section',
36+
text: {
37+
type: 'mrkdwn',
38+
text: `*${repoName}* publish *${status}*`,
39+
},
40+
},
41+
{
42+
type: 'section',
43+
fields: [
44+
{
45+
type: 'mrkdwn',
46+
text: `*Workflow:*\n${workflowName}`,
47+
},
48+
{
49+
type: 'mrkdwn',
50+
text: `*Run:*\n<${runUrl}|#${runNumber}>`,
51+
},
52+
{
53+
type: 'mrkdwn',
54+
text: `*Branch:*\n${ref.replace('refs/heads/', '')}`,
55+
},
56+
{
57+
type: 'mrkdwn',
58+
text: `*Event:*\n${eventName}`,
59+
},
60+
{
61+
type: 'mrkdwn',
62+
text: `*Commit:*\n${sha.substring(0, 7)}`,
63+
},
64+
{
65+
type: 'mrkdwn',
66+
text: `*Message:*\n${commitMessage}`,
67+
},
68+
],
69+
},
70+
],
71+
},
72+
],
73+
};
74+
75+
await axios.post(process.env.SLACK_WEBHOOK_URL, payload);
76+
} catch (error) {
77+
core.setFailed(`Slack notification failed: ${error.message}`);
78+
}
79+
};

.github/workflows/automerge.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Automerge
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- labeled
7+
- unlabeled
8+
- synchronize
9+
- opened
10+
- edited
11+
- ready_for_review
12+
- reopened
13+
- unlocked
14+
check_suite:
15+
types:
16+
- completed
17+
status: ~
18+
19+
jobs:
20+
auto-merge:
21+
runs-on: ubuntu-latest
22+
if: github.actor == 'dependabot[bot]' || contains(github.event.pull_request.labels.*.name, 'automerge')
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v4
26+
27+
- name: Automerge
28+
uses: pascalgn/automerge-action@v0.15.6
29+
env:
30+
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
31+
MERGE_LABELS: 'automerge,dependencies'
32+
MERGE_METHOD: 'squash'
33+
MERGE_RETRIES: '6'
34+
MERGE_RETRY_SLEEP: '10000'
35+
MERGE_REQUIRED_APPROVALS: '1'

.github/workflows/ci.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
workflow_dispatch:
9+
10+
jobs:
11+
test:
12+
name: Test
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
18+
- name: Setup Node.js
19+
uses: salesforcecli/github-workflows/.github/actions/setup-node@main
20+
21+
- name: Install dependencies
22+
run: npm ci
23+
24+
- name: Lint
25+
run: npm run lint
26+
27+
- name: Build
28+
run: npm run build
29+
30+
- name: Test
31+
run: npm test
32+
33+
- name: Upload code coverage
34+
uses: codecov/codecov-action@v4
35+
with:
36+
token: ${{ secrets.CODECOV_TOKEN }}
37+
file: ./coverage/lcov.info
38+
flags: unit
39+
40+
slack-notify:
41+
name: Slack Notification
42+
needs: [test]
43+
runs-on: ubuntu-latest
44+
if: always() && github.event_name == 'push' && github.ref == 'refs/heads/main'
45+
steps:
46+
- name: Notify Slack
47+
uses: salesforcecli/github-workflows/.github/actions/slack-notify@main
48+
with:
49+
channel-id: ${{ secrets.SLACK_CHANNEL_ID }}
50+
slack-token: ${{ secrets.SLACK_BOT_TOKEN }}
51+
status: ${{ needs.test.result }}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: 'CodeQL'
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
# The branches below must be a subset of the branches above
8+
branches: [main]
9+
schedule:
10+
- cron: '0 8 * * 1'
11+
12+
jobs:
13+
analyze:
14+
name: Analyze
15+
runs-on: ubuntu-latest
16+
permissions:
17+
actions: read
18+
contents: read
19+
security-events: write
20+
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
language: ['javascript']
25+
26+
steps:
27+
- name: Checkout repository
28+
uses: actions/checkout@v4
29+
30+
- name: Initialize CodeQL
31+
uses: github/codeql-action/init@v2
32+
with:
33+
languages: ${{ matrix.language }}
34+
35+
- name: Autobuild
36+
uses: github/codeql-action/autobuild@v2
37+
38+
- name: Perform CodeQL Analysis
39+
uses: github/codeql-action/analyze@v2

.github/workflows/pr-checks.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: PR Checks
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
types: [opened, synchronize, reopened, ready_for_review]
7+
8+
jobs:
9+
dependency-review:
10+
name: Dependency Review
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
16+
- name: Dependency Review
17+
uses: actions/dependency-review-action@v3
18+
with:
19+
fail-on-severity: high
20+
21+
commitlint:
22+
name: Lint Commit Messages
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v4
27+
with:
28+
fetch-depth: 0
29+
30+
- name: Setup Node.js
31+
uses: actions/setup-node@v4
32+
with:
33+
node-version: '18.x'
34+
35+
- name: Install dependencies
36+
run: npm ci
37+
38+
- name: Lint commit messages
39+
run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose

.github/workflows/publish.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Publish NPM Packages
2+
3+
on:
4+
release:
5+
types: [created]
6+
workflow_dispatch:
7+
inputs:
8+
version:
9+
description: 'Version to publish (e.g., 1.0.0)'
10+
required: true
11+
type: string
12+
13+
jobs:
14+
publish:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
20+
- name: Setup Node.js
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: '18.x'
24+
registry-url: 'https://registry.npmjs.org'
25+
26+
- name: Install dependencies
27+
run: npm ci
28+
29+
- name: Build
30+
run: npm run build
31+
32+
- name: Publish apex-parser-ast
33+
working-directory: packages/apex-parser-ast
34+
run: npm publish --access public
35+
env:
36+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
37+
38+
- name: Publish lsp-compliant-services
39+
working-directory: packages/lsp-compliant-services
40+
run: npm publish --access public
41+
env:
42+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
43+
44+
- name: Publish web-apex-ls-ts
45+
working-directory: packages/web-apex-ls-ts
46+
run: npm publish --access public
47+
env:
48+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
49+
50+
- name: Slack Notification
51+
uses: actions/github-script@v7
52+
if: always()
53+
with:
54+
github-token: ${{ secrets.GITHUB_TOKEN }}
55+
script: |
56+
const script = require('.github/scripts/slack-notify.js')
57+
await script({github, context, core})
58+
env:
59+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

.github/workflows/release.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
jobs:
8+
release:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v4
13+
with:
14+
fetch-depth: 0
15+
persist-credentials: false
16+
17+
- name: Setup Node.js
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: '18.x'
21+
22+
- name: Install dependencies
23+
run: npm ci
24+
25+
- name: Build
26+
run: npm run build
27+
28+
- name: Test
29+
run: npm test
30+
31+
- name: Release
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN || secrets.GITHUB_TOKEN }}
34+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
35+
run: npx semantic-release

0 commit comments

Comments
 (0)