How to enable make command in vscode - visual-studio-code

I've downloaded VSCode and installed a Verilog extensions.
Reading VsCode manual there should be a build in Make command.
First I created some verilog files.
Then I created a MakeFile with a compile command for the verilog command.
From the Terminal window I write:
Make
The only response I get is something similar like this "Make not recognized"
Am I missing some steps here ?

Related

An error in the running of kotline in vscode

enter image description here
Can anyone say how to debug it
It seems like your kotlin directory is not added to your PATH variable thus the extension/terminal may not know what to execute, when trying to execute kotlinc.
The easiest way to resolve this issue is by adding the path to your kotlin directory (path/to/your/kotlin/bin) to your PATH variable
(see here), if you are on windows, or here, if you are on a linux system.
You can check, if it works by opening a command line window and trying to execute
kotlinc -version
However, as it seems like you are using Code-Runner extension in vscode, you can also update your settings.json file:
reference here.

setting up visual studio code for c++, but unable to compile

I have installed visual studio 2019 which works fine for c++ but unable to create folders and sections to store multiple code files. So thought of switching to visual studio code and followed all tutorials available on youtube and documentation. But Visual studio IDE has got nothing showing up when Run Build task is initiated, which is expected to show the c++ extension downloaded. Mingw64 is installed and checked in the terminal too.
no output or terminal opened on Run
compiler installation checked
From the image attached regarding no output in the terminal or terminal opened, it looks like the exe is made because it says 'Build finsihed succesfully'. You'll need to run this executable from the terminal.
For this, if youre in the same directory all you have to do is type the filename. helloworld.exe in the cmd, if its powershell, then ./helloworld.exe. (Also note that for exe files you dont need to explicitly mention .exe at the end of the file name)
The powershell method should work on cmd too.
And if youre not in the same directory as the executable, you can either change directory by typing cd path/to/file and proceed as above, or run directly by typing path/to/file/helloworld.exe. where path/to/file is the directory of your helloworld.exe file

Wrong Python interpreter being used by VS Code

I am on Ubuntu 20.04 and have both Python2 and Python3 installed natively. I have also installed Python through miniforge, a variant of miniconda. In VSCode I have both the MS Python extension and Pylance installed.
I use the miniforge python for my coding. This works perfectly fine in PyCharm.
However in VSCode, when I try to execute the same file I get errors. After investigating it seems that VSCode is picking native Python2 - even though I have the miniforge Python selected. In this picture it can be seen that the status bar at the bottom states Python interpreter selected is Python3. But the output window shows that the python interpreter is Python2.
A more confusing thing is when I use VSCode for Jupyter notebook files then it picks up the interpreter correctly and I have no issues.
I have checked both User and Workspace settings, and they all point to Python3. How can I fix this for standard .py files?
I prefer VSCode to PyCharm, but will need to use PyCharm till this is resolved.
It seems that your system console cannot see python3. You need to put the python3 in the PATH variable, before python2. Like:
PATH=path/to/python3:path/to/python2:$PATH
Also, make sure that the environment containing python3 is activated before command prompt appears. It can be done in bash_profile by adding a line like
conda activate my_env_with_python3
Try changing the settings "Python:Python path", "Python:default interpreter path" and "Python:conda path" also.
I have just bumped into something similar. The Run code option resulted in the file being run with the default interpreter instead of the venv-based one with necessary packages installed.
The fix was simply to use "Run python file" instead:
The run-code behavior must be customizable, something is mentioned e.g. here: Run Code vs Run Python File in Terminal for VSCODE but I didn't bother.

Need help assigning global settings for Rstudio's pandoc in VSCode to knit pdf_document in a .rmd output format

