Skip to content
/ lsp Public

A customizable language server protocol with full integration with vscode..!

License

Notifications You must be signed in to change notification settings

je-es/lsp

Repository files navigation


lsp

line


A customizable language server protocol with full integration with vscode..!

line

[8] @je-es/lsp 🚀

To understand the full context, please refer to these documents.

# install using npm
npm install @je-es/lsp
// import using typescript
import * as lsp from "@je-es/lsp";

Example:

// for vscode
import { createConnection, ProposedFeatures } from 'vscode-languageserver/node';
import { TextDocuments } from 'vscode-languageserver';
import { TextDocument } from 'vscode-languageserver-textdocument';

// core
import { LSP } from '@je-es/lsp';

// your syntax
import { KemetSyntax } from '@kemet-lang/rules';

then inside the vscode lsp server.ts file :

try {
    // Create connection and document manager
    const connection 	= createConnection(ProposedFeatures.all);
    const documents 	= new TextDocuments(TextDocument);

    // Initialize the LSP with syntax and workspace root
    const lsp = new LSP(connection, documents, {
        syntax		: KemetSyntax,
        rootPath	: process.cwd()
    });

    // Start the server
    lsp.start();

    console.log('[SERVER] Kemet LSP Server started successfully! 🚀');
} catch (error) {
    console.error('[SERVER] FATAL ERROR during initialization:', error);
    if (error instanceof Error) {
        console.error('Message:', error.message);
        console.error('Stack:', error.stack);
    }
    process.exit(1);
}

line


" Currently I'm working on a larger lsp, so I'll skip writing documentation for now due to time constraints. "

line

About

A customizable language server protocol with full integration with vscode..!

Topics

Resources

License

Stars

Watchers

Forks