Skip to content

Commit 6ff33cc

Browse files
committed
feat: Add VS Code extension with language server, implement native standard library modules for file system, time, system, GC, and core functions, and introduce prm core commands.
1 parent 585c0f8 commit 6ff33cc

File tree

12 files changed

+388
-58
lines changed

12 files changed

+388
-58
lines changed

CHANGELOG.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,18 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66

77
---
88

9+
## [0.8.0] - 2026-01-04
10+
11+
### Added
12+
- **Diagnostics**: Enhanced error reporting with column tracking and visual caret pointers (`^`).
13+
- **Standard Library**:
14+
- `std.fs`: Added `copy`, `is_file`, `is_dir`.
15+
- `std.sys`: Added `exec` for command execution.
16+
- **Tooling**:
17+
- **LSP**: Added "Go to Definition" support and basic keyword completion.
18+
- **Extension**: Enabled Snippets and Hover support.
19+
- **PRM**: Enabled remote package installation from GitHub (`prm install User/Repo`).
20+
921
## [0.7.0] - 2026-01-04
1022

1123
### Added
@@ -327,6 +339,6 @@ This project is licensed under the MIT License.
327339

328340
---
329341

330-
**Current Version**: 0.7.0
342+
**Current Version**: 0.8.0
331343
**Last Updated**: January 04, 2026
332344
**Next Release**: 1.1.0 (Q1 2026)

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
cmake_minimum_required(VERSION 3.15)
2-
project(ProXPL VERSION 0.7.0)
2+
project(ProXPL VERSION 0.8.0)
33

44
# Enable C and C++
55
enable_language(C CXX)

