DaedalusLanguageServer

package module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 21, 2024 License: MIT Imports: 5 Imported by: 0

README

Build

Usage

see: https://github.com/kirides/vscode-daedalus

Custom externals

The server looks for a _externals\ directory located in the workspace root.
When there is a _externals\externals.src it will try to parse it and all referenced files right after parsing the built-in externals and before parsing user scripts.

  • If there is no _externals\externals.src we look for a _externals\externals.d and try to parse that.

This externals should be provided from Union plugins such as zParserExtender.

Aknowledgements

Gothic Classic - Nintendo Switch

https://github.com/kirides/DaedalusLanguageServer/assets/13602143/91162090-0b7f-4bbd-a461-4e6f9b1f6078

neovim configuration

Minimum configuration needed to run the language server

somewhere in init.lua or any lua script

vim.api.nvim_create_autocmd("FileType", {
    pattern = "d",
    callback = function(ev)
        local root_dir = vim.fs.dirname(
            vim.fs.find({ 'Gothic.src', 'Camera.src', 'Menu.src', 'Music.src', 'ParticleFX.src', 'SFX.src', 'VisualFX.src' }, { upward = true })[1]
        )

        local client = vim.lsp.start({
          name = 'DLS',
          cmd = {'C:/.../DaedalusLanguageServer.exe'},
          root_dir = root_dir,
          -- configure language server specific options
          settings = {
            daedalusLanguageServer = {
              loglevel = 'debug',
              inlayHints = { constants = true },
              numParserThreads = 16,
              fileEncoding = 'Windows-1252',
              srcFileEncoding ='Windows-1252',
            },
          },
        })

        vim.lsp.buf_attach_client(0, client)
    end
})


vim.cmd([[highlight! link LspSignatureActiveParameter Search]])

Documentation

Index

Constants

View Source
const DaedalusBuiltinsPath = "DaedalusBuiltins"

Variables

View Source
var BuiltinsFS embed.FS

Functions

This section is empty.

Types

type Handler

type Handler func(RpcContext) error

func MakeHandler

func MakeHandler[T any](fn func(req RpcContext, data T) error) Handler

type Logger

type Logger interface {
	Debugf(template string, args ...interface{})
	Infof(template string, args ...interface{})
	Warnf(template string, args ...interface{})
	Errorf(template string, args ...interface{})
}

type RpcContext

type RpcContext interface {
	Context() context.Context
	Reply(ctx context.Context, result interface{}, err error) error
	ReplyEither(ctx context.Context, result interface{}, err error) error
	Request() jsonrpc2.Request
}

type RpcMux

type RpcMux struct {
	// contains filtered or unexported fields
}

func NewMux

func NewMux() *RpcMux

func (*RpcMux) Handle

func (d *RpcMux) Handle(ctx context.Context, reply jsonrpc2.Replier, req jsonrpc2.Request) (bool, error)

func (*RpcMux) Register

func (d *RpcMux) Register(p string, fn Handler)

Directories

Path Synopsis
cmd
daedalus
Package protocol contains data types and code for LSP json rpcs generated automatically from vscode-languageserver-node commit: 696f9285bf849b73745682fdb1c1feac73eb8772 last fetched Wed Oct 19 2022 10:06:24 GMT+0200 (Mitteleuropäische Sommerzeit)
Package protocol contains data types and code for LSP json rpcs generated automatically from vscode-languageserver-node commit: 696f9285bf849b73745682fdb1c1feac73eb8772 last fetched Wed Oct 19 2022 10:06:24 GMT+0200 (Mitteleuropäische Sommerzeit)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL