Quantcast
Channel: Active questions tagged visual-studio-code - Stack Overflow
Viewing all 97371 articles
Browse latest View live

VSCode problemmatcher: Unknown subfolder for file location

$
0
0

I have a problem matcher defined like this:

"fileLocation": ["relative", "${workspaceFolder}"],

And I only know the name of the file and NOT the relative path from my compilation output. Than it only opens files when they are in the root of the workspace.

E.g. Problem matcher searches for: Package.sql But the file is under

  • root
    • Other Subfolders
    • PKGs
      • Package.sql

Is there a setting to let the problem matcher "find" that file, even if it's in a (unknown) subfolder? (Assumed all filenames are distinct)


VSCode PhpStorm formatter fails

$
0
0

I have installed PhpStorm formatter in VSCode (latest update) and we have PhpStorm installed on the computer I work with. I went to preferences/settings and I set the "Editor:default formatter" to PhpStorm formatter in VSCode.

My VSCode settings.json looks like this:

{
    "window.zoomLevel": 2,
    "workbench.colorTheme": "Quiet Light",
    "workbench.iconTheme": "vscode-simpler-icons",
    "workbench.colorCustomizations": {
        "editor.background": "#f3f3f3",
        "sideBar.background": "#e9e9e9"
    },
    "workbench.statusBar.visible": true,
    "files.autoSave": "afterDelay",
    "editor.formatOnPaste": true,
    "editor.formatOnSave": true,
    "emmet.triggerExpansionOnTab": true,
    "blade.format.enable": true,
    "editor.defaultFormatter": "animus-coop.vscode-phpstorm-formatter",
    "phpstormFormatter.ideBinPath": "C:\\Program Files\\JetBrains\\PhpStorm 2019.3.2\\bin",
    "editor.fontSize": 15
}

But when I push Alt+Shift+F to format the code in VSCode, an error pops up saying:

Failed to format this document.

Any suggestions?

How to disable browser launch when building and running in .NET Core

$
0
0

I'm developing a Web API with .NET Core in macOS with deployment to Linux. I have absolutely no interest in using the browser. However, when building and running from Visual Studio Code (Debug or not), the browser launches every time.

I have to close the tab, remove the browser out of the way, go to Paw, where I actually test the API, then go back to VS Code.

It's really annoying doing this every time.

Isn't there some configuration to disable browser launch?

Thanks

Change terminal in visual studio code by iTerm2 with Powerlevel10k

$
0
0

I'm trying to change my VScode terminal. I have followed this tutorial.

My iTerm terminal has been changed perfectly : enter image description here

I tried to edit my settings.json files in VScode like this :

{
    "terminal.external.osxExec": "iTerm.app",
    "terminal.integrated.shell.osx": "/bin/zsh",
    "terminal.integrated.fontFamily": "'SourceCodePro+Powerline+Awesome Regular'"
}

But i got this different result :

enter image description here

I can't understand why the parameters are not the same and some images do not pass in VScode.

Cannot link css file to HTML file in VScode [closed]

$
0
0

The code

Directory which I use:

