Giter Site home page Giter Site logo

objeck / objeck-lsp Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 1.0 1.11 MB

LSP server for Objeck

Home Page: https://github.com/objeck/objeck-lang-server

License: Other

JavaScript 8.00% TypeScript 16.17% Batchfile 37.23% Shell 38.60%
language-server-protocol objeck linter lsp vscode sublime language-server ecode kate

objeck-lsp's Introduction

Objeck LSP

LSP support for Objeck was incorporated into v6.0 (and futher releases). Diagnostic functionality (i.e. compiling code, finding symbols, code completion, etc.) is built in libraries that ship with the tool chain. The LSP server is standalone, written in Objeck and exposes STDIO and TCP interfaces. The backend handles client requests, formats responses and maintains the state of in-memory documents.

Please refer to the installation instructions (and issues reports) for editor support.

Work in the Queue

Reviving this effort to provide the following

  1. Clean up configuration options
  2. Project/workspace build support for non-VSCode clients
  3. Better support for Sublime and other text editors (current implementation is based on message ordering from VSCode)
  4. STDIO support for Sublime and other text editors
  5. Named pipe support for VSCode

alt text

Notifications

  • Initialized initialized
  • Cancel Request $/cancelRequest
  • File Open textDocument/didOpen
  • File Changed textDocument/didChange
  • File Save textDocument/didSave
  • File Close textDocument/didClose

Callbacks

  • Initialize initialize
  • Code completion textDocument/completion
  • Code resolution completionItem/resolve
  • Code symbol textDocument/documentSymbol
  • Method/Function signature help textDocument/signatureHelp
  • Goto code references textDocument/references
  • Goto code definitions textDocument/definition
  • Goto code declaration textDocument/declaration
  • Variable rename textDocument/rename
  • Format document textDocument/formatting
  • Format selection textDocument/rangeFormatting
  • Editor shutdown shutdown

Workspaces

  • JSON configured workspaces to support multi-file projects
  • Find symbol in workspace workspace/symbol
  • Watch file changed workspace/didChangeWatchedFiles
  • Watch workspace changed workspace/didChangeWorkspaceFolders
Fig.1 - Error checking

Error checking

Fig.2 - Code completion

Code completion

Fig.3 - Variable and method renaming

Variable and method renaming

Project Status

The server is functional but there is still work to do.

Functional

  1. Tested editors
    1. Visual Studio Code
    2. Sublime
    3. Kate
  2. Platform support
    1. Windows (AMD64)
    2. Linux (AMD64 and ARM64)
    3. macOS (AMD64 and ARM64)
  3. Multi-document support
    1. Project workspaces
  4. Code symbols
    1. Classes
    2. Enums
    3. Methods
  5. Finding references
    1. Variables
  6. Finding declarations
    1. Variables
    2. Methods and functions
  7. Finding definitions
    1. Variables (done)
    2. Classes and method (done)
  8. Keyword completion
    1. Variables
    2. Methods and functions
  9. Bundle documentation
  10. Quick Fixes
    1. Add 'use' a statment for an unqualfied class
    2. Qualfied an unqualfied class

Outstanding

  1. Test with Emacs on Linux

objeck-lsp's People

Contributors

dependabot[bot] avatar objeck avatar

Stargazers

 avatar

Watchers

 avatar

objeck-lsp's Issues

Support stdio

It turned out not only TextAdept and Lite XL (which I believe also use TextAdept's implementation of LSP Client) but also KDE's Kate editor, all of them, only support LSP over stdio. To use Objeck LSP server now, one either has to buy Sublime Text or go with VSCode.

Code symbols

When showing code symbols for a file that starts source with "class" the hierarchy show "/"Default{}"/methods" incorrectly.

Objeck-lsp failed to work with Zeus IDE

Download the trial version from zeusedit.com. Note: It's not yet support Objeck syntax highlighting.

Options -> Document Types... -> New

Extension: obs

Description: Objeck

Go to Language Server tab:

Program: obr

Arguments:

First textbox: C:/objeck-lsp/objeck_lsp.obe

Second textbox: C:/objeck-lsp/objk_apis.json

Third textbox: stdio

Remember to change the paths to objeck-lsp.

After clicking OK, Zeus IDE is ready to test with objeck-lsp. Open a .obs source file and the language server will be auto started.

Pack `objeck-lsp` using `obb`

Instead of having to run a long obr command, only have to use objeck-lsp-standalone.exe.

For example, objeck-lsp-standalone.exe stdio or objeck-lsp-standalone.exe 6013 debug.

The point is to skip the obr --OBJECK_STDIO=binary objeck_lsp.obe objk_apis.json part.

Add wrapper for Linux

I added a simple wrapper for Windows: #11

I don't know Linux shell scripting (even though I have used Linux for a while, I mostly used the graphical interface).

[Tutorial] Setup Kate to use objeck-lsp

Settings -> Configure Kate... -> LSP Client -> User Sever Settings

Create a new settings file with the content:

{
    "servers": {
        "objeck": {
            "command": [
                "<objeck_path>/obr.exe",
                "<objeck_server_path>/objeck_lsp.obe",
                "<objeck_server_path>/objk_apis.json",
                "stdio"
            ],
            "url": "https://github.com/objeck/objeck-lsp",
            "highlightingModeRegex": "^Objeck$"
        }
    }
}

Note: Kate doesn't support define environment variables like Sublime so the environment variables OBJECK_LIB_PATH and OBJECK_STDIO must be set on Windows.

Is objeck-lsp working fine with Vim?

I want to advertise Objeck to some Vim users. But first, I think I should make sure that objeck-lsp is working fine with Vim. The problem is, I personally don't use Vim and know nothing about it other than how to quit it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.