GithubHelp home page GithubHelp logo

ericglau / cairo-ls Goto Github PK

View Code? Open in Web Editor NEW
60.0 60.0 6.0 1.39 MB

Cairo Language Server

Home Page: https://marketplace.visualstudio.com/items?itemName=ericglau.cairo-ls

License: Eclipse Public License 2.0

TypeScript 99.32% Shell 0.68%

cairo-ls's People

Contributors

eikix avatar ericglau avatar maksymiliandemitraszek avatar radinyn avatar zetsuboii avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

cairo-ls's Issues

Could not resolve dependencies error when attempting `npm i`

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.

Need latest version in npmjs.com

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?

unable to use relative paths in cairoPath

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.

Not working with LunarVim

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

Check for existence of Nile or Cairo, and StarkWare's vscode-cairo

  • Check for the existence of Nile or Cairo commands, otherwise give an error (including mentioning to use a venv if needed)
  • Give an error/warning if StarkWare's vscode-cairo is not installed
  • Give an error if the installed version of StarkWare's vscode-cairo is older than cairo-compile -v

Miniconda venv not working with this package

Hello. 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:

  • macOS Monterey
  • M1 MacBook
  • I have installed cairo-nile with pip in the venv I am trying to enable

Allow configuring `cairo-path` from a `toml` file

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/*"]
    }
  ]
}

Provide a way to auto-generate `@external` contract functions

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:

  1. As a contract developer, I want to be notified if I forgot to expose some external library functions, so that my users will not have missing functionality.
  2. As a contract developer, I want to be able to automatically generate @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).

Supporting conda environments

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?

Pop up red underline all the time

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 .

Not able to set cairo-ls settings in Helix IDE

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?

Pass compile options in config

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).

100% CPU usage

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
image
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

Permission denied

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 ?

Unable to use vscode version with WSL

I'm unable to get the vscode version working with WSL (I'm on a Windows machine).

What I've done:

  • Install the Cairo plugin: https://www.cairo-lang.org/docs/quickstart.html#visual-studio-code-setup
  • Install this plugin
  • Configure venv path in plugin settings
  • Configure contracts folder in plugin settings
  • Open the VS code from a WSL terminal running the venv with 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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.