hyprls

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 5, 2024 License: MIT Imports: 17 Imported by: 0

README

HyprLS

A LSP server for Hyprland configuration files.

Features

Not checked means planned / work in progress.

  • Auto-complete
  • Hover
    • TODO: Documentation on hover of categories?
  • Go to definition
  • Color pickers
  • Document symbols
  • Diagnostics
  • Formatting
  • Semantic highlighting

Installation

With go install
go install github.com/ewen-lbh/hyprls/cmd/hyprls@latest
From source
  • Required: Just (paru -S just on Arch Linux (btw))
git clone --recurse-submodules https://github.com/ewen-lbh/hyprls
cd hyprls
# installs the binary to ~/.local/bin. 
# Make sure that directory exists and is in your PATH
just install 

Usage

With Neovim

Combine with The tree-sitter grammar for Hyprlang for syntax highlighting.

Add this to your init.lua:

-- Hyprlang LSP
vim.api.nvim_create_autocmd({'BufEnter', 'BufWinEnter'}, {
		pattern = {"*.hl", "hypr*.conf"},
		callback = function(event)
				print(string.format("starting hyprls for %s", vim.inspect(event)))
				vim.lsp.start {
						name = "hyprlang",
						cmd = {"hyprls"},
						root_dir = vim.fn.getcwd(),
				}
		end
})
VSCode

Install it from the marketplace.

[!TIP] You can use the Hyprland extension pack to also get syntax highlighting.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Version string

Functions

func StartServer

func StartServer(logger *zap.Logger, logClientIn string)

Types

type Handler

type Handler struct {
	protocol.Server
	Logger *zap.Logger
}

func NewHandler

func NewHandler(ctx context.Context, server protocol.Server, logger *zap.Logger) (Handler, context.Context, error)

func (Handler) CodeAction

func (h Handler) CodeAction(ctx context.Context, params *protocol.CodeActionParams) ([]protocol.CodeAction, error)

func (Handler) CodeLens

func (h Handler) CodeLens(ctx context.Context, params *protocol.CodeLensParams) ([]protocol.CodeLens, error)

func (Handler) CodeLensRefresh

func (h Handler) CodeLensRefresh(ctx context.Context) error

func (Handler) CodeLensResolve

func (h Handler) CodeLensResolve(ctx context.Context, params *protocol.CodeLens) (*protocol.CodeLens, error)

func (Handler) ColorPresentation

func (h Handler) ColorPresentation(ctx context.Context, params *protocol.ColorPresentationParams) ([]protocol.ColorPresentation, error)

func (Handler) Completion

func (Handler) CompletionResolve

func (h Handler) CompletionResolve(ctx context.Context, params *protocol.CompletionItem) (*protocol.CompletionItem, error)

func (Handler) Declaration

func (h Handler) Declaration(ctx context.Context, params *protocol.DeclarationParams) ([]protocol.Location, error)

func (Handler) Definition

func (h Handler) Definition(ctx context.Context, params *protocol.DefinitionParams) ([]protocol.Location, error)

func (Handler) DidChange

func (Handler) DidChangeConfiguration

func (h Handler) DidChangeConfiguration(ctx context.Context, params *protocol.DidChangeConfigurationParams) error

func (Handler) DidChangeWatchedFiles

func (h Handler) DidChangeWatchedFiles(ctx context.Context, params *protocol.DidChangeWatchedFilesParams) error

func (Handler) DidChangeWorkspaceFolders

func (h Handler) DidChangeWorkspaceFolders(ctx context.Context, params *protocol.DidChangeWorkspaceFoldersParams) error

func (Handler) DidClose

func (Handler) DidCreateFiles

func (h Handler) DidCreateFiles(ctx context.Context, params *protocol.CreateFilesParams) error

func (Handler) DidDeleteFiles

func (h Handler) DidDeleteFiles(ctx context.Context, params *protocol.DeleteFilesParams) error

func (Handler) DidOpen

func (Handler) DidRenameFiles

func (h Handler) DidRenameFiles(ctx context.Context, params *protocol.RenameFilesParams) error

func (Handler) DidSave

func (Handler) DocumentColor

func (Handler) DocumentHighlight

func (h Handler) DocumentHighlight(ctx context.Context, params *protocol.DocumentHighlightParams) ([]protocol.DocumentHighlight, error)
func (h Handler) DocumentLink(ctx context.Context, params *protocol.DocumentLinkParams) ([]protocol.DocumentLink, error)

func (Handler) DocumentLinkResolve

func (h Handler) DocumentLinkResolve(ctx context.Context, params *protocol.DocumentLink) (*protocol.DocumentLink, error)

