ericglau / cairo-ls Goto Github PK
View Code? Open in Web Editor NEWCairo Language Server
Home Page: https://marketplace.visualstudio.com/items?itemName=ericglau.cairo-ls
License: Eclipse Public License 2.0
Cairo Language Server
Home Page: https://marketplace.visualstudio.com/items?itemName=ericglau.cairo-ls
License: Eclipse Public License 2.0
Handle suggestion keywords like COMMA
and operator
, and output proper quick fixes for those.
It seems the latest version of this package is 0.0.25. But the latest release on npm is 0.0.7. Getting the latest version on npm will allow the coc-cairo plugin to stay up to date.
Related coc-cairo issue here: kevinhalliday/coc-cairo#1
When attempting to install the dependencies of the project in the root directory, installation failed with dependency error.
โ cairo-ls git:(main) npm i
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: @typescript-eslint/[email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/eslint
npm ERR! dev eslint@"^7.32.0" from the root project
npm ERR! peer eslint@"*" from @typescript-eslint/[email protected]
npm ERR! node_modules/@typescript-eslint/experimental-utils
npm ERR! @typescript-eslint/experimental-utils@"2.34.0" from @typescript-eslint/[email protected]
npm ERR! node_modules/@typescript-eslint/parser
npm ERR! dev @typescript-eslint/parser@"^2.3.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer eslint@"^5.0.0 || ^6.0.0" from @typescript-eslint/[email protected]
npm ERR! node_modules/@typescript-eslint/parser
npm ERR! dev @typescript-eslint/parser@"^2.3.0" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: [email protected]
npm ERR! node_modules/eslint
npm ERR! peer eslint@"^5.0.0 || ^6.0.0" from @typescript-eslint/[email protected]
npm ERR! node_modules/@typescript-eslint/parser
npm ERR! dev @typescript-eslint/parser@"^2.3.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /home/chen/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/chen/.npm/_logs/2022-10-29T19_20_59_069Z-debug-0.log
Using node v16 and npm 8.19.2.
I'm trying to use coc-cairo which pulls cairo-ls from npmjs.com.
npmjs.com has only 0.0.7 version. Completions doesn't work properly with that.
Can you please upload the latest version to npmjs.com?
If a document is updated before a previous compile completes, interrupt the previous one and do not let it update the highlighting.
Hey there,
I would like to add "./lib" as a cairoPath for all my projects because this is what I use for all protostar projects, but I can only put absolute path.
Hello,
I tried to install Cairo-ls with the "Other IDE" procedure, and I had no problem with the installation. Still, when I run my node server I have my icon saying that something is running on my OS, but when I open a Cairo file in LunarVim I have neither Syntax Coloration nor LSP server.
I will be happy to help you if needed.
Have a nice day
cairo-compile -v
:
as path delimitersHello. I followed the advices of this issue to enable miniconda venv for this package. But it's not working.
If I disable use venv
and nile use venv
options, I get another error: /opt/homebrew/bin/starknet-compile: /opt/homebrew/opt/[email protected]/bin/python3.9: bad interpreter: No such file or directory
.
If I re-enable them but I put ~/.miniconda3/condabin/conda activate starknet-dev-env
in venv command
, I get the error Your shell has not been properly configured to use 'conda activate'
. Miniconda is properly set and working and it is setup in the shell too. But for some reason it is not recognised.
What do you suggest me to do?
More details:
As a Protostar user, I want Cairo-LS read cairo-path from protostar.toml
so that this VS Code extension show invalid imports correctly.
{
"cairols.cairoPathConfigurations": [
{
"path": "./protostar.toml::protostar.shared_command_configs::cairo_path"
},
{
"path": "./protostar.toml::protostar.build::cairo_path",
"scopes": ["./src/*"]
},
{
"path": "./protostar.toml::protostar.test::cairo_path",
"scopes": ["./tests/*"]
}
]
}
According to the extensibility pattern, libraries must implement external functions under a namespace, and the external function name must not start with an underscore.
The pattern also states that contracts should implement @external
functions if needed.
For some external library functions, it is reasonable that contracts always implement them. For example, Ownable.owner() is one such function.
User stories:
@external
functions from external library functions, so that I don't need to manually create them.Proposed solution:
Provide a way to automate the generation of these functions. This could be in the form of code completions or quick fixes (perhaps with info-level diagnostic highlighting if some external library functions were not exposed).
Hey :)
conda
is a very cool package manager, which lets you choose your python version and can be much more flexible than using plain venv
. I'm actually using the lightweight miniconda version.
I found that to be able to work within my already activated conda env, I simply needed to replace the venv command by echo
. I guess it still activates a valid command and makes me able to run the cairo language server within my conda env.
Just wanted to share this, in case anyone is looking to do this!
Maybe you/I could add some information in the README?
Or auto-complete function names in code even with functions that are not imported, but provide a quickfix to add them to the imported functions.
#7 does not work with https://github.com/ericglau/vim-cairo
If a suggestions list has "a", "b", "c", then "c" is missing from the quick fixes
As a Protostar user, I want to disable checking if hint is whitelisted for my test files so that Protostar's cheatcodes aren't highlighted as errors.
{
"cairols.filesUsingCustomHints": [
"./tests/**/",
]
}
See https://www.cairo-lang.org/docs/how_cairo_works/program_input_and_output.html#program-inputs
%{ %}
when I enable cairo ls extension with another extension called cairo syntax support extension , it pops red underline all the time . It disappears when I disabled this extension .
Is is possible to make this into "1-step" installation with something like :CocInstall coc-cairo
?
Hey:)!
I've been trying to set up cairo-ls in Helix. Opened a PR for getting the lsp up and running on Helix: #46.
Nonetheless, it appears I can't pass the settings to my config.
I try to pass in sourceDir
, venvCommand
, etc. For some reason, the LSP does not recognize them. Would you have an idea for how to set these settings in other environments as VSCode?
Following the setup explained in https://github.com/starknet-edu/starknet-debug it is possible to write valid code with forbidden hints (e.g. prints for debugging).
So it could be nice to pass options to the compiler, such as disable_hint_validation
because otherwise nothing else is checked (as soon as an error is found, the compilation ends and the add-on doesn't show any following error).
This plugin is a life saver but at the same time it's been sucking up resources on my pc,
Every time i edit even a single word the starknet compile function seems to get run setting my pc on overdrive.
Is there some sort of debounce setting of sorts because it's almost impossible to code using this plugin otherwise
these are all the starknet-compile comands being called along with cpu usage reports,
The plugin seems to be the culprit since upon uninstalling cpu usage doesn't spike
I got this error. I am running Ubuntu in WSL 2
1: /home/filip/cairo_venv/bin/activate: Permission denied
Cairo LS(CompileError)
What persmissions should I set ?
I'm unable to get the vscode version working with WSL (I'm on a Windows machine).
What I've done:
code
(note that I'm unable to open it directly in WSL mode like this, so I have to execute from vscode "Re-open folder in WSL")When trying to format a Cairo file, I get an error from the Cairo extension:
Formatting failed: No terminal matches ' ' in the current parser context, at line 1 col 15 %lang starknet ^ Expected one of: * IDENTIFIER * RPAR * INT * _DBL_PLUS * _NEWLINE * "+=" * EQUAL * STRING * _ARROW * LANG * DOT * RBRACE * BUILTINS * AMPERSAND * SHORT_STRING * RSQB * SEMICOLON * LPAR * LSQB * _AT * HINT * _DBL_EQ * COMMA * COMMENT * COLON * HEXINT * PLUS * SLASH * LBRACE * _NEQ * _DBL_STAR * STAR * MINUS Previous tokens: Token('IDENTIFIER', 'starknet')
Ideas?
Read the following from setup.cfg
as an alternative to the language server's sourceDir
setting:
[options.packages.find]
where = src
See https://github.com/OpenZeppelin/cairo-contracts/blob/main/setup.cfg
See https://www.cairo-lang.org/docs/hello_starknet/intro.html#your-first-contract
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.