Giter Club home page Giter Club logo

Comments (11)

FallProune1 avatar FallProune1 commented on July 20, 2024 3

Thanks, using cargo to create a Rust project worked.
Sorry, I'm a beginner in Rust, today I started learning the basics to get started.

from std-training.

SergioGasquez avatar SergioGasquez commented on July 20, 2024 1

This works. But if I also want to run in a devcontainer I need to create a separate one for each sub-directory (e.g. intro).

What do you mean? You can open the devcontainer in the espressif-trainings repo, go to the dessired folder in the Vs Code terminal an run code ., this will open the folder in VsCode using the same devcontainer

from std-training.

iot49 avatar iot49 commented on July 20, 2024 1

Oh, great - I was not aware of this. Solved!

from std-training.

SergioGasquez avatar SergioGasquez commented on July 20, 2024 1

Al momento de crear un archivo en rust me aparece tambien ese error

Why are you truing to create a rust file? Mind-expanding on which project of the training are you trying to use?

No se porque me aparece esto pero corro el archivo con esta extencion.

I would suggest you use the usual cargo commands, at least, until you get it working.

And, please, let's try to keep the issue in English, so everyone can benefit from our conversation.

from std-training.

SergioGasquez avatar SergioGasquez commented on July 20, 2024

Do you mind sharing instructions on how to reproduce this? I was able to use the container with VsCode devcontainer and I also get RA working:
image

from std-training.

iot49 avatar iot49 commented on July 20, 2024
  • MacOS Ventura 13.1
  • VSC Version: 1.77.0 (Universal), Electron: 19.1.11, Chromium: 102.0.5005.196
  • Start with "open folder in container"
  • rebuilding container created esp user, now logged in as esp
  • devcontainer.json (exactly as on GitHub) gives the following Problems:
Property settings is not allowed. [Ln 9, Col 2]
Use 'customizations/vscode/extensions' instead
Property extensions is not allowed.
Use 'customizations/vscode/extensions' instead
  • rust-analyzer v0.3.1451

image

  • opening a .rs file (e.g. hardware-check/src/main.rs) results in rust-analyzer error:
[ERROR rust_analyzer::config] failed to find any projects in [AbsPathBuf("/workspace")]
[ERROR rust_analyzer::main_loop] FetchWorkspaceError:
rust-analyzer failed to discover workspace

image

  • no run button, errors no flagged, etc.

from std-training.

iot49 avatar iot49 commented on July 20, 2024

Repo:

esp@4e5d1c01ec6c:/workspace$ whoami
esp
esp@4e5d1c01ec6c:/workspace$ git remote -v
origin  https://github.com/esp-rs/espressif-trainings.git (fetch)
origin  https://github.com/esp-rs/espressif-trainings.git (push)
esp@4e5d1c01ec6c:/workspace$ git diff
diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json
index 274b0c3..dd68912 100755
--- a/.devcontainer/devcontainer.json
+++ b/.devcontainer/devcontainer.json
@@ -17,7 +17,7 @@
     },
     "rust-analyzer.checkOnSave.command": "clippy",
     "[rust]": {
-      "editor.defaultFormatter": "rust-lang.rust-analyzer",
+      "editor.defaultFormatter": "rust-lang.rust-analyzer"
     }
   },
   "extensions": [
@@ -31,4 +31,4 @@
   "remoteUser": "esp",
   "workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind,consistency=cached",
   "workspaceFolder": "/workspace"
-}
+}
\ No newline at end of file
diff --git a/intro/hello-world/src/main.rs b/intro/hello-world/src/main.rs
index ad8a230..71b7807 100644
--- a/intro/hello-world/src/main.rs
+++ b/intro/hello-world/src/main.rs
@@ -12,3 +12,4 @@ fn main() {
         sleep(Duration::from_secs(3));
     }
 }
+
esp@4e5d1c01ec6c:/workspace$ 

from std-training.

iot49 avatar iot49 commented on July 20, 2024

Update: I created an entirely new repo with just the hello-world app, and in this case the analyzer works. No idea why it does not with this cloned repo.

from std-training.

SergioGasquez avatar SergioGasquez commented on July 20, 2024

Have you tried opening a project(e.g: intro/hardware-check) instead of the whole repo with VsCode?

from std-training.

iot49 avatar iot49 commented on July 20, 2024

from std-training.

FallProune1 avatar FallProune1 commented on July 20, 2024

Al momento de crear un archivo en rust me aparece tambien ese error [ERROR rust_analyzer::config] failed to find any projects in [AbsPathBuf("//Desktop/Rust_de_0_a_heroe")] No se porque me aparece esto pero corro el archivo con esta extencion.
Captura de pantalla 2023-12-27 a la(s) 12 17 50 a m
Por favor ayuda :v

from std-training.

Related Issues (20)

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.