Comments (9)
Fixed that issue but now dart language server just hangs after successful initialization and uses 100% CPU. I'm guessing we might be triggering a bug in dart LS.
from acme-lsp.
No, Android Studio is not required (to be running) per se. I have a flutter toolchain in ~/flutter
installed as per their instructions, as well as Android Studio installed for the Android SDKs (mostly because I'm using Dart on a mac, and it's easier to install the SDK through Android Studio than to manage it on my own).
The config I pasted above is all that I had to do to get it working (listing references works as well).
Just a heads up, the LSP has the habit of spamming the /LSP/Diagnostics
window with a lot of uninteresting stuff as soon as you open one of the flutter files (such as by jumping to a definition in there), but that seems to kick in only after the file has been open for a few seconds.
from acme-lsp.
I think first step would be to try it out with debugging/tracing turned on. Then try to get file management and basic commands working. Maybe it already works but from what I've seen, there are always some incompatibilities between how client and server implement the LSP protocol and what version of LSP protocol they assume.
I've not had a lot time to work on acme-lsp. The more I look at it, the more I dislike the JSON-rpc based LSP protocol, and Go is not the best language to implement a LSP client because it lack an union type. The acme-lsp code is heavily based on gopls and I've not kept up with updates to gopls. We desperately need to update the LSP protocol definitions to the latest LSP version, and auto-generate it from the LSP spec instead of manually updating them. I've attempted to update it few months ago, but the gopls code base have changed in a very incompatible way that it wasn't an easy change.
To summarize, you may need to manually update protocol definitions to support dart, but this might get very tedious. The proper fix for protocol incompatibles is to auto-generate protocol definitions from the latest LSP spec.
from acme-lsp.
oh, so you're saying it might already partially work? it hadn't even occurred to me that it could, so I didn't even try it out, heh.
Will do that first then, thanks.
In the meantime I'm using vim to "Ldef" and I just keep on coding in acme anyway. it kinda works...
from acme-lsp.
I gave it a shot but doesn't work:
acme-lsp -server '\.dart$:dart language-server'
2023/06/18 18:21:41 LSP 4: Loading packages...
2023/06/18 18:21:41 failed to create file manager: failed to connect to language server ["dart" "language-server"]: initialize failed: json: cannot unmarshal bool into Go struct field WorkspaceFolders5Gn.capabilities.workspace.workspaceFolders.changeNotifications of type string
This is with the auto-generated LSP structs from gopls I recently merged. changeNotifications
can be with a bool or string according to the LSP spec, but auto-generated struct declares this field as a string.
from acme-lsp.
Thank you for the time you spent on this.
I wanted to investigate a bit myself, but I think I got demotivated because I didn't get how to run a dart language server.
from acme-lsp.
I just got basic Dart LSP support to work here. The key was setting the onlyAnalyzeProjectsWithOpenFiles
LSP option to true
. Otherwise, I had the hang that @fhs mentions (at 100% CPU).
Diagnostics and Jump To Definition work, hover help does not:
2024/02/16 13:39:30 jsonrpc2: code -32603 message: json: cannot unmarshal string into Go struct field Hover.contents of type protocol.MarkupContent
Lhov: exit 1
and neither does formatting:
2024/02/16 13:39:46 jsonrpc2: code -32603 message: jsonrpc2: code -32602 message: Invalid params for textDocument/codeAction:
params.context.diagnostics must not be null
Lfmt: exit 1
I believe I have seen the hover help output with e.g. the Typescript language server as well, and I believe an issue for it already exists, but it boils down to "The LSP specs that the Go code acme-lsp uses is generated from is a bit too advanced for Go's type system to translate 1:1".
All in all, it's not at 100%, but this covers at least half of my use cases for Android Studio, so I'm happy.
This is the relevant part of my config:
[Servers]
[Servers.dartls]
Command = ["dart", "language-server", "--client-id=acme-lsp", "--client-version=1.0"]
StderrFile = "dartls.stderr.log"
LogFile = "dartls.log"
[Servers.dartls.Options]
onlyAnalyzeProjectsWithOpenFiles = true
[[FilenameHandlers]]
Pattern = "\\.dart$"
LanguageID = "dart"
ServerKey = "dartls"
from acme-lsp.
oooh, you got jump to definition working? color me interested then, because that's pretty much all I need.
I'll need to give it another try, thanks!
from acme-lsp.
@farhaven Given that I'm not using Android Studio (only acme, and acme-lsp), what are all the pieces that I need to be able t o get to the point you are at? Are you using Android Studio as an LSP server for Dart?
from acme-lsp.
Related Issues (20)
- Multiple language id, file extension pairs support (trying ocamllsp) HOT 5
- Support specify configuration file through cmdline HOT 1
- Chording the commands doesn't work HOT 3
- L def fails to run due to acme-lsp.rpc: connect: no such file or directory HOT 1
- Config not read HOT 5
- Edit list doesn't apply correctly on elixir-ls
- acmefocused not working HOT 1
- error on startup HOT 1
- Always insert first suggestion in L comp -e HOT 2
- In internal/lsp/text/edit.go, ToPath doesn't percent decode input URI HOT 2
- automatic imports on formatting not working HOT 2
- Automatically launch acme-lsp at acme startup HOT 1
- Trying to get deno lsp to work HOT 1
- Relative file paths in assists / diagnostics HOT 2
- Cant get vue language server to work HOT 7
- Lua language server works great
- L hov panic when used on primitive types with typescript-language-server HOT 1
- Add support for FormattingOptions in config.toml HOT 1
- Cant reload file with typescript lsp HOT 2
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 acme-lsp.