Comments (2)
VSCode's approach of handling URI is to unescape everything that is escaped, and colon after drive name is escaped by default, see issue 75027 and issue 144698 of vscode.
As a reference, lua-language-server by sumneko escape most of the characters when generating URI on server side, see here. The escape pattern used [^%w%-%.%_%~%/]
means everything that is no letter, number, -
, .
, _
, ~
, /
.
I think VLS can use similar method. Escape most thing in file path. providing an normalized form of URI for language server to reference files.
I have finished URI encoding and decoding part on my fork.
from vls.
And I propose VLS should use URI in normalized form for storing/fetching file information on server side.
Which is to first decode URI from client, and get file path from it no matter what the URI is. Then encode that file path with encoding function on VLS side. Referencing the target file with this URI made by VLS will make things more consistant.
And that requires adding method like
fn (du DocumentUri) normalize() DocumentUri {
return document_uri_from_path(du.path())
}
and call it every time we need file information access on VLS side.
pub fn (mut ls Vls) did_open(params lsp.DidOpenTextDocumentParams, mut wr ResponseWriter) {
uri := params.text_document.uri.normalize()
// ...
tree := ls.files[uri].tree
}
And this means everywhere in code that has a ls.files[uri]
need to be fixed. That's a lots of work.
from vls.
Related Issues (20)
- V server don't work in CudaText LSP plugin HOT 16
- crash on completion HOT 2
- CONTRIBUTING.md
- Tree-sitter is giving wrong AST after file changed. HOT 5
- got unexpected token U in JSON HOT 5
- Incorrect `map` type signature info for function return type. HOT 1
- Text synchronization error on Windows. HOT 2
- Support multiple instances of VLS HOT 2
- Grammar railroad diagram HOT 1
- LSP completion error: Content duplication HOT 1
- Constant errors when using VLS in Neovim HOT 4
- VLS requiring GLIBC 2.32 HOT 3
- `undefined ident` for prefixed module constants HOT 3
- README update for vls reports HOT 1
- vls not running on fresh install, doesn't work when using it as global command either
- Syntax highlighting error for V language in Helix Editor HOT 2
- VLS isn't responding HOT 7
- Cannot install VLS in VSCode HOT 1
- Can't install vls with vscode HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vls.