Dax89 / automaton.nvim

VSCode-Like Workspace Configuration Manager
MIT License
36 stars 3 forks source link

Set up workspace for folder structure #6

Closed lobneroO closed 4 months ago

lobneroO commented 4 months ago

In my Rust program I have a folder structure roughly thus:

project
    |
    |---- launch.json
    |---- tasks.json
    |---- src
    |      |
    |      |---- main.rs
    |
    |---- target
    |        |
    |        |---- debug
    |        |       |
    |        |       |---- project (executable)

If I open the main.rs file in Neovim, it doesn't seem to (automatically) find the workspace setup. I cannot execute the default task. I will add a lot more folders, so I want this to always go up until it can find the workspace (or add the files to the workspace somehow). How do I do this?

This will be even more of a problem for C++ I guess, where I typically have something like this:

project
    |
    |---- build
    |       |
    |       |---- launch.json
    |       |---- tasks.json
    |       |---- Debug
    |       |       |
    |       |       |---executable
    |
    |---- CMakeLists.txt
    |
    |---- src
    |      |
    |      |---- main.cpp
Dax89 commented 4 months ago

There is no problem to add Rust support for automaton. I need to know the commands needed for building/running a project and, if there is a Debug/Release configuration, they can be added too.

Currently here I only have "base" and "cmake_gcc" configurations because are the ones needed for me

lobneroO commented 4 months ago

The problem is not the build itself. The command is cargo build, and it works when neovim has main.rs (i.e. non-root directory file) open. However, I don't know how to tell neovim that I'm in a workspace if I have main.rs (or any file in src or a subdirectory open)

Dax89 commented 4 months ago

If you already an existing project, open a file there and use Automaton init.

As i said there is not Rust premade configuration atm, so you need to select the "Base" one (but it can be added) and add/modify some tasks and launch configurations.

After that, every time you open a file that belongs to an automaton workspace, the plugin automatically switch to the workspace's folder

lobneroO commented 4 months ago

Alright, I had a problem earlier where the main.rs file wouldn't recognize any of the launch / tasks. This has been solved, although I'm not sure what exactly caused the problem. Thank you for your help.