Compare commits

...

3 Commits

Author SHA1 Message Date
16082752e2 Update language server client and configs 2025-08-02 19:19:29 +03:00
8a71ce3629 Update LSP client 2025-08-02 15:02:39 +03:00
81d418c6d8 Update version number 2025-08-02 14:36:56 +03:00
8 changed files with 36 additions and 99 deletions

4
Cargo.lock generated
View File

@ -654,7 +654,7 @@ checksum = "53a49587ad06b26609c52e423de037e7f57f20d53535d66e08c695f347df952a"
[[package]] [[package]]
name = "reid" name = "reid"
version = "1.0.0-beta.2" version = "1.0.0-beta.3"
dependencies = [ dependencies = [
"colored", "colored",
"reid-lib", "reid-lib",
@ -663,7 +663,7 @@ dependencies = [
[[package]] [[package]]
name = "reid-lib" name = "reid-lib"
version = "1.0.0-beta.2" version = "1.0.0-beta.3"
dependencies = [ dependencies = [
"llvm-sys", "llvm-sys",
"thiserror", "thiserror",

View File

@ -1,6 +1,6 @@
[package] [package]
name = "reid-lib" name = "reid-lib"
version = "1.0.0-beta.2" version = "1.0.0-beta.3"
edition = "2024" edition = "2024"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

3
reid-lsp/.gitignore vendored
View File

@ -3,4 +3,5 @@ node_modules
dist dist
package-lock.json package-lock.json
pnpm-lock.yaml pnpm-lock.yaml
tsconfig.tsbuildinfo tsconfig.tsbuildinfo
*.vsix

View File

@ -7,5 +7,5 @@ edition = "2024"
socket = "0.0.7" socket = "0.0.7"
tokio = { version = "1.47.0", features = ["full"] } tokio = { version = "1.47.0", features = ["full"] }
tower-lsp = "0.20.0" tower-lsp = "0.20.0"
reid = { path = "../reid", version = "1.0.0-beta.2", registry="gitea-teascade", features=[] } reid = { path = "../reid", version = "1.0.0-beta.3", registry="gitea-teascade", features=[] }
dashmap = "6.1.0" dashmap = "6.1.0"

View File

@ -1,71 +1 @@
# reid-lsp README # Reid Language Server
This is the README for your extension "reid-lsp". After writing up a brief description, we recommend including the following sections.
## Features
Describe specific features of your extension including screenshots of your extension in action. Image paths are relative to this README file.
For example if there is an image subfolder under your extension project workspace:
\!\[feature X\]\(images/feature-x.png\)
> Tip: Many popular extensions utilize animations. This is an excellent way to show off your extension! We recommend short, focused animations that are easy to follow.
## Requirements
If you have any requirements or dependencies, add a section describing those and how to install and configure them.
## Extension Settings
Include if your extension adds any VS Code settings through the `contributes.configuration` extension point.
For example:
This extension contributes the following settings:
* `myExtension.enable`: Enable/disable this extension.
* `myExtension.thing`: Set to `blah` to do something.
## Known Issues
Calling out known issues can help limit users opening duplicate issues against your extension.
## Release Notes
Users appreciate release notes as you update your extension.
### 1.0.0
Initial release of ...
### 1.0.1
Fixed issue #.
### 1.1.0
Added features X, Y, and Z.
---
## Following extension guidelines
Ensure that you've read through the extensions guidelines and follow the best practices for creating your extension.
* [Extension Guidelines](https://code.visualstudio.com/api/references/extension-guidelines)
## Working with Markdown
You can author your README using Visual Studio Code. Here are some useful editor keyboard shortcuts:
* Split the editor (`Cmd+\` on macOS or `Ctrl+\` on Windows and Linux).
* Toggle preview (`Shift+Cmd+V` on macOS or `Shift+Ctrl+V` on Windows and Linux).
* Press `Ctrl+Space` (Windows, Linux, macOS) to see a list of Markdown snippets.
## For more information
* [Visual Studio Code's Markdown Support](http://code.visualstudio.com/docs/languages/markdown)
* [Markdown Syntax Reference](https://help.github.com/articles/markdown-basics/)
**Enjoy!**

View File

@ -18,12 +18,20 @@ import {
let client: LanguageClient; let client: LanguageClient;
export function activate(context: ExtensionContext) { export function activate(context: ExtensionContext) {
const traceOutputChannel = window.createOutputChannel("Reid Language Server trace"); const configuration = workspace.getConfiguration('reid-language-server');
const command = process.env.SERVER_PATH || "reid-language-server"; let server_path: string = process.env.SERVER_PATH ?? configuration.get("language-server-path") ?? 'reid-language-server';
const regex = /\$(\w+)/;
while (regex.test(server_path)) {
let envVar = regex.exec(server_path)?.[1];
const envVal = envVar ? process.env[envVar] : undefined;
if (envVar === undefined || envVal === undefined) {
console.error(`No such environment variables as ${envVar}`);
}
server_path = server_path.replaceAll(`$${envVar}`, envVal ?? '');
}
const run: Executable = { const run: Executable = {
command, command: server_path,
options: { options: {
env: { env: {
...process.env, ...process.env,
@ -49,13 +57,15 @@ export function activate(context: ExtensionContext) {
// Create the language client and start the client. // Create the language client and start the client.
client = new LanguageClient( client = new LanguageClient(
'reid-lsp', 'reid-language-server',
'Reid Language Server', 'Reid Language Server',
serverOptions, serverOptions,
clientOptions clientOptions
); );
client.info(JSON.stringify(server_path));
client.info(`Loaded Reid Language Server from ${server_path}`);
client.info("hello");
workspace.onDidOpenTextDocument((e) => { workspace.onDidOpenTextDocument((e) => {
}); });

View File

@ -1,8 +1,11 @@
{ {
"name": "reid-lsp", "name": "reid-language-server",
"displayName": "Reid Language Server", "displayName": "Reid Language Server",
"description": "Language Server Extension for Reid", "description": "Language Server Extension for Reid",
"version": "0.0.1", "version": "0.1.0",
"repository": {
"url": "https://git.teascade.net/teascade"
},
"engines": { "engines": {
"vscode": "^1.102.0" "vscode": "^1.102.0"
}, },
@ -19,6 +22,9 @@
"id": "reid", "id": "reid",
"extensions": [ "extensions": [
".reid" ".reid"
],
"aliases": [
"Reid"
] ]
} }
], ],
@ -26,21 +32,11 @@
"type": "object", "type": "object",
"title": "reid-language-server", "title": "reid-language-server",
"properties": { "properties": {
"nrs-language-server.trace.server": { "reid-language-server.language-server-path": {
"type": "string", "type": "string",
"scope": "window", "scope": "window",
"enum": [ "default": "$HOME/.cargo/bin/reid-lsp",
"off", "description": "Path to the Reid Language Server executable"
"messages",
"verbose"
],
"enumDescriptions": [
"No traces",
"Error only",
"Full log"
],
"default": "off",
"description": "Traces the communication between VS Code and the language server."
} }
} }
}, },

View File

@ -1,6 +1,6 @@
[package] [package]
name = "reid" name = "reid"
version = "1.0.0-beta.2" version = "1.0.0-beta.3"
edition = "2021" edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
@ -16,6 +16,6 @@ context_debug = []
[dependencies] [dependencies]
## Make it easier to generate errors ## Make it easier to generate errors
thiserror = "1.0.44" thiserror = "1.0.44"
reid-lib = { path = "../reid-llvm-lib", version = "1.0.0-beta.1", registry="gitea-teascade" } reid-lib = { path = "../reid-llvm-lib", version = "1.0.0-beta.3", registry="gitea-teascade" }
colored = {version = "3.0.0", optional = true} colored = {version = "3.0.0", optional = true}