So I am migrating from RStudio to Visual Studio Code for my future R projects. I have successfully gotten my github aspect all setup and I am trying to write my code in (.rmd) format so that I can knit it to pdf, html and flex_dashboard outputs. When I have tried to knit the it, I get the following error:
rmarkdown::render("c:\Users\{user}\{folder}\{sub-folder}\{sub-folder}\Co$
Error: pandoc version 1.12.3 or higher is required and was not found (see the help page ?rmarkdown::pandoc_available).>
I found the following solution that once run in the terminal, allows it to knit into a pdf_document successfully.
Code: Sys.setenv(RSTUDIO_PANDOC="--- insert directory here ---")
Reference: pandoc version 1.12.3 or higher is required and was not found (R shiny)
This is great, but everytime I restart VSCode, this setting appears to be reset and I have to run it again. Is there away to set this globally so that I don't have to run it every time I use it? Or is there a better way to do this?
I had a similar problem before in VScode to render R markdown. Now, I found the solutions to it.
Following the steps below to properly set up the pandoc:
Step 1:
Go to your R Studio and go the console, type the following:
Sys.getenv("RSTUDIO_PANDOC")
If you are using MacOS, you will get the path for "pandoc": "/Applications/RStudio.app/Contents/MacOS/pandoc"
If you are using Windows, you probably will get the path like:
"/c/Program Files/RStudio/bin/pandoc/" as mentioned in pandoc version 1.12.3 or higher is required and was not found (R shiny)
Step 2:
Paste the path of "pandoc" and put it into your bash or zsh (depends on what command shell that you are using).
On MacOS, I'm using zsh. Therefore, I add the following path into ~/.zshrc:
export RSTUDIO_PANDOC="/Applications/RStudio.app/Contents/MacOS/pandoc"
As for how to edit ~/.zshrc, one way to do this is presented as follows:
step 2.1
nano ~/.zshrc
It will open your .zshrc file and navigate to the bottom of this file, paste the
export RSTUDIO_PANDOC="/Applications/RStudio.app/Contents/MacOS/pandoc". Then, control + X to exit. It will ask about "Save modified buffer (ANSWERING "No" WILL DESTROY CHANGES) ?", then type Y and type return bottom.
step 2.2
source ~/.zshrc
Now, it should work fine in VScode. By checking if it works, you could open your console by typing R to invoke the R environment and type Sys.getenv("RSTUDIO_PANDOC"). If it returns the path of the "pandoc", it would work fine in VScode as well.
Adding
"terminal.integrated.env.osx": {
"RSTUDIO_PANDOC":"/Applications/RStudio.app/Contents/MacOS/pandoc"
}
into settings.json worked for me.
Adding to .zshrc didn't work at all since the System environment wasn't being passed on to the integrated terminal.

How do I get perl-support.vim to recognize Perl files?

I installed perl-support.vim into ~/.vim (unzipped). When I create a new .pl file it shows me the default template, which means my installation is successful (I guess). I have already added filetype plugin on in ~/.vimrc & /etc/vimrc.
How do I enter a perl-support command?
The write up recommends typing \isu in normal mode for creating a new sub, but the moment I hit i vim changes into insert mode and nothing intended happens.
What am I doing wrong?
Make sure you've enabled ftplugins with the filetype plugin on command in .vimrc, and of course make sure that the file you're editing is recognized as a Perl file (usually, by having a known extension, but you can force the matter by issuing the command set filetype=perl. If filetype plugins aren't enabled, or if the filetype isn't recognized, then the rest of perl-support won't get loaded at all.
As recommended by hobbs, set filetype=perl works.
However, I wanted to do this everytime I open a .t test file — which my vim does not recognize as perl files because the interpreter statement is also custom.
I checked out :help syntax in vim and saw this:
mkdir ~/.vim/ftdetect
cd ~/.vim/ftdetect
vim t.vim
which contains
au BufRead,BufNewFile *.t set filetype=perl
which means: if the file extension is .t then do set filetype=perl.
This can be useful for any other custom extension.
I found I had to install Perl::Tags before most things (esp. \ commands). Installing Perl::Tags made an error message thrown by filetype plugin on go away.
cpan> install Perl::Tags # make sure you say yes to any offer to install dependancies