Comments (11)
I have a branch that works quite well. It's interfacing with Helix perfectly (and REALLY fast compared to the old cairo-format
from cairo-lang
).
It needs some cleanup but I can polish it up and submit the PR once this issue is approved.
from cairo.
Sounds legit, would love to get a PR.
And also tips on how to integrate with Helix :)
from cairo.
Sure will submit the PR soon. For Helix integration, I simply added this to my languages.toml
(located at ~/.config/helix/languages.toml
):
[[language]]
name = "cairo"
formatter = { command = "formatter_cli" , args = ["-"] }
It really is ⚡ blazing ⚡ fast ⚡ lol.
This works because Helix simply sends the entire buffer to the formatter command via stdin.
from cairo.
Can it integrate with langserver?
from cairo.
Oh Helix has native support for LSP and it supports formatting through the LSP as long as the server supports it.
Though somehow I haven't successfully used the Cairo LSP for really anything at all, but I'll investigate on that front a bit and submit a separate issue.
from cairo.
I have a branch ready now, but I'm wondering how we should deal with the formatter CI issue. Should I just add an .cairofmtignore
to crates/parser/test_data/cairo_files/
to just exclude everything there?
from cairo.
Btw the formatter code was pretty tightly coupled with the file system, so I had to do some refactoring here and there or else I would have a lot of code duplications. I ended up almost rewriting the whole cli.rs
file... I hope you don't mind.
from cairo.
Update on the LSP issue: I'm trying the language server again with the current main
head and it seems to work for me this time. Hover and going to definition work just fine. Not sure what I got wrong last time so I guess we're good.
However, formatting through the LSP doesn't seem to work. From Helix logs I can clearly see the response for the textDocument/formatting
request, but the editor doesn't seem to do anything about it. Helix works fine with formatting through LSP for other languages like rust-analyzer
, so I doubt there's something wrong with the Cairo LSP implementation. Will dig deeper and submit the issue.
Note that making formatting work through LSP doesn't supersede this issue.
from cairo.
For the follow-up on the LSP formatting issue: #1141
from cairo.
Do you get semantic higlighting?
from cairo.
@spapinistarkware Helix seems to rely solely on treesitter for syntax highlighting so I can't tell. I haven't tried using the Cairo LSP with neovim tho.
from cairo.
Related Issues (20)
- bug: visibility issue for `nullable_from_box` function HOT 2
- bug: LS attempts to load Cairo0 source files
- feat: better error reporting with wrong use of unwrap HOT 1
- bug: contract_address_const::<0x800000000000011000000000000000000000000000000000000000000000000> error HOT 1
- Compilation Bug: itertools: .zip_eq() reached end of one iterator before the other HOT 2
- Storage maps
- Individual storage access
- Associated items
- sha256 support
- Arithmetic circuits support
- call_contract_syscall causes a call to revert on Starknet but not in local HOT 2
- feat: Div impl for signed intergers
- bug: Variable was previously moved HOT 1
- Fixed size arrays HOT 1
- bug: cannot escape curly brace in format string HOT 1
- bug: Compiler panics from `compute_expr_function_call_semantic` HOT 3
- bug: cairo test case test_ecdsa_recover_public_key fails HOT 3
- bug: gas computation / unexpected cycle in computation issue with recursive type definition HOT 6
- Bring back "Type Info" feature
- feat: คอมไพล์
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 cairo.