README.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
1010
[![ProXPL CI](https://github.com/ProgrammerKR/ProXPL/actions/workflows/build.yml/badge.svg)](https://github.com/ProgrammerKR/ProXPL/actions/workflows/build.yml)
11-
[![Version](https://img.shields.io/badge/version-0.7.0-blue.svg)](https://github.com/ProgrammerKR/ProXPL/releases)
11+
[![Version](https://img.shields.io/badge/version-0.8.0-blue.svg)](https://github.com/ProgrammerKR/ProXPL/releases)
1212
[![Platform](https://img.shields.io/badge/platform-win%20%7C%20linux%20%7C%20macos-lightgrey.svg)]()
1313

1414
**Clean Syntax • Static Typing • Stack-Based VM • C-Level Performance**
@@ -544,13 +544,18 @@ See [BENCHMARKS.md](BENCHMARKS.md) for detailed performance comparisons.
544544
- ✅ CLI tools and LSP foundation
545545
- ✅ Cross-platform support (Windows/Linux/macOS)
546546

547-
### v1.1.0 (Q1 2026)
548-
**Focus**: Enhanced Developer Experience & System APIs
549-
- 🚧 **Advanced Diagnostics**: Enhanced error reporting with **Column Tracking** and visual pointers (`^`) for precise debugging.
550-
- 🚧 **VS Code Tooling**: Implementation of **Snippets** and **Hover Support** (documentation tooltips) in the official extension.
551-
- 🚧 **System Standard Library**: Expansion of `std.fs` (File System I/O) and `std.sys` (Process args, exit codes, and env).
552-
- 🚧 **LSP Evolution**: Transition from foundation to a functional Language Server (Go-to-definition, basic autocomplete).
553-
- 🚧 **PRM Remote Support**: Enabling PRM to fetch and install packages directly from **GitHub repositories**.
547+
### v0.8.0 (Current - Q1 2026)
548+
**Status**: Released
549+
-**Advanced Diagnostics**: Enhanced error reporting with **Column Tracking** and visual pointers (`^`) for precise debugging.
550+
-**VS Code Tooling**: Implementation of **Snippets** and **Hover Support** (documentation tooltips) in the official extension.
551+
-**System Standard Library**: Expansion of `std.fs` (File System I/O) and `std.sys` (Process args, exit codes, and env).
552+
-**LSP Evolution**: Transition from foundation to a functional Language Server (Go-to-definition, basic autocomplete).
553+
-**PRM Remote Support**: Enabling PRM to fetch and install packages directly from **GitHub repositories**.
554+
555+
### v1.1.0 (Planned)
556+
**Focus**: Optimization & Stability
557+
- 📋 Optimized GC & Memory footprint.
558+
- 📋 Further Stdlib expansion.
554559

555560
### v1.2.0 (Q2 2026)
556561
**Focus**: Object-Oriented Programming & Ecosystem

extension/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "proxpl",
33
"displayName": "ProXPL Language Support",
44
"description": "Syntax highlighting and language support for the ProXPL programming language",
5-
"version": "0.7.0",
5+
"version": "0.8.0",
66
"publisher": "ProXentix",
77
"repository": {
88
"type": "git",

extension/server/src/server.ts

Lines changed: 85 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ import {
77
CompletionItem,
88
CompletionItemKind,
99
TextDocumentPositionParams,
10+
TextDocumentPositionParams,
1011
TextDocumentSyncKind,
11-
InitializeResult
12+
InitializeResult,
13+
Location
1214
} from 'vscode-languageserver/node';
1315
import {
1416
TextDocument
@@ -48,7 +50,8 @@ connection.onInitialize((params: InitializeParams) => {
4850
// Tell the client that this server supports code completion.
4951
completionProvider: {
5052
resolveProvider: true
51-
}
53+
},
54+
definitionProvider: true
5255
}
5356
};
5457
if (hasWorkspaceFolderCapability) {
@@ -81,7 +84,7 @@ documents.onDidChangeContent(_change => {
8184

8285
connection.onDidChangeWatchedFiles(_change => {
8386
// Monitored files have change in VSCode
84-
connection.console.log('We received an file change event');
87+
connection.console.log('We received an file change event');
8588
});
8689

8790
// This handler provides the initial list of the completion items.
@@ -90,31 +93,31 @@ connection.onCompletion(
9093
// The pass parameter contains the position of the text document in
9194
// which code complete got requested. For the example we ignore this
9295
// info and always provide the same completion items.
93-
94-
const keywords = [
95-
'func', 'class', 'if', 'else', 'while', 'for', 'return', 'print',
96-
'var', 'let', 'const', 'true', 'false', 'null', 'use', 'export',
97-
'prox', 'loop', 'from', 'as', 'try', 'catch', 'throw', 'async', 'await'
98-
];
99-
const builtins = ['len', 'str', 'clock', 'input', 'type'];
100-
101-
const items: CompletionItem[] = [];
102-
103-
for (const word of keywords) {
104-
items.push({
105-
label: word,
106-
kind: CompletionItemKind.Keyword,
107-
data: 1
108-
});
109-
}
110-
111-
for (const word of builtins) {
112-
items.push({
113-
label: word,
114-
kind: CompletionItemKind.Function,
115-
data: 2
116-
});
117-
}
96+
97+
const keywords = [
98+
'func', 'class', 'if', 'else', 'while', 'for', 'return', 'print',
99+
'var', 'let', 'const', 'true', 'false', 'null', 'use', 'export',
100+
'prox', 'loop', 'from', 'as', 'try', 'catch', 'throw', 'async', 'await'
101+
];
102+
const builtins = ['len', 'str', 'clock', 'input', 'type'];
103+
104+
const items: CompletionItem[] = [];
105+
106+
for (const word of keywords) {
107+
items.push({
108+
label: word,
109+
kind: CompletionItemKind.Keyword,
110+
data: 1
111+
});
112+
}
113+
114+
for (const word of builtins) {
115+
items.push({
116+
label: word,
117+
kind: CompletionItemKind.Function,
118+
data: 2
119+
});
120+
}
118121

119122
return items;
120123
}
@@ -135,6 +138,60 @@ connection.onCompletionResolve(
135138
}
136139
);
137140

141+
connection.onDefinition(
142+
(params: TextDocumentPositionParams): Location | null => {
143+
const document = documents.get(params.textDocument.uri);
144+
if (!document) return null;
145+
146+
const position = params.position;
147+
const offset = document.offsetAt(position);
148+
const text = document.getText();
149+
150+
// Simple word extraction
151+
const wordRegex = /[a-zA-Z0-9_]+/g;
152+
let match;
153+
let word = "";
154+
155+
while ((match = wordRegex.exec(text)) !== null) {
156+
if (offset >= match.index && offset <= match.index + match[0].length) {
157+
word = match[0];
158+
break;
159+
}
160+
}
161+
162+
if (!word) return null;
163+
164+
// Regex to find definition
165+
// func <word> or class <word>
166+
const funcRegex = new RegExp(`func\\s+${word}\\s*\\(`, 'g');
167+
const classRegex = new RegExp(`class\\s+${word}\\s*\\{`, 'g');
168+
169+
let defMatch;
170+
// Check functions
171+
while ((defMatch = funcRegex.exec(text)) !== null) {
172+
return Location.create(
173+
params.textDocument.uri,
174+
{
175+
start: document.positionAt(defMatch.index),
176+
end: document.positionAt(defMatch.index + match[0].length + 5)
177+
}
178+
);
179+
}
180+
// Check classes
181+
while ((defMatch = classRegex.exec(text)) !== null) {
182+
return Location.create(
183+
params.textDocument.uri,
184+
{
185+
start: document.positionAt(defMatch.index),
186+
end: document.positionAt(defMatch.index + match[0].length + 6)
187+
}
188+
);
189+
}
190+
191+
return null;
192+
}
193+
);
194+
138195
// Make the text document manager listen on the connection
139196
// for open, change and close text document events
140197
documents.listen(connection);

include/common.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
#define PROX_COMMON_H
99

1010
#define PROXPL_VERSION_MAJOR 0
11-
#define PROXPL_VERSION_MINOR 7
11+
#define PROXPL_VERSION_MINOR 8
1212
#define PROXPL_VERSION_PATCH 0
13-
#define PROXPL_VERSION_STRING "0.7.0-pre"
14-
#define PROXPL_VERSION_PRERELEASE "-pre"
13+
#define PROXPL_VERSION_STRING "0.8.0"
14+
#define PROXPL_VERSION_PRERELEASE ""
1515

1616
#include <stdbool.h>
1717
#include <stddef.h>

src/prm/commands/cmd_core.c

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -66,33 +66,42 @@ void prm_install(const char* packageName) {
6666
system("mkdir -p prox_modules");
6767
#endif
6868

69+
// Determine target folder name from package name
70+
// Use the part after the last slash
71+
const char* folderName = packageName;
72+
const char* lastSlash = strrchr(packageName, '/');
73+
if (lastSlash) {
74+
folderName = lastSlash + 1; // "repo" from "user/repo" or "https://.../repo"
75+
}
76+
77+
// Construct target path: prox_modules/<folderName>
78+
char targetPath[256];
79+
snprintf(targetPath, sizeof(targetPath), "prox_modules/%s", folderName);
80+
81+
// Remove .git suffix if present in targetPath
82+
size_t len = strlen(targetPath);
83+
if (len > 4 && strcmp(targetPath + len - 4, ".git") == 0) {
84+
targetPath[len - 4] = '\0';
85+
}
86+
6987
// Construct git clone command
7088
char command[512];
71-
// Assuming packageName is "user/repo" or just "repo" (we default to github.com)
72-
// If it's a full URL, use it. Else prepend https://github.com/
7389

7490
if (strstr(packageName, "://")) {
75-
snprintf(command, sizeof(command), "git clone %s prox_modules/%s", packageName, packageName);
76-
// Note: extracting basename for folder might be needed if using full URL.
77-
// For simplicity, we assume packageName is "User/Repo" format which maps to prox_modules/Repo?
78-
// Or just clone into prox_modules.
79-
// Let's assume standard usage: prm install ProgrammerKR/std.net
80-
// Clone to prox_modules/std.net
91+
// Full URL
92+
snprintf(command, sizeof(command), "git clone %s %s", packageName, targetPath);
8193
} else {
82-
// Handle "User/Repo"
83-
const char* slash = strchr(packageName, '/');
84-
const char* folderName = slash ? slash + 1 : packageName;
85-
86-
snprintf(command, sizeof(command), "git clone https://github.com/%s.git prox_modules/%s", packageName, folderName);
94+
// "User/Repo" format -> GitHub
95+
snprintf(command, sizeof(command), "git clone https://github.com/%s.git %s", packageName, targetPath);
8796
}
8897

8998
printf("Running: %s\n", command);
9099
int result = system(command);
91100

92101
if (result == 0) {
93-
printf("Successfully installed %s.\n", packageName);
102+
printf("Successfully installed %s to %s.\n", packageName, targetPath);
94103
} else {
95-
printf("Failed to install package. Ensure git is installed and the package exists.\n");
104+
printf("Failed to install package. Ensure git is installed and the package/URL exists.\n");
96105
}
97106
} else {
98107
printf("Installing dependencies from prox.toml...\n");

0 commit comments

Comments
 (0)