Skip to content

Commit 298059d

Browse files
committed
fix: v0.4.0 Add .kasm to activate language server
1 parent a2380a7 commit 298059d

File tree

4 files changed

+30
-15
lines changed

4 files changed

+30
-15
lines changed

README.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ All syntax highlighting and code analysis comes from the **kickass_ls** language
1616

1717
### Kick Assembler Integration
1818

19-
- Assemble `.asm` and `.s` files with Kick Assembler
19+
- Assemble `.asm` and `.kasm` files with Kick Assembler
2020
- Errors and warnings appear in the Problems panel
2121
- Detailed output in the "Kick Assembler" output channel
2222
- 60-second timeout protection for long-running builds
@@ -175,11 +175,20 @@ All shortcuts are active when editing Kick Assembler files.
175175
| `Ctrl+Shift+U` | `Cmd+Shift+U` | Assemble, Upload and Run on C64 Ultimate |
176176
| `Ctrl+Shift+B` | `Cmd+Shift+B` | C64U File Browser |
177177

178+
## Supported File Extensions
179+
180+
| Extension | Description |
181+
| --------- | ----------- |
182+
| `.asm` | Standard assembler file — the language server activates for all `.asm` files regardless of the detected language |
183+
| `.kasm` | Kick Assembler file — always recognized as Kick Assembler, use this to avoid conflicts with other assembler extensions (e.g. HLASM) |
184+
185+
If another extension claims the `.asm` file association, the language server still activates via file pattern matching. For guaranteed Kick Assembler detection, rename your files to `.kasm`.
186+
178187
## Usage
179188

180189
### Basic Workflow
181190

182-
1. Open a `.asm` or `.s` file — syntax highlighting and diagnostics activate automatically
191+
1. Open a `.asm` or `.kasm` file — syntax highlighting and diagnostics activate automatically
183192
2. Assemble with `Ctrl+Shift+A` — errors appear in the Problems panel
184193
3. Run with `Ctrl+Shift+R` — launches VICE with your program
185194
4. Or combine with `Ctrl+Shift+X` — assembles and runs in one step
@@ -246,8 +255,10 @@ Releases are built automatically via GitHub Actions when a version tag is pushed
246255

247256
### Language Server Not Starting
248257

249-
1. Check that `kickass_ls` is installed and in PATH, or use the bundled binary
250-
2. Or configure an explicit path:
258+
1. Make sure your file has a `.asm` or `.kasm` extension
259+
2. If another extension claims `.asm` files, rename to `.kasm` or change the language mode to "Kick Assembler" in the VS Code status bar
260+
3. Check that `kickass_ls` is installed and in PATH, or use the bundled binary
261+
4. Or configure an explicit path:
251262

