goldenstein64 / lua-lsp-lib Goto Github PK
View Code? Open in Web Editor NEWA library aimed at making the construction of language servers in Lua easier.
License: MIT License
A library aimed at making the construction of language servers in Lua easier.
License: MIT License
According to the JSON-RPC spec here, batch requests are done by sending an array of request objects. The server should respond with a corresponding array of response objects. While the lsp.io
module can handle arrays of requests, it's currently unable to send an array of responses back; it just sends each response in a separate message, which is presumably wrong.
transform.position
tests expect character
to refer to a code point, which means that a test like this is written wrong.
emoji_text = "๐ค๐ค\n๐๐\n\n๐คฃ๐
\r\n๐\r๐ฅ"
-- testing for '๐ค', the second code point
assert.equal 5, from_lsp emoji_text, { line: 0, character: 1 }
In that case when under a UTF-8 position encoding, character
should be set to 4
, and under a UTF-16 position encoding, character
would be set to 2
. This would be correct for UTF-32 though...
Right now, it only handles UTF-8, which means the client would currently need to offer support for UTF-8 in its positionEncodings
capabilities. LSP requires that the language server must offer a UTF-16 position encoding as a fallback.
The current plan for fixing this is:
Make transform.position
more agnostic by first turning the document text (preferably the line in question) into a list of codepoints (like JS)
transform.position
must be aware of a unique document identifier.Make transform.position
somehow aware of the choice in encoding, using one of two ways:
a. Add an extra encoding
argument, which forces position encoding/state management on the user (not the best UX)
b. Add a set_encoding
function or encoding
property to transform.position
Additionally, the encoding could be set automatically by listen.handlers.initialize
if (b) is implemented, although this would probably mean redirecting the processing to another module since capabilities need to be accessed in a safe way.
Concerning a P.S. of #1
Additionally, the encoding could be set automatically by
listen.handlers.initialize
[...], although this would probably mean redirecting the processing to another module since capabilities need to be accessed in a safe way.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.