Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 3 additions & 5 deletions biome.jsonc
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
{
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"organizeImports": {
Copy link
Owner

Choose a reason for hiding this comment

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

Is organizeImports no longer supported in Biome 2.x? You can actually leave this to me, I've updated some of my projects and would love to continue using my config.

"enabled": true
},
"root": false,
"$schema": "https://biomejs.dev/schemas/2.2.0/schema.json",
"files": {
"ignore": ["lib/**", "node_modules/**", "pnpm-lockfile.yaml"]
"includes": ["**", "!**/lib", "!**/node_modules", "!**/pnpm-lockfile.yaml"]
},
"linter": {
"enabled": true,
Expand Down
50 changes: 40 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,14 @@
"engines": {
"vscode": "^1.85.0"
},
"categories": ["Programming Languages", "Snippets", "Other"],
"activationEvents": ["onLanguage:javascript"],
"categories": [
"Programming Languages",
"Snippets",
"Other"
],
"activationEvents": [
"onLanguage:javascript"
],
"contributes": {
"configurationDefaults": {
"[applescript]": {
Expand Down Expand Up @@ -80,7 +86,11 @@
},
"applescript.defaultBuildTask": {
"type": "string",
"enum": ["script", "bundle", "app"],
"enum": [
"script",
"bundle",
"app"
],
"default": "script",
"description": "Specify the default build task when creating a new task file",
"order": 5
Expand Down Expand Up @@ -366,21 +376,38 @@
"languages": [
{
"id": "applescript",
"aliases": ["AppleScript", "applescript"],
"extensions": [".applescript"],
"aliases": [
"AppleScript",
"applescript"
],
"extensions": [
".applescript"
],
"firstLine": "^#!/.*\\bosascript\\b",
"configuration": "./config/applescript.configuration.json"
},
{
"id": "applescript.binary",
"aliases": ["Binary AppleScript", "applescript.binary", "scpt"],
"extensions": [".scpt"],
"aliases": [
"Binary AppleScript",
"applescript.binary",
"scpt"
],
"extensions": [
".scpt"
],
"configuration": "./config/applescript.configuration.json"
},
{
"id": "jxa",
"aliases": ["JavaScript for Automation (JXA)", "jxa"],
"extensions": [".jxa", ".jxainc"],
"aliases": [
"JavaScript for Automation (JXA)",
"jxa"
],
"extensions": [
".jxa",
".jxainc"
],
"configuration": "./config/jxa.configuration.json"
},
{
Expand Down Expand Up @@ -420,7 +447,9 @@
"language": "applescript-injection",
"scopeName": "markdown.applescript.codeblock",
"path": "./syntaxes/codeblock.json",
"injectTo": ["text.html.markdown"],
"injectTo": [
"text.html.markdown"
],
"embeddedLanguages": {
"meta.embedded.block.applescript": "applescript"
}
Expand All @@ -438,6 +467,7 @@
]
},
"dependencies": {
"acorn": "^8.15.0",
"line-column": "^1.0.2",
"vscode-get-config": "^0.4.0"
},
Expand Down
76 changes: 38 additions & 38 deletions pnpm-lock.yaml

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

14 changes: 13 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
import { type ExtensionContext, commands } from 'vscode';
import { commands, type ExtensionContext, languages } from 'vscode';
import { osacompile, osascript } from './osa.ts';
import { appleScriptSymbolProvider } from './outline.ts';
import { jxaSymbolProvider } from './outline-jxa.ts';
import { pick } from './processes.ts';
import { createBuildTask } from './task.ts';

/**
* Activate the VS Code extension.
*
* This registers editor/command handlers for AppleScript and JXA workflows
* (run, compile, build task creation, termination) and hooks the document
* symbol providers for the `applescript` and `jxa` languages.
*/
async function activate(context: ExtensionContext): Promise<void> {
context.subscriptions.push(
/**
Expand Down Expand Up @@ -66,6 +75,9 @@ async function activate(context: ExtensionContext): Promise<void> {
commands.registerTextEditorCommand('extension.jxa.terminateProcess', async () => {
await pick();
}),

languages.registerDocumentSymbolProvider({ language: 'applescript' }, appleScriptSymbolProvider),
languages.registerDocumentSymbolProvider({ language: 'jxa' }, jxaSymbolProvider),
);
}

Expand Down
Loading
Loading