252263
```json
253264
{ "c64.kickassLsBinary": "/usr/local/bin/kickass_ls" }

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "c64-vscode",
33
"displayName": "C64 Assembler Development",
44
"description": "Complete C64 development environment with Kick Assembler, LSP support, VICE emulator, and C64 Ultimate integration",
5-
"version": "0.3.0",
5+
"version": "0.4.0",
66
"publisher": "cybersorcerer",
77
"license": "Apache-2.0",
88
"repository": {
@@ -58,7 +58,7 @@
5858
],
5959
"extensions": [
6060
".asm",
61-
".s"
61+
".kasm"
6262
],
6363
"configuration": "./language-configuration.json"
6464
}

src/extension.ts

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ export function activate(context: vscode.ExtensionContext) {
162162
vscode.window.showErrorMessage('No active editor');
163163
return;
164164
}
165-
const prgPath = editor.document.uri.fsPath.replace(/\.(asm|s)$/, '.prg');
165+
const prgPath = editor.document.uri.fsPath.replace(/\.(asm|kasm)$/, '.prg');
166166
await viceService.run(prgPath);
167167
})
168168
);
@@ -176,7 +176,7 @@ export function activate(context: vscode.ExtensionContext) {
176176
}
177177
const success = await kickassService.assemble(editor.document.uri.fsPath);
178178
if (success) {
179-
const prgPath = editor.document.uri.fsPath.replace(/\.(asm|s)$/, '.prg');
179+
const prgPath = editor.document.uri.fsPath.replace(/\.(asm|kasm)$/, '.prg');
180180
await viceService.run(prgPath);
181181
}
182182
})
@@ -192,7 +192,7 @@ export function activate(context: vscode.ExtensionContext) {
192192
}
193193
const success = await kickassService.assemble(editor.document.uri.fsPath);
194194
if (success) {
195-
const prgPath = editor.document.uri.fsPath.replace(/\.(asm|s)$/, '.prg');
195+
const prgPath = editor.document.uri.fsPath.replace(/\.(asm|kasm)$/, '.prg');
196196
await c64uService!.uploadAndRun(prgPath);
197197
}
198198
})
@@ -278,7 +278,7 @@ export function activate(context: vscode.ExtensionContext) {
278278
// Clear diagnostics when a document is closed
279279
context.subscriptions.push(
280280
vscode.workspace.onDidCloseTextDocument(document => {
281-
if (document.fileName.endsWith('.asm') || document.fileName.endsWith('.s')) {
281+
if (document.fileName.endsWith('.asm') || document.fileName.endsWith('.kasm')) {
282282
kickassService.clearDiagnostics(document.uri);
283283
}
284284
})
@@ -303,9 +303,13 @@ function startLanguageServer(context: vscode.ExtensionContext) {
303303

304304
// LSP client options with semantic tokens support
305305
const clientOptions: LanguageClientOptions = {
306-
documentSelector: [{ scheme: 'file', language: 'kickass' }],
306+
documentSelector: [
307+
{ scheme: 'file', language: 'kickass' },
308+
{ scheme: 'file', pattern: '**/*.asm' },
309+
{ scheme: 'file', pattern: '**/*.kasm' }
310+
],
307311
synchronize: {
308-
fileEvents: vscode.workspace.createFileSystemWatcher('**/*.{asm,s}')
312+
fileEvents: vscode.workspace.createFileSystemWatcher('**/*.{asm,kasm}')
309313
},
310314
initializationOptions: {
311315
settings: { kickass_ls: getKickassLsSettings() }
@@ -373,7 +377,7 @@ function autoDetectKickassFiles(context: vscode.ExtensionContext) {
373377

374378
// Helper function to set language if needed
375379
const checkAndSetLanguage = (document: vscode.TextDocument) => {
376-
if ((document.fileName.endsWith('.asm') || document.fileName.endsWith('.s')) &&
380+
if ((document.fileName.endsWith('.asm') || document.fileName.endsWith('.kasm')) &&
377381
document.languageId !== 'kickass') {
378382

379383
// For .asm files, be more aggressive - check patterns
@@ -394,7 +398,7 @@ function autoDetectKickassFiles(context: vscode.ExtensionContext) {
394398
// Watch for newly opened documents
395399
context.subscriptions.push(
396400
vscode.workspace.onDidOpenTextDocument(document => {
397-
if (document.fileName.endsWith('.asm') || document.fileName.endsWith('.s')) {
401+
if (document.fileName.endsWith('.asm') || document.fileName.endsWith('.kasm')) {
398402
console.log(`Opened file: ${document.fileName}, current language: ${document.languageId}`);
399403

400404
// Check immediately first

src/kickassembler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export class KickassemblerService {
2828
}
2929

3030
const outputDir = path.dirname(filePath);
31-
const outputFile = filePath.replace(/\.(asm|s)$/, '.prg');
31+
const outputFile = filePath.replace(/\.(asm|kasm)$/, '.prg');
3232

3333
// Clear previous diagnostics
3434
this.diagnosticCollection.clear();

0 commit comments

Comments
 (0)