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
1 change: 0 additions & 1 deletion .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ src/**
.prettierrc
CONTRIBUTING.md
CONVENTIONS.MD
LICENSE
**/tsconfig.json
**/eslint.config.mjs
**/*.map
Expand Down
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ features *Go to Definition* for elements and semantic model validation.

## Configuration

- `turtle.languageServerSettings.activateEmbeddedLanguageServer` (boolean, default: `true`)
- `semantic-models.languageServerSettings.activateEmbeddedLanguageServer` (boolean, default: `true`)
- When enabled, the extension starts the SAMM language server process. When disabled, an external language server must be started manually.
- `turtle.languageServerSettings.automaticUpdateCheck` (boolean, default: `true`)
- `semantic-models.languageServerSettings.automaticUpdateCheck` (boolean, default: `true`)
- Automatically check for updates to the SAMM language server and notify when a new version is available.
- `turtle.languageServerSettings.sammCliPath` (string)
- `semantic-models.languageServerSettings.sammCliPath` (string)
- Path to the SAMM CLI executable or JAR file to use as the language server. Can be downloaded or selected using the 'Select SAMM CLI Executable' command.
- `turtle.languageServerSettings.serverPort` (number, default: `1846`)
- `semantic-models.languageServerSettings.serverPort` (number, default: `1846`)
- TCP port used to connect to the SAMM language server.
- `turtle.languageServerSettings.traceLevel` (string, default: `off`)
- `semantic-models.languageServerSettings.traceLevel` (string, default: `off`)
- Controls the verbosity of Language Server Protocol (LSP) tracing. Options: `off`, `messages`, `verbose`.

Use the command `Turtle: Select SAMM CLI Executable` to choose either:
Use the command `Semantic Models: Select SAMM CLI Executable` to choose either:
- one of the latest SAMM CLI GitHub releases, or
- a custom executable path from your local file system.

Expand All @@ -31,7 +31,7 @@ Use the command `Turtle: Select SAMM CLI Executable` to choose either:
- Fast validation while typing from the regular Turtle parser diagnostics provided by the server (appear in the editor and `Problems`).
- Full Aspect validation from the server for model-level issues (results shown in notifications and status bar).
- Manual validation command:
- `Turtle: Validate Document Now`
- `Semantic Models: Validate Document Now`

## Running the Server and Extension Together

Expand Down Expand Up @@ -62,15 +62,15 @@ When each validation runs:

- On type: fast syntax feedback only.
- On save: heavy Aspect validation for Turtle documents.
- Manual: `Turtle: Validate Document Now` for the active Turtle document.
- Manual: `Semantic Models: Validate Document Now` for the active Turtle document.

## Commands

- `Turtle: Validate Document Now`
- `Semantic Models: Validate Document Now`
- Sends a server request for the active Turtle document.
- `Turtle: Select SAMM CLI Executable`
- `Semantic Models: Select SAMM CLI Executable`
- Opens a quick pick with the latest ten GitHub releases and a custom-path option.
- `Turtle: Restart Language Server Connection`
- `Semantic Models: Restart Language Server Connection`
- Restarts the language server and reconnects the client.

## UX During Long-Running Validation
Expand Down Expand Up @@ -102,7 +102,7 @@ Use [samples/org.eclipse.esmf.test/1.0.0/Aspect.ttl](samples/org.eclipse.esmf.te
Manual check:

1. Open an Aspect model file.
2. Run `Turtle: Validate document now`.
2. Run `Semantic Models: Validate Document Now`.
3. Wait for validation to complete.
4. Confirm that validation results are displayed in a notification.

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

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

28 changes: 14 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "turtle",
"name": "semantic-models",
"displayName": "Semantic Models",
"description": "Support for RDF/Turtle documents, including SAMM Aspect Models",
"version": "0.0.1",
Expand All @@ -26,19 +26,19 @@
"contributes": {
"commands": [
{
"command": "turtle.validateDocumentNow",
"command": "semantic-models.validateDocumentNow",
"title": "Validate Document Now",
"category": "Turtle"
"category": "Semantic Models"
},
{
"command": "turtle.restartLanguageServices",
"command": "semantic-models.restartLanguageServices",
"title": "Restart Language Server Connection",
"category": "Turtle"
"category": "Semantic Models"
},
{
"command": "turtle.selectSammCliExecutable",
"command": "semantic-models.selectSammCliExecutable",
"title": "Select SAMM CLI Executable",
"category": "Turtle"
"category": "Semantic Models"
}
],
"languages": [
Expand All @@ -60,31 +60,31 @@
"type": "object",
"description": "Configuration settings for the Semantic Models extension.",
"properties": {
"turtle.languageServerSettings.activateEmbeddedLanguageServer": {
"semantic-models.languageServerSettings.activateEmbeddedLanguageServer": {
"type": "boolean",
"default": true,
"description": "When enabled, the extension starts the SAMM language server using the executable configured below. When disabled, an external language server must be started manually.",
"order": 0
},
"turtle.languageServerSettings.automaticUpdateCheck": {
"semantic-models.languageServerSettings.automaticUpdateCheck": {
"type": "boolean",
"default": true,
"description": "Automatically check for updates to the SAMM language server and notify when a new version is available.",
"order": 1
},
"turtle.languageServerSettings.sammCliPath": {
"semantic-models.languageServerSettings.sammCliPath": {
"type": "string",
"default": "",
"description": "Path to the SAMM CLI executable or JAR file to use as the language server. Can be downloaded or selected using the 'Select SAMM CLI Executable' command.",
"order": 2
},
"turtle.languageServerSettings.serverPort": {
"semantic-models.languageServerSettings.serverPort": {
"type": "number",
"default": 1846,
"description": "TCP port used to connect to the SAMM language server.",
"order": 3
},
"turtle.languageServerSettings.traceLevel": {
"semantic-models.languageServerSettings.traceLevel": {
"type": "string",
"enum": [
"off",
Expand All @@ -110,15 +110,15 @@
"menus": {
"editor/context": [
{
"command": "turtle.validateDocumentNow",
"command": "semantic-models.validateDocumentNow",
"when": "resourceLangId == turtle",
"group": "1_modification"
}
]
},
"walkthroughs": [
{
"id": "turtle-getting-started",
"id": "semantic-models-getting-started",
"title": "Getting Started with the Semantic Models Extension",
"description": "Learn how to use the Semantic Models extension to edit and validate your RDF/Turtle files, including SAMM Aspect Models.\nThis walkthrough will guide you through the key features of the extension, including validating your RDF/Turtle files and SAMM Aspect Models using the integrated language server.",
"steps": [
Expand Down
2 changes: 1 addition & 1 deletion src/aspectValidation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import * as vscode from 'vscode';
import type { ExtensionLogger } from './outputChannel';

export const VALIDATE_DOCUMENT_REQUEST = 'turtle/aspectValidation/validateDocument';
export const VALIDATE_DOCUMENT_COMMAND = 'turtle.validateDocumentNow';
export const VALIDATE_DOCUMENT_COMMAND = 'semantic-models.validateDocumentNow';
const STATUS_MESSAGE_TIMEOUT_MS = 5000;

export type AspectValidationTrigger = 'manual' | 'save';
Expand Down
12 changes: 6 additions & 6 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ import { TurtleExtensionSettings } from './settings';
import { TurtleLanguageClient } from './languageClient';
import type { ExtensionLogger } from './outputChannel';

const SELECT_EXECUTABLE_COMMAND = 'turtle.selectSammCliExecutable';
const SELECT_EXECUTABLE_COMMAND = 'semantic-models.selectSammCliExecutable';
const SELECT_EXECUTABLE_TITLE = 'Select SAMM CLI Executable';
const RESTART_LANGUAGE_SERVICES_COMMAND = 'turtle.restartLanguageServices';
const RESTART_LANGUAGE_SERVICES_COMMAND = 'semantic-models.restartLanguageServices';

let settings: TurtleExtensionSettings;
let languageServer: TurtleLanguageServer | undefined;
Expand Down Expand Up @@ -52,7 +52,7 @@ export async function activate(ctx: vscode.ExtensionContext): Promise<void> {
await queueLanguageServicesRestart('Manual restart command');
}),
vscode.workspace.onDidChangeConfiguration((e: vscode.ConfigurationChangeEvent) => {
if (e.affectsConfiguration('turtle.languageServerSettings')) {
if (e.affectsConfiguration('semantic-models.languageServerSettings')) {
void queueLanguageServicesRestart('Configuration change detected');
}
})
Expand Down Expand Up @@ -86,7 +86,7 @@ function queueLanguageServicesRestart(reason: string): Promise<void> {
if (selection === 'Configure SAMM CLI Executable') {
void selectSammCliExecutable();
} else if (selection === 'Check Extension Settings') {
void vscode.commands.executeCommand('workbench.action.openSettings', 'turtle.languageServerSettings');
void vscode.commands.executeCommand('workbench.action.openSettings', 'semantic-models.languageServerSettings');
}
});

Expand Down Expand Up @@ -241,8 +241,8 @@ async function promptForCustomExecutablePath(): Promise<string | undefined> {
canSelectFiles: true,
canSelectFolders: false,
canSelectMany: false,
openLabel: 'Use this executable / jar',
title: 'Select SAMM CLI executable / jar',
openLabel: 'Use this executable / JAR',
title: 'Select SAMM CLI executable / JAR',
});

return selection?.[0]?.fsPath;
Expand Down
14 changes: 7 additions & 7 deletions src/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,31 +16,31 @@ import * as vscode from 'vscode';
export class TurtleExtensionSettings {

isEmbeddedLanguageServerStartEnabled(): boolean {
return vscode.workspace.getConfiguration('turtle.languageServerSettings').get<boolean>('activateEmbeddedLanguageServer', true);
return vscode.workspace.getConfiguration('semantic-models.languageServerSettings').get<boolean>('activateEmbeddedLanguageServer', true);
}

async setEmbeddedLanguageServerStartEnabled(enabled: boolean): Promise<void> {
await vscode.workspace.getConfiguration('turtle.languageServerSettings').update('activateEmbeddedLanguageServer', enabled, vscode.ConfigurationTarget.Global);
await vscode.workspace.getConfiguration('semantic-models.languageServerSettings').update('activateEmbeddedLanguageServer', enabled, vscode.ConfigurationTarget.Global);
}

getSammCliPath(): string {
return vscode.workspace.getConfiguration('turtle.languageServerSettings').get<string>('sammCliPath', '');
return vscode.workspace.getConfiguration('semantic-models.languageServerSettings').get<string>('sammCliPath', '');
}

async setSammCliPath(path: string): Promise<void> {
await vscode.workspace.getConfiguration('turtle.languageServerSettings').update('sammCliPath', path, vscode.ConfigurationTarget.Global);
await vscode.workspace.getConfiguration('semantic-models.languageServerSettings').update('sammCliPath', path, vscode.ConfigurationTarget.Global);
}

sammCliAutoUpdateIsEnabled(): boolean {
return vscode.workspace.getConfiguration('turtle.languageServerSettings').get<boolean>('automaticUpdateCheck', true);
return vscode.workspace.getConfiguration('semantic-models.languageServerSettings').get<boolean>('automaticUpdateCheck', true);
}

getSammCliLspServerPort(): number {
return vscode.workspace.getConfiguration('turtle.languageServerSettings').get<number>('serverPort', 1846);
return vscode.workspace.getConfiguration('semantic-models.languageServerSettings').get<number>('serverPort', 1846);
}

getLanguageClientTraceLevel(): 'off' | 'messages' | 'verbose' {
return vscode.workspace.getConfiguration('turtle.languageServerSettings').get<'off' | 'messages' | 'verbose'>('traceLevel', 'off');
return vscode.workspace.getConfiguration('semantic-models.languageServerSettings').get<'off' | 'messages' | 'verbose'>('traceLevel', 'off');
}

}
Loading