(Desktop)/HTML/omnifood/ (resources,vendor,index.html)
              resources/(css,img,data,js)
               css/style.css```



vscode: update to stylistic sets using font ligatures with Fira Code

$
0
0

See October, 2019 Release Notes - stylistic sets.

Font feature settings

There is now more fine grained control over the font features. When configuring "editor.fontLigatures": true, VS Code would turn on liga and calt. But some fonts have more settings, such as stylistic sets used by Fira Code.

We now allow these font features to be explicitly controlled, for example:

"editor.fontFamily": "Fira Code",

"editor.fontLigatures": true,

"[javascript]": {  
   "editor.fontLigatures": "'ss02', 'ss19'",
},

This is what stylistic sets can do. (See https://github.com/tonsky/FiraCode#stylistic-sets.)

Fira Code v2 stylistic sets.

I was already using Fira Code, so I thought I could download version 2 of the font and add the following lines to the editor settings.

"editor.fontFamily": "Fira Code",  
  "editor.fontLigatures":"'zero', 'ss02', 'ss03', 'ss04', 'ss05', 'calt'",

I was getting strange results: The zero style would work, but previously working ligatures stopped working; other sets didn't work at all.

How do I get Fira Code version 2 stylistic sets working in Visual Studio Code?

How can I enter input in the output of vs code?

$
0
0

How would I enter user text (entered via cin) if I build the file using the top right button in the image below?

enter image description here

Is there a plugin that I have to use to disable the readonly console?

How do I fix the following phpcs error in Visual Studio Code?

$
0
0

I am new to VS code. I am trying to work with PHP, but I keep getting this notification.

phpcs: Request workspace/configuration failed with message:unable to locate phpcs. please add phpcs to your global path or use composer dependency manager to install it in your project locally.

Intellisense doesn't work for PHP too. I am using a Windows system. I tried to download and install Composer, but I am still getting the problem as shown in the screenshot.

[screenshot]1

I have some extensions installed which are visible in the screenshot, but the issue persists.


Why have parenthesis become red in Visual Studio Code when writting TypeScript?

Changing the colour of curley braces inside VSC

$
0
0

I write content in VSC and I use handlebars to write content.

{{#jan}} Hello my name is Tony {{else}} Hi my name is Bob {{/if}}

Is there any way I can get the content inside the {{}} to highlight something like bright yellow? when I have loads of these in the docs, its hard to spot them when scrolling.

I've tried messing around with the workspace settings.js file but have had no luck. Thanks

VSCode Remote SSH Connection Failed

$
0
0

I'm trying to use the Remote-SSH extension to edit files on a Debian server. The SSH connection is established correctly but then I get an error message :

Failed to connect to the remote extension host server

And the log :

[13:19:04.182] Remote server is listening on port 51569
[13:19:04.182] Parsed server configuration: {"agentPort":51569,"osReleaseId":"debian","arch":"x86_64","webUiAccessToken":"","sshAuthSock":"","tmpDir":"/tmp"}
[13:19:04.184] Starting forwarding server. localPort 59828 -> socksPort 59825 -> remotePort 51569
[13:19:04.185] Forwarding server listening on 59828
[13:19:04.185] Waiting for ssh tunnel to be ready
[13:19:04.186] Tunneled remote port 51569 to local port 59828
[13:19:04.186] Resolved "ssh-remote+home-debian.web-data.host" to "127.0.0.1:59828"
[13:19:04.187] [Forwarding server 59828] Got connection 0
[13:19:04.195] ------
[13:19:04.208] [Forwarding server 59828] Got connection 1
[13:19:04.208] [Forwarding server 59828] Got connection 2
[13:19:04.217] Failed to set up socket for dynamic port forward to remote port 51569: Socket closed. Is the remote port correct?
[13:19:04.227] > channel 3: open failed: administratively prohibited: open failed
[13:19:04.235] Failed to set up socket for dynamic port forward to remote port 51569: Socket closed. Is the remote port correct?
[13:19:04.237] Failed to set up socket for dynamic port forward to remote port 51569: Socket closed. Is the remote port correct?
[13:19:04.241] > channel 4: open failed: administratively prohibited: open failed
> channel 5: open failed: administratively prohibited: open failed

I am using the remote ssh connection on several other servers and have never had this error. I have tested a few things gleaned from the web but nothing has worked so far.

Could someone enlighten me on the reason for the problem or on a possible solution ? Thanks !

Python/Jupyter notebook in VSCode does not use the right environment

$
0
0

The situation

I use Anaconda 3 on Windows 10.

I have a Visual Studio Code workspace (my_workspace) than contains a Jupyter notebook (my_notebook.ipynb). VSCode has the Python extension installed.

The file my_workspace/settings.json contains:

{
    "python.pythonPath": "C:\\Users\\Me\\Anaconda3\\envs\\my_env\\python.exe"
}

my_env is an existing Anaconda environment. I can activate it and work with it in a shell, and if I run jupyter lab in such a shell, the code inside the notebooks can import my_env's packages as expected.

If I open my_workspace in VSCode, then my_notebook.ipynb in a tab, my_env is also mentioned in VSCode's status bar ("Python 3.7.6 64-bit ('my_env': conda)"), and my_env is automatically activated when I open a PowerShell prompt in VSCode's console (I ran conda init once).

The problem

When the notebook is opened in VSCode, the Jupyter kernel seems to use the base environment's Python interpreter instead of the one in my_env. When importing a package installed in my_env, but not in base, I get this error:

>>> import keras
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'keras'

This happens for all packages, not just keras.

In the notebook tab in VSCode, if I click on the interpreter's name in the top-right corner, then choose the correct interpreter (the one in my_env), then the notebook runs correctly in my_env. But I have to do this every time I re-open VSCode.

How to make the default kernel respect the environment chosen in settings.json?

I cannot create conda virtual environment using cmd or powershell using VS Code on Windows 10 operating system. Need an instant help. Help me

$
0
0

D:\Codes\VSCode>conda activate env -n testenv activate does not accept more than one argument: ['env', '-n', 'testenv']

D:\Codes\VSCode>conda create env -n testenv Collecting package metadata (current_repodata.json): done Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source. Collecting package metadata (repodata.json): done Solving environment: failed

PackagesNotFoundError: The following packages are not available from current channels:

  • env

Current channels:

To search for alternate channels that may provide the conda package you're looking for, navigate to

https://anaconda.org

and use the search bar at the top of the page.

Whenever I switch from command prompt to windows powershell on visual studio code I get the following erros or warnings. How to deal with problem?

$
0
0

I get the following Unexpected token errors. What to do guys please help me.

Windows PowerShell Copyright (C) Microsoft Corporation. All rights reserved.

Try the new cross-platform PowerShell https://aka.ms/pscore6

Invoke-Expression : At line:1 char:1329 + ... win32pe_edu;C:\Users\gon26\AppData\Local\atom\bin;"D:\Program Files\M ... + ~~~~~~~~~~ Unexpected token 'D:\Program' in expression or statement. At D:\Anaconda3\shell\condabin\Conda.psm1:101 char:9 + Invoke-Expression -Command $activateCommand; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ParserError: (:) [Invoke-Expression], ParseException + FullyQualifiedErrorId : UnexpectedToken,Microsoft.PowerShell.Commands.InvokeExpressionCommand

Loading personal and system profiles took 781ms. PS D:\Codes\VSCode>

Is there a way to not have to change access permission in /var/www/ on ubuntu every time?

$
0
0

I am working on Apache2 OctoberCMS projects in the /var/www directory on Ubuntu, and every time I start a new project, or create a new file/ folder in there, I have to ensure I have permissions by running:

sudo chmod -R g+rwx *folderName*
sudo chmod -R g+s *folderName*

My user has been added to the www-data group and the directories are set to www-data:www-data.

Is there a way to not have to run those commands every time?


How add keywords (for syntax highlighting) in vs code for c and cpp

$
0
0

I program C and CPP code in VS code.

I have certain macro's for which I would like the same color highlighting like 'if' and 'else; etc.

I have searched the internet for the solution, but I either cannot find it, or I don't understand what to do.

I am used to work with the Kate editor which has a most simple option's menu with which you could do whatever you liked. Now I am stuck with these Json files of which I understand very little.

How can I add syntax highlighting in VS vode for my custom words in C and CPP?

Adding a timestamp to each Chrome debug entry

$
0
0

Now that I can wonderfully debug my Angular/TS code directly from VSCode, i would like to differentiate the various console.log() that i trigger along my debugging session.

I activated the 'Show timestamps' feature in the Brave debugger options, but they won't show up in vscode attached debugger..

My attached chrome debugger in vscode

I searched on the extension repo& here, nothing really outstanded...

If someone's got an idea ... Thanks in advance !

Errors while using VS Code extension

$
0
0

I try to use the VS Code extension for Isabelle 2019. When I try to open the Isabelle output I get the exception

Exception in thread "event_timer" java.util.NoSuchElementException: key not found: IsabelleDejaVuSans.ttf
at scala.collection.MapLike.default(MapLike.scala:231)
at scala.collection.MapLike.default$(MapLike.scala:230)
at scala.collection.AbstractMap.default(Map.scala:59)
at scala.collection.MapLike.apply(MapLike.scala:140)
at scala.collection.MapLike.apply$(MapLike.scala:139)
at scala.collection.AbstractMap.apply(Map.scala:59)
at isabelle.HTML$.font_face$1(html.scala:366)
at isabelle.HTML$.$anonfun$fonts_css$1(html.scala:371)
at scala.collection.immutable.List.map(List.scala:282)
at isabelle.HTML$.fonts_css(html.scala:371)
at isabelle.Present$.output_document$1(present.scala:120)
at isabelle.Present$.preview(present.scala:138)
at isabelle.vscode.Preview_Panel.$anonfun$flush$2(preview_panel.scala:33)
at scala.collection.TraversableOnce.$anonfun$foldLeft$1(TraversableOnce.scala:156)
at scala.collection.TraversableOnce.$anonfun$foldLeft$1$adapted(TraversableOnce.scala:156)
at scala.collection.Iterator.foreach(Iterator.scala:937)
at scala.collection.Iterator.foreach$(Iterator.scala:937)
at scala.collection.AbstractIterator.foreach(Iterator.scala:1425)
at scala.collection.TraversableOnce.foldLeft(TraversableOnce.scala:156)
at scala.collection.TraversableOnce.foldLeft$(TraversableOnce.scala:154)
at scala.collection.AbstractIterator.foldLeft(Iterator.scala:1425)
at scala.collection.TraversableOnce.$div$colon(TraversableOnce.scala:150)
at scala.collection.TraversableOnce.$div$colon$(TraversableOnce.scala:150)
at scala.collection.AbstractIterator.$div$colon(Iterator.scala:1425)
at isabelle.vscode.Preview_Panel.$anonfun$flush$1(preview_panel.scala:27)
at isabelle.Synchronized.change_result(synchronized.scala:73)
at isabelle.vscode.Preview_Panel.flush(preview_panel.scala:24)
at isabelle.vscode.Server.$anonfun$delay_preview$2(server.scala:210)
at isabelle.Standard_Thread$Delay.run(standard_thread.scala:64)
at isabelle.Standard_Thread$Delay.$anonfun$invoke$1(standard_thread.scala:77)
at isabelle.Event_Timer$$anon$1.run(event_timer.scala:27)
at java.base/java.util.TimerThread.mainLoop(Timer.java:556)
at java.base/java.util.TimerThread.run(Timer.java:506)

If I then do anything else (for example typing in the code window) another exception is raised every time

[Error - 9:01:48 PM] java.lang.IllegalStateException: Timer already cancelled.

How can I get rid of these two errors?


I found the same or a similar problem here, and they recommend running

$ isabelle scala
scala> import isabelle._
scala> Isabelle_Fonts.fonts(hidden = true)

Which results in

res0: List[isabelle.Isabelle_Fonts.Entry] = List(Entry("/home/daniel/opt/isabelle/contrib/isabelle_fonts-20190409/ttf-hinted/IsabelleDejaVuSans.ttf",false), Entry("/home/daniel/opt/isabelle/contrib/isabelle_fonts-20190409/ttf-hinted/IsabelleDejaVuSans-Bold.ttf",false), Entry("/home/daniel/opt/isabelle/contrib/isabelle_fonts-20190409/ttf-hinted/IsabelleDejaVuSans-Oblique.ttf",false), Entry("/home/daniel/opt/isabelle/contrib/isabelle_fonts-20190409/ttf-hinted/IsabelleDejaVuSans-BoldOblique.ttf",false), Entry("/home/daniel/opt/isabelle/contrib/isabelle_fonts-20190409/ttf-hinted/IsabelleDejaVuSansMono.ttf",false), Entry("/home/daniel/opt/isabelle/contrib/isabelle_fonts-20190409/ttf-hinted/IsabelleDejaVuSansMono-Bold.ttf",false), Entry("/home/daniel/opt/isabelle/con...

How to run unsafe code in "visual studio code"?

$
0
0

I am using Visual studio code and when I try to run an unsafe code it throws the following error ""message": Unsafe code may only appear if compiling with /unsafe"

and as in visual studio, it does not have option like project->properties.

Create a snippet tree in VSCode

$
0
0

I was wondering if it is possible in VSCode to create a folder tree with snippets inside like so:

 my-component
   |_index.js  (filled with a placeholder component)
   |_styles.js (filled with a placeholder stuff)
Viewing all 97371 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>