func (Handler) DocumentSymbol

func (h Handler) DocumentSymbol(ctx context.Context, params *protocol.DocumentSymbolParams) ([]interface{}, error)

func (Handler) ExecuteCommand

func (h Handler) ExecuteCommand(ctx context.Context, params *protocol.ExecuteCommandParams) (interface{}, error)

func (Handler) Exit

func (h Handler) Exit(ctx context.Context) error

func (Handler) FoldingRanges

func (h Handler) FoldingRanges(ctx context.Context, params *protocol.FoldingRangeParams) ([]protocol.FoldingRange, error)

func (Handler) Formatting

func (Handler) Hover

func (h Handler) Hover(ctx context.Context, params *protocol.HoverParams) (*protocol.Hover, error)

func (Handler) Implementation

func (h Handler) Implementation(ctx context.Context, params *protocol.ImplementationParams) ([]protocol.Location, error)

func (Handler) Initialize

func (Handler) Initialized

func (h Handler) Initialized(ctx context.Context, params *protocol.InitializedParams) error

func (Handler) LinkedEditingRange

func (Handler) LogTrace

func (h Handler) LogTrace(ctx context.Context, params *protocol.LogTraceParams) error

func (Handler) Moniker

func (h Handler) Moniker(ctx context.Context, params *protocol.MonikerParams) ([]protocol.Moniker, error)

func (Handler) OnTypeFormatting

func (h Handler) OnTypeFormatting(ctx context.Context, params *protocol.DocumentOnTypeFormattingParams) ([]protocol.TextEdit, error)

func (Handler) PrepareCallHierarchy

func (h Handler) PrepareCallHierarchy(ctx context.Context, params *protocol.CallHierarchyPrepareParams) ([]protocol.CallHierarchyItem, error)

func (Handler) PrepareRename

func (h Handler) PrepareRename(ctx context.Context, params *protocol.PrepareRenameParams) (*protocol.Range, error)

func (Handler) RangeFormatting

func (h Handler) RangeFormatting(ctx context.Context, params *protocol.DocumentRangeFormattingParams) ([]protocol.TextEdit, error)

func (Handler) References

func (h Handler) References(ctx context.Context, params *protocol.ReferenceParams) ([]protocol.Location, error)

func (Handler) Rename

func (Handler) Request

func (h Handler) Request(ctx context.Context, method string, params interface{}) (interface{}, error)

func (Handler) SemanticTokensFull

func (h Handler) SemanticTokensFull(ctx context.Context, params *protocol.SemanticTokensParams) (*protocol.SemanticTokens, error)

func (Handler) SemanticTokensFullDelta

func (h Handler) SemanticTokensFullDelta(ctx context.Context, params *protocol.SemanticTokensDeltaParams) (interface{}, error)

func (Handler) SemanticTokensRange

func (h Handler) SemanticTokensRange(ctx context.Context, params *protocol.SemanticTokensRangeParams) (*protocol.SemanticTokens, error)

func (Handler) SemanticTokensRefresh

func (h Handler) SemanticTokensRefresh(ctx context.Context) error

func (Handler) SetTrace

func (h Handler) SetTrace(ctx context.Context, params *protocol.SetTraceParams) error

func (Handler) ShowDocument

func (Handler) Shutdown

func (h Handler) Shutdown(ctx context.Context) error

func (Handler) SignatureHelp

func (h Handler) SignatureHelp(ctx context.Context, params *protocol.SignatureHelpParams) (*protocol.SignatureHelp, error)

func (Handler) Symbols

func (Handler) TypeDefinition

func (h Handler) TypeDefinition(ctx context.Context, params *protocol.TypeDefinitionParams) ([]protocol.Location, error)

func (Handler) WillCreateFiles

func (h Handler) WillCreateFiles(ctx context.Context, params *protocol.CreateFilesParams) (*protocol.WorkspaceEdit, error)

func (Handler) WillDeleteFiles

func (h Handler) WillDeleteFiles(ctx context.Context, params *protocol.DeleteFilesParams) (*protocol.WorkspaceEdit, error)

func (Handler) WillRenameFiles

func (h Handler) WillRenameFiles(ctx context.Context, params *protocol.RenameFilesParams) (*protocol.WorkspaceEdit, error)

func (Handler) WillSave

func (Handler) WillSaveWaitUntil

func (h Handler) WillSaveWaitUntil(ctx context.Context, params *protocol.WillSaveTextDocumentParams) ([]protocol.TextEdit, error)

func (Handler) WorkDoneProgressCancel

func (h Handler) WorkDoneProgressCancel(ctx context.Context, params *protocol.WorkDoneProgressCancelParams) error

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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