-
Notifications
You must be signed in to change notification settings - Fork 1k
Add lightweight multi-language snippet system #2071
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
1055c61
feat: add lightweight multi-language snippet system
DaviGayDaSilva 8343e20
Merge pull request #1 from DaviGayDaSilva/codex/fork-acode-to-add-sni…
DaviGayDaSilva 56c739b
Update src/settings/editorSettings.js
UnschooledGamer 0be6e95
fix(snippets): wire manager action and guard language picker cancel
DaviGayDaSilva 02f86ff
Merge branch 'main' into codex/fork-acode-to-add-snippet-system-4n4m0r
DaviGayDaSilva 382340e
Merge pull request #2 from DaviGayDaSilva/codex/fork-acode-to-add-sni…
DaviGayDaSilva a4f4502
Add GitHub Actions workflow for PR checks
DaviGayDaSilva e78800f
Set LF line endings for shell scripts
DaviGayDaSilva d36d6bf
Update CI workflow for PR checks and linting
DaviGayDaSilva File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,33 @@ | ||
| # Normalize all text files to LF in the repository | ||
| * text=auto eol=lf | ||
|
|
||
| # Common text/code files | ||
| *.js text eol=lf | ||
| *.ts text eol=lf | ||
| *.json text eol=lf | ||
| *.yml text eol=lf | ||
| *.yaml text eol=lf | ||
| *.md text eol=lf | ||
| *.css text eol=lf | ||
| *.html text eol=lf | ||
| *.xml text eol=lf | ||
| *.sh text eol=lf | ||
|
|
||
| # Windows scripts keep CRLF | ||
| *.bat text eol=crlf | ||
| *.cmd text eol=crlf | ||
|
|
||
| # Binary files | ||
| *.png binary | ||
| *.jpg binary | ||
| *.jpeg binary | ||
| *.gif binary | ||
| *.webp binary | ||
| *.ico binary | ||
| *.keystore binary | ||
| *.jks binary | ||
| *.jar binary | ||
| *.apk binary | ||
|
|
||
| # Change | ||
| *.sh text eol=lf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [main] | ||
| push: | ||
| branches: [main, work] | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: ci-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| quality: | ||
| name: Linting and formatting | ||
| runs-on: ubuntu-24.04 | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 20 | ||
| cache: npm | ||
|
|
||
| - name: Install dependencies | ||
| run: npm ci | ||
|
|
||
| - name: Run Biome CI | ||
| run: npx biome ci . | ||
|
|
||
| - name: Typecheck | ||
| run: npm run typecheck |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
snippetLanguageIdis evaluated once inapplyFileToEditorand then closed over in both the completion source and the Tab keymap. If the user later changes the file's language (mode) without re-opening the file, the snippet engine will keep using the stale language ID. The existinglanguageCompartment.reconfigure()path won't update these closures. Consider deriving the language ID dynamically from the view's state inside both callbacks instead.