Showing posts with label visual-studio-code. Show all posts
Showing posts with label visual-studio-code. Show all posts

Friday, September 21, 2018

VSCode: message: The preLaunch task 'build' terminated with exit code 1

Leave a Comment

OK. I am in .NetCore and using VSCode on Mac machine. Now, whenever I run my C# project then VSCode shows this annoying message:

The preLaunch task 'build' terminated with exit code 1

It shows me option to click on a button called show problems. When I click on this button, it only shows the warning messages. Now, if it was errors then its OK to see this message. But the fact that it shows this message every time there are warning(Which to me is OK). That is very annoying. Is there any way I can configure VS Code to not show these messages on things like warning?

2 Answers

Answers 1

It might be a problem with your task.json file, check the arguments of the file and make sure the build is pointing at the right location:

{     "version": "2.0.0",     "tasks": [         {             "label": "build",             "command": "dotnet",             "type": "process",             "args": [                 "build",                 "${workspaceFolder}/MyProject.csproj"             ],             "problemMatcher": "$msCompile"         }     ] } 

Answers 2

It means you're code isn't running properly as it has returned code 1.

Whenever vscode shows you this message, simply choose cancle and then go to your terminal. It should show you the problems. Then you should start debugging your code.

Please note that as you know, when debugging, Breakpoints lend the most help.

Read More

Wednesday, September 12, 2018

vscode jump to git/source control shortcut/command for current file

Leave a Comment

Just wondering if anyone knows if there is a shortcut or command in vscode that will jump the current file to the source control tab?

I know that if you're in source control, cmd + ; will jump you to the file alone, but if you want to get back to the source control view, is there a reverse command?

Thanks!

1 Answers

Answers 1

You can add a keyboard shortcut to jump to git changes view like so:

{   "key": "shift+cmd+;",   "command": "git.openChange" }, {   "key": "cmd+;",   "command": "git.openFile" } 

then you can use cmd+; from within a file to jump to its git changes and shift+cmd+; to jump back.

Read More

Wednesday, September 5, 2018

HTML KnockoutJS intellisense in Visual Studio Code

Leave a Comment

Using Visual Studio Code I want to enable HTML KnockoutJS intellisense, based on a binding. There's a snag as I use TypeScript (TS) and bind the model in code:

ko.applyBindings(myViewModel); 

All TS files are generated and rendered into app.js

I want a similar functionality found here. https://johnpapa.net/knockout-intellisense-in-visual-studio-2012/

example intellisense functionality

NB: I'm using debug version of KnockoutJS

<script src="libraries/knockout-3.4.1.debug.js" type="text/javascript"></script> 

1 Answers

Answers 1

EDIT


Just noticed one thing after writing the answer, you are applying binding correctly but after that missing object name before function name, here what is difference here:

For Example,

Adding binding:

ko.applyBindings(seViewModel, document.getElementById("Div")); 

Using binding :

<div data-bind="foreach: ko.utils.arrayFilter(seViewModel.ImplementationModels(), function(item) {return item.ModelType()==globalMessages.IN_A_DAY})">                                                                         <label class="checkbox-inline">                                                                             <input type="radio" group="implementationModelGroup" class="implementationModelCheck" data-bind="value: ImplementationModelId, click: seViewModel.ImplementationModelCheckBoxClick.bind($data), checked:seViewModel.ImplementationModelCheckedValue()" />                                                                             <span class="subData text-break" data-bind="text: ImplementationModelName"></span>                                                                         </label>                                                                     </div> 

Here if I don't use viewmodel name seViewModel autocomplete doesn't work


Not sure about why it is not working for you, I opened an old project in VS code & it was already working. It is not only giving autocomplete for KO object but also for my viewmodel & controller action methods in C# class, I am adding a screenshot for reference enter image description here

I am adding my current project setting & vs extensions, it might help you.

VS CODE Details :

Version: 1.26.1 Commit: 493869ee8e8a846b0855873886fc79d480d342de Date: 2018-08-16T18:38:57.434Z Electron: 2.0.5 Chrome: 61.0.3163.100 Node.js: 8.9.3 V8: 6.1.534.41 Architecture: x64 

Extensions :

enter image description here

Which KO files I have added:

 <Content Include="Scripts\libs\knockout-3.4.0.js" />  <Content Include="Scripts\libs\knockout.mapping-latest.js" />  <Content Include="Scripts\libs\knockout.validation.min.js" /> 

It is ASP.NET MVC project, KO is used for model-attribute binding.

Read More

Monday, August 20, 2018

Debug Vue.js App with VS Code. Error Unverified Breakpoint

Leave a Comment

I have the following problem. I want to debug my Vue.js project with VS Code and Chrome. So I follow the official guide on the website Guide but it dont work. The Problem is that I always get the error :

 unverified breakpoint 

What do I wrong?

This is my vue.config.js

    module.exports = {     configureWebpack: {       devtool: 'source-map'     }   } 

This is my debugging stetting:

    {     // Use IntelliSense to learn about possible attributes.     // Hover to view descriptions of existing attributes.     // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387     "version": "0.2.0",     "configurations": [         {             "type": "chrome",             "request": "launch",             "name": "vuejs: chrome",             "url": "http://localhost:8080",             "webRoot": "${workspaceFolder}/src",             "breakOnLoad": true,             "sourceMapPathOverrides": {                 "webpack:/src/*": "${webRoot}/*",                 "webpack:///./*": "${webRoot}/*",                 "webpack:///src/*": "${webRoot}/*",                 "webpack:///*": "*",                 "webpack:///./~/*": "${webRoot}/node_modules/*",                 "meteor://💻app/*": "${webRoot}/*"             }         }     ] } 

And this is my package.json

    "name": "test-app",   "version": "0.1.0",   "private": true,   "scripts": {     "serve": "vue-cli-service serve",     "build": "vue-cli-service build",     "lint": "vue-cli-service lint"   }, 

When I try npm run serve I get the error message unverified breakpoint and my breakpoint is never be hit.

I use the vue-cli 3 to generate the project.

Can someone help me pls?

Update

Maybe something is wrong with the path. Because when i run .scripts in the debugger console in VS Code I get paths like this

(c:\Users\XY\Desktop\Vue\route-app\webpack:\src\main.ts) 

But there is no folder webpack:. But I have no idea why he is thinking that there is a folder. He make this in every file.

And in my tsconfig.js I already have "sourceMap": true.

Update 2

When I check the checkbox All Exceptions, VS Code show me all Exceptions in my App (they are catched). But my Breakpoints still dont work.

Update 3

My project looks like this

C:\Users\User\Desktop\Vue\route-app | -----.vscode      |      -----launch.json | -----node_modules      |      ----- modules etc. | -----public      |      ----- index.html      |      ----- manifest.json      |      ----- favicon.ico | -----src      |      ----- components            |            ----- all my components.vue files      |      ----- views            |            ----- all my views.vue files (this files are for routing)      |      ----- App.vue      |      ----- main.ts      |      ----- registerServiceWorker.ts      |      ----- router.ts      |      ----- shims-tsx.d.ts      |      ----- shims-vue.d.ts      |      ----- store.ts | -----.postcssrc.js | -----babel.config.js | -----package-lock.json | -----package.json | -----tsconfig.json | -----tslint.json | -----vue.config.js 

1 Answers

Answers 1

This debug adapter doesn't use the same syntax as the Chrome debug adapter: remove the * at the end of url and path:

"webpack:///src/": "${webRoot}/" 
Read More

Sunday, July 15, 2018

SyntaxError: invalid syntax with variable annotation

Leave a Comment

I have installed visual studio code and code runner extension. I then have this piece of code:

text: str = "slkdfjsd" 

I click CTRL-ALT-N and I get:

    text: str = "slkdfjsd"         ^ SyntaxError: invalid syntax 

I like using types, and this program worked, it looks like its complaining about the types how can I have it understand that types are ok?

more details:

$ /usr/bin/env python3 --version Python 3.6.6 :: Anaconda, Inc. 

and when it's running it with:

[Running] /usr/bin/env python3 "/home/myuser/dev/projects/python-snippets/text-summarization"   File "/home/myuser/dev/projects/python-snippets/text-summarization", line 44     text: str = "slkdfjsd"         ^ SyntaxError: invalid syntax 

Code runner plugin docs says:

$pythonPath: The path of Python interpreter (set by Python: Select Interpreter command)

but when I run print the path as comments suggested, I get a different version:

sys.version_info(major=3, minor=5, micro=2, releaselevel='final', serial=0) 

which is different as you can see above from the >python: select interpreter which I have chosen.

Note also that when I run this code in visual studio code with run in terminal instead of CTRL-ALT-N then the python version chosen is 3.6 and it runs fine without any syntax error, so it I think it's something with the code runner not seeing the same python version that I see when selecting >python: select interpreter

Update: I see indeed that code-runner is using the wrong python interpreter as stated above, so I opened my user settings and tried to update python to point to the correct interpreter however it did not change anything it's still using the same wrong interpreter here is what I tried:

{     "git.autofetch": true,     "terminal.integrated.rendererType": "dom",     "code-runner.executorMap": {         "javascript": "node",         "java": "cd $dir && javac $fileName && java $fileNameWithoutExt",         "c": "cd $dir && gcc $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",         "cpp": "cd $dir && g++ $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",         "objective-c": "cd $dir && gcc -framework Cocoa $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",         "php": "php",         "python": "/home/user/home/user/dev/anaconda3/envs/pymachine/bin/python",         "perl": "perl",         "perl6": "perl6",         "ruby": "ruby",         "go": "go run",         "lua": "lua",         "groovy": "groovy",         "powershell": "powershell -ExecutionPolicy ByPass -File",         "bat": "cmd /c",         "shellscript": "bash",         "fsharp": "fsi",         "csharp": "scriptcs",         "vbscript": "cscript //Nologo",         "typescript": "ts-node",         "coffeescript": "coffee",         "scala": "scala",         "swift": "swift",         "julia": "julia",         "crystal": "crystal",         "ocaml": "ocaml",         "r": "Rscript",         "applescript": "osascript",         "clojure": "lein exec",         "haxe": "haxe --cwd $dirWithoutTrailingSlash --run $fileNameWithoutExt",         "rust": "cd $dir && rustc $fileName && $dir$fileNameWithoutExt",         "racket": "racket",         "ahk": "autohotkey",         "autoit": "autoit3",         "dart": "dart",         "pascal": "cd $dir && fpc $fileName && $dir$fileNameWithoutExt",         "d": "cd $dir && dmd $fileName && $dir$fileNameWithoutExt",         "haskell": "runhaskell",         "nim": "nim compile --verbosity:0 --hints:off --run"       } } 

However also after changing that (maybe i'm doig something wrong i'm vscode newbie) I still see that the code-runner is running it with:

[Running] /usr/bin/env python3 "/home/myuser/dev/projects/python-snippets/text-summarization" 

1 Answers

Answers 1

Note: the following answer assumes you are on the correct version (3.6+), if not: simply, variable annotation isn't supported on your current version of Python.


The problem may seem like the type annotation is causing the SyntaxError, but another very plausible possibility is that there is an unclosed parenthesis or a unclosed something in the lines preceding. Since in the docs, it said:

The parser repeats the offending line and displays a little ‘arrow’ pointing at the earliest point in the line where the error was detected. The error is caused by (or at least detected at) the token preceding the arrow

(emphasis mine)

The parser can only detect an unclosed bracket when a token that is invalid in that context is given. Since brackets and parenthesis can carry through multiple lines (which means EOL wouldn't be raised), and text is a valid variable identifier, which leaves only that colons aren't allowed in brackets or parentheses (excepted when it's used as an parameter, which also accepts type annotation).

Here's an reproducible example of your code hosted on tio.run (the SE code-golf compiler):

https://tio.run/##K6gsycjPM/7/X4OrJLWixEqhuKRIwVZBXf3/fwA

( text: str = '' 

The : is the first invalid token in that context.

  File ".code.tio", line 2     text: str = ''         ^ SyntaxError: invalid syntax 

If you have an unclosed dict instead, where colons are allowed, the arrow would be pointing somewhere else since text: str are all valid tokens proceeded by an opening {. The pointer will be pointing at the equal sign, since that's the first invalid token.

{ text: str = '' 

And the exception:

  File ".code.tio", line 2     text: str = ''               ^ SyntaxError: invalid syntax 
Read More

Friday, June 15, 2018

Changing the external console used by launch.json

Leave a Comment

I'm trying to get the output from the process I am debugging to display in iTerm.

I have added the following lines to my UserSettings file

"terminal.external.osxExec": "iTerm.app", "terminal.explorerKind": "external", 

And when I select open in terminal from within Visual Studio Code it does indeed open with iTerm.

However when I set "externalConsole": true, in my launch.json file, the output still shows up in a new Terminal.app window.

How do I get the debugging output to show up in iTerm? Do I need to change more settings?


I have read this question. The steps I took above came from answers to that question but my problem is specifically in getting the debugging output to iTerm.

1 Answers

Answers 1

There is a varible in the settings file named "terminal.external.osxExec". That was set to Terminal App in my settings. You can change that variable to iTerm.app.

Read More

Sunday, May 6, 2018

VS Code — commenting .jsx syntax

Leave a Comment

I checked previous questions on SO here and here and VS Code's issues here and here.

I still don't know how I can comment jsx syntax in VS Code by cmd + /. I tried syntax JavaScript React and JavaScript Babel and add:

"files.associations": {         "*.js": "javascriptreact"     },  

into user settings. Nothing helped. When I check Developer Tools, there are no error messages.

recording

2 Answers

Answers 1

Just change the language to JavaScript React (Babel) instead of JavaScript (Babel).

    "language": "javascript",     "scopeName": "source.js",     "path": "./syntaxes/JavaScript.tmLanguage.json",     "embeddedLanguages": {       "meta.tag.js": "jsx-tags",       "meta.tag.without-attributes.js": "jsx-tags",       "meta.tag.attributes.js": "javascript",       "meta.embedded.expression.js": "javascript"     }, 

Also if you use Sublime Babel first disable it and then switch to React. https://github.com/Microsoft/vscode/blame/master/extensions/javascript/package.json#L72

Answers 2

It works for me, Remember Atom has this behavior, but VSCode looks a bit intelligent around this area.

Working

I have no custom file associations defined. Also I am on the latest version of VsCode. Make sure you have no additional addins that takeover and change the behavior

Read More

Friday, April 6, 2018

Command not found in VSCode extension

Leave a Comment

I am trying to create a VSCode extension. This extension provides two commands, never mind their implementation:

export function activate(context: ExtensionContext) {      const provider = new ContentProvider();     const providerRegistrations = Disposable.from(         workspace.registerTextDocumentContentProvider(ContentProvider.scheme, provider)     );      // Open the dynamic document, and shows it in the next editor     const openMyExtensionCommandRegistration = commands.registerTextEditorCommand('extension.openMyExtension', editor => {         // Activate the extension and do something     });      const useMyExtensionCommandRegistration = commands.registerTextEditorCommand('extension.useMyExtension', editor => {         // Do something     });      context.subscriptions.push(         provider,         openMyExtensionCommandRegistration,         useMyExtensionCommandRegistration,         providerRegistrations     ); } 

And this is a part of my package.json file:

"activationEvents": [         "onCommand:extension.openMyExtension"     ],     "main": "./out/extension",     "contributes": {         "commands": [             {                 "command": "extension.openMyExtension",                 "title": "Open my extension",                 "category": "MyExtension"             },             {                 "command": "extension.useMyExtension",                 "title": "Do something with my extension",                 "category": "MyExtension"             }         ], 

The first command, which is supposed to activates my extension, works. It appears in the command palette, and actually does what it is supposed to do when invoked.

The second command however, despite appearing in the command palette, raise the following error message when called:

command 'extension.useMyExtension' not found

I find it weird that my first command works fine but not the second since the code is quite similar. Any ideas why?

Note that I obviously changed some variable names, I double checked for typos in the real code.

1 Answers

Answers 1

Your problem looks similar to this issue: https://github.com/Microsoft/vscode/issues/25026

Read More

Friday, March 23, 2018

Why does Visual Studio Code show User Settings instead of running a PHP file?

Leave a Comment

I noticed that in Visual Studio Code there is a menu item called "Start Without Debugging" under the "Debug" menu. When I have a PHP file open, I expected this to run the PHP file through the PHP executable and give me the output. Instead, when I click on "Start Without Debugging", the User Settings page shows up. Why does the User Settings page show up? It's not clear why this page is presented to me. Does it want me to configure something? How do I get it to just run the PHP file that I have open through the PHP executable. Is this even possible?

I noticed in the Default Settings there is a property called "php.validate.executablePath" that is set to null. I tried overriding this setting in my User Settings by pointing it to the path of my PHP executable like this:

{     "php.validate.executablePath": "/usr/bin/php" } 

But that didn't solve anything. The User Settings page still shows up when I click "Start Without Debugging".

1 Answers

Answers 1

After doing more research, I found the solution to my problem. Based on this section in the vscode docs and this comment that mentions creating a global launch configuration, all you have to do is add a launch object to your User Settings JSON.

In my case, I added this to my User Settings:

"launch": {     "version": "0.2.0",     "configurations": [         {         "type": "php",         "request": "launch",         "name": "Launch Program",         "program": "${file}",         "runtimeExecutable": "/usr/bin/php"         }     ] } 

Your value for runtimeExecutable may be different depending on the path to your PHP executable.

Read More

Thursday, March 15, 2018

Cannot get all shells configured in VSCode for Shell Launcher

Leave a Comment

I followed the instructions from How to add multiple terminal in VS Code?

When I type Ctrl+Alt+S (my custom shortcut) only Powershell and Git Bash are listed whereas cmd and wsl not there, why are they missing ?

enter image description here

1 Answers

Answers 1

You have incorrect paths in extension settings!

You can find necessary paths by running following commands in windows console (cmd):

where cmd (for cmd)

where powershell (for PowerShell)

where bash (for Git bash, WSL Bash)

Here is one of possible options for 64 bit windows:

"shellLauncher.shells.windows": [     {       "shell": "C:\\Windows\\SysWOW64\\cmd.exe",       "label": "cmd"     },     {       "shell": "C:\\Windows\\SysWOW64\\WindowsPowerShell\\v1.0\\powershell.exe",       "label": "PowerShell"     },     {       "shell": "C:\\Program Files\\Git\\bin\\bash.exe",       "label": "Git bash"     },     {       "shell": "C:\\Windows\\System32\\bash.exe",       "label": "WSL Bash"     } ] 

Then you can select one you need with shortcut:

{     "key": "ctrl+alt+s",     "command": "shellLauncher.launch" } 

After that you can select one in list in terminal panel.

Read More

Thursday, March 8, 2018

Jest + Babel in VS Code debugger causes breakpoints to move

Leave a Comment

I am trying to debug a simple project using babel, jest, and vs code. When I set a breakpoint and then start debugging, my breakpoints jump around and are no longer where they were when I started. A sample repo can be seen here - https://github.com/RyanHirsch/starter-node

I've updated my launch.json to contain

{   "name": "Jest",   "type": "node",   "request": "launch",   "program": "${workspaceRoot}/node_modules/jest/bin/jest.js",   "stopOnEntry": false,   "args": ["-i", "${file}"],   "cwd": "${workspaceRoot}",   "runtimeExecutable": null,   "sourceMaps": true,   "protocol": "inspector" } 

And my .babelrc looks like:

{   "plugins": ["@babel/plugin-proposal-object-rest-spread"],   "sourceMaps": "inline",   "presets": [     [       "@babel/preset-env",       {         "targets": {           "node": "6.10"         }       }     ]   ] } 

I thought that the source map options were enough to get this to work but I was wrong. What needs to change in order to keep my breakpoints in their original locations? Specifically when trying to debug my tests.

==== Edit ====

Before my breakpoints are on test line 10 and implementation line 4:

Before Debugging

When I start debugging by selection my test file and then run Jest in the VS Code debug pane, my breakpoints jump to test line 9 and implementation line 6: During Debugging

Running on Node 9.6.1 with the following extensions:

DavidAnson.vscode-markdownlint EditorConfig.EditorConfig Orta.vscode-jest PKief.material-icon-theme PeterJausovec.vscode-docker Shan.code-settings-sync bungcip.better-toml dbaeumer.vscode-eslint dracula-theme.theme-dracula dzannotti.vscode-babel-coloring eamodio.gitlens esbenp.prettier-vscode gerane.Theme-FlatlandMonokai humao.rest-client mauve.terraform mikestead.dotenv mjmcloug.vscode-elixir mohsen1.prettify-json ms-vscode.Theme-MaterialKit ms-vscode.azure-account ms-vscode.cpptools ritwickdey.LiveServer sbrink.elm shanoor.vscode-nginx vscodevim.vim 

0 Answers

Read More

Thursday, March 1, 2018

How to find and replace a particular character but only if it is in quotes?

Leave a Comment

Problem: I have thousands of documents which contains a specific character I don't want. E.g. the character a. These documents contain a variety of characters, but the a's I want to replace are inside double quotes or single quotes.

I would like to find and replace them, and I thought using Regex would be needed. I am using VSCode, but I'm open to any suggestions.

My attempt: I was able to find the following regex to match for a specific string containing the values inside the ().

".*?(r).*?" 

However, this only highlights the entire quote. I want to highlight the character only.

Any solution, perhaps outside of regex, is welcome.

Example outcomes: Given, the character is a, find replace to b

Somebody once told me "apples" are good for you => Somebody once told me "bpples" are good for you

"Aardvarks" make good kebabs => "Abrdvbrks" make good kebabs

The boy said "aaah!" when his mom told him he was eating aardvark => The boy said "bbbh!" when his mom told him he was eating aardvark

6 Answers

Answers 1

Visual Studio Code

VS Code uses JavaScript RegEx engine for its find / replace functionality. This means you are very limited in working with regex in comparison to other flavors like .NET or PCRE.

Lucky enough that this flavor supports lookaheads and with lookaheads you are able to look for but not consume character. So one way to ensure that we are within a quoted string is to look for number of quotes down to bottom of file / subject string to be odd after matching an a:

a(?=[^"]*"[^"]*(?:"[^"]*"[^"]*)*$) 

Live demo

This looks for as in a double quoted string, to have it for single quoted strings substitute all "s with '. You can't have both at a time.

There is a problem with regex above however, that it conflicts with escaped double quotes within double quoted strings. To match them too if it matters you have a long way to go:

a(?=[^"\\]*(?:\\.[^"\\]*)*"[^"\\]*(?:\\.[^"\\]*)*(?:"[^"\\]*(?:\\.[^"\\]*)*"[^"\\]*(?:\\.[^"\\]*)*)*$) 

Applying these approaches on large files probably will result in an stack overflow so let's see a better approach.

I am using VSCode, but I'm open to any suggestions.

That's great. Then I'd suggest to use awk or sed or something more programmatic in order to achieve what you are after or if you are able to use Sublime Text a chance exists to work around this problem in a more elegant way.

Sublime Text

This is supposed to work on large files with hundred of thousands of lines but care that it works for a single character (here a) that with some modifications may work for a word or substring too:

Search for:

(?:"|\G(?<!")(?!\A))(?<r>[^a"\\]*+(?>\\.[^a"\\]*)*+)\K(a|"(*SKIP)(*F))(?(?=((?&r)"))\3)                            ^              ^            ^ 

Replace it with: WHATEVER\3

Live demo

RegEx Breakdown:

(?: # Beginning of non-capturing group #1     "   # Match a `"`     |   # Or     \G(?<!")(?!\A)  # Continue matching from last successful match                     # It shouldn't start right after a `"` )   # End of NCG #1 (?<r>   # Start of capturing group `r`     [^a"\\]*+   # Match anything except `a`, `"` or a backslash (possessively)     (?>\\.[^a"\\]*)*+   # Match an escaped character or                          # repeat last pattern as much as possible )\K     # End of CG `r`, reset all consumed characters (   # Start of CG #2      a   # Match literal `a`     |   # Or     "(*SKIP)(*F)    # Match a `"` and skip over current match ) (?(?=   # Start a conditional cluster, assuming a positive lookahead     ((?&r)")    # Start of CG #3, recurs CG `r` and match `"`   )     # End of condition   \3    # If conditional passed match CG #3  )  # End of conditional 

enter image description here

Three-step approach

Last but not least...

Matching a character inside quotation marks is tricky since delimiters are exactly the same so opening and closing marks can not be distinguished from each other without taking a look at adjacent strings. What you can do is change a delimiter to something else so that you can look for it later.

Step 1:

Search for: "[^"\\]*(?:\\.[^"\\]*)*"

Replace with: $0Я

Step 2:

Search for: a(?=[^"\\]*(?:\\.[^"\\]*)*"Я)

Replace with whatever you expect.

Step 3:

Search for: "Я

Replace with nothing to revert every thing.


Answers 2

Firstly a few of considerations:

  1. There could be multiple a characters within a single quote.
  2. Each quote (using single or double quotation marks) consists of an opening quote character, some text and the same closing quote character. A simple approach is to assume that when the quote characters are counted sequentially, the odd ones are opening quotes and the even ones are closing quotes.
  3. Following point 2, it could be worth some further thought on whether single-quoted strings should be allowed. See the following example: It's a shame 'this quoted text' isn't quoted. Here, the simple approach would think there were two quoted strings: s a shame and isn. Another: This isn't a quote ...'this is' and 'it's unclear where this quote ends'. I've avoided attempting to tackle these complexities and gone with the simple approach below.

The bad news is that point 1 presents a bit of a problem, as a capturing group with a wildcard repeat character after it (e.g. (.*)*) will only capture the last captured "thing". But the good news is there's a way of getting around this within certain limits. Many regex engines will allow up to 99 capturing groups (*). So if we can make the assumption that there will be no more than 99 as in each quote (UPDATE ...or even if we can't - see step 3), we can do the following...

(*) Unfortunately my first port of call, Notepad++ doesn't - it only allows up to 9. Not sure about VS Code. But regex101 (used for the online demos below) does.

TL;DR - What to do?

  1. Search for: "([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*([^a"]*)a*"
  2. Replace with: "\1\2\3\4\5\6\7\8\9\10\11\12\13\14\15\16\17\18\19\20\21\22\23\24\25\26\27\28\29\30\31\32\33\34\35\36\37\38\39\40\41\42\43\44\45\46\47\48\49\50\51\52\53\54\55\56\57\58\59\60\61\62\63\64\65\66\67\68\69\70\71\72\73\74\75\76\77\78\79\80\81\82\83\84\85\86\87\88\89\90\91\92\93\94\95\96\97\98\99"
  3. (Optionally keep repeating steps the previous two steps if there's a possibility of > 99 such characters in a single quote until they've all been replaced).
  4. Repeat step 1 but replacing all " with ' in the regular expression, i.e: '([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*([^a']*)a*'
  5. Repeat steps 2-3.

Online demos

Please see the following regex101 demos, which could actually be used to perform the replacements if you're able to copy the whole text into the contents of "TEST STRING":

Answers 3

/(["'])(.*?)(a)(.*?\1)/g 

With the replace pattern:

$1$2$4 

As far as I'm aware, VS Code uses the same regex engine as JavaScript, which is why I've written my example in JS.

The problem with this is that if you have multiple a's in 1 set of quotes, then it will struggle to pull out the right values, so there needs to be some sort of code behind it, or you, hammering the replace button until no more matches are found, to recurse the pattern and get rid of all the a's in between quotes

let regex = /(["'])(.*?)(a)(.*?\1)/g,  subst = `$1$2$4`,  str = `"a"  "helapke"  Not matched - aaaaaaa  "This is the way the world ends"  "Not with fire"  "ABBA"  "abba",  'I can haz cheezburger'  "This is not a match'  `;      // Loop to get rid of multiple a's in quotes  while(str.match(regex)){      str = str.replace(regex, subst);  }    const result = str;  console.log(result);

Answers 4

If you can use Visual Studio (instead of Visual Studio Code), it is written in C++ and C# and uses the .NET Framework regular expressions, which means you can use variable length lookbehinds to accomplish this.

(?<="[^"\n]*)a(?=[^"\n]*") 

Adding some more logic to the above regular expression, we can tell it to ignore any locations where there are an even amount of " preceding it. This prevents matches for a outside of quotes. Take, for example, the string "a" a "a". Only the first and last a in this string will be matched, but the one in the middle will be ignored.

(?<!^[^"\n]*(?:(?:"[^"\n]*){2})+)(?<="[^"\n]*)a(?=[^"\n]*") 

Now the only problem is this will break if we have escaped " within two double quotes such as "a\"" a "a". We need to add more logic to prevent this behaviour. Luckily, this beautiful answer exists for properly matching escaped ". Adding this logic to the regex above, we get the following:

(?<!^[^"\n]*(?:(?:"(?:[^"\\\n]|\\.)*){2})+)(?<="[^"\n]*)a(?=[^"\n]*") 

I'm not sure which method works best with your strings, but I'll explain this last regex in detail as it also explains the two previous ones.

  • (?<!^[^"\n]*(?:(?:"(?:[^"\\\n]|\\.)*){2})+) Negative lookbehind ensuring what precedes doesn't match the following
    • ^ Assert position at the start of the line
    • [^"\n]* Match anything except " or \n any number of times
    • (?:(?:"(?:[^"\\\n]|\\.)*){2})+ Match the following one or more times. This ensures if there are any " preceding the match that they are balanced in the sense that there is an opening and closing double quote.
      • (?:"(?:[^"\\\n]|\\.)*){2} Match the following exactly twice
      • " Match this literally
      • (?:[^"\\\n]|\\.)* Match either of the following any number of times
        • [^"\\\n] Match anything except ", \ and \n
        • \\. Matches \ followed by any character
  • (?<="[^"\n]*) Positive lookbehind ensuring what precedes matches the following
    • " Match this literally
    • [^"\n]* Match anything except " or \n any number of times
  • a Match this literally
  • (?=[^"\n]*") Positive lookahead ensuring what follows matches the following
    • [^"\n]* Match anything except " or \n any number of times
    • " Match this literally

You can drop the \n from the above pattern as the following suggests. I added it just in case there's some sort of special cases I'm not considering (i.e. comments) that could break this regex within your text. The \A also forces the regex to match from the start of the string (or file) instead of the start of the line.

(?<!\A[^"]*(?:(?:"(?:[^"\\]|\\.)*){2})+)(?<="[^"]*)a(?=[^"]*") 

You can test this regex here

This is what it looks like in Visual Studio:

Visual Studio example

Answers 5

I am using VSCode, but I'm open to any suggestions.

If you want to stay in an Editor environment, you could use
Visual Studio (>= 2012) or even notepad++ for quick fixup.
This avoids having to use a spurious script environment.

Both of these engines (Dot-Net and boost, respectively) use the \G construct.
Which is start the next match at the position where the last one left off.

Again, this is just a suggestion.

This regex doesn't check the validity of balanced quotes within the entire
string ahead of time (but it could with the addition of a single line).

It is all about knowing where the inside and outside of quotes are.

I've commented the regex, but if you need more info let me know.
Again this is just a suggestion (I know your editor uses ECMAScript).

Find (?s)(?:^([^"]*(?:"[^"a]*(?=")"[^"]*(?="))*"[^"a]*)|(?!^)\G)a([^"a]*(?:(?=a.*?")|(?:"[^"]*$|"[^"]*(?=")(?:"[^"a]*(?=")"[^"]*(?="))*"[^"a]*)))
Replace $1b$2

That's all there is to it.

https://regex101.com/r/loLFYH/1

Comments

(?s)                          # Dot-all inine modifier  (?:       ^                             # BOS        (                             # (1 start), Find first quote from BOS (written back)            [^"]*             (?:                           # --- Cluster                 " [^"a]*                      # Inside quotes with no 'a'                 (?= " )                 " [^"]*                       # Between quotes, get up to next quote                 (?= " )            )*                            # --- End cluster, 0 to many times             " [^"a]*                      # Inside quotes, will be an 'a' ahead of here                                          # to be sucked up by this match                  )                             # (1 end)     |                              # OR,        (?! ^ )                       # Not-BOS        \G                            # Continue where left off from last match.                                     # Must be an 'a' at this point  )  a                             # The 'a' to be replaced   (                             # (2 start), Up to the next 'a' (to be written back)       [^"a]*        (?:                           # --------------------            (?= a .*? " )                 # If stopped before 'a', must be a quote ahead         |                              # or,            (?:                           # --------------------                 " [^"]* $                     # If stopped at a quote, check for EOS              |                              # or,                  " [^"]*                       # Between quotes, get up to next quote                 (?= " )                  (?:                           # --- Cluster                      " [^"a]*                      # Inside quotes with no 'a'                      (?= " )                      " [^"]*                       # Between quotes                       (?= " )                 )*                            # --- End cluster, 0 to many times                  " [^"a]*                      # Inside quotes, will be an 'a' ahead of here                                               # to be sucked up on the next match                                )                             # --------------------       )                             # --------------------  )                             # (2 end) 

Answers 6

"Inside double quotes" is rather tricky, because there are may complicating scenarios to consider to fully automate this.

What are your precise rules for "enclosed by quotes"? Do you need to consider multi-line quotes? Do you have quoted strings containing escaped quotes or quotes used other than starting/ending string quotation?

However there may be a fairly simple expression to do much of what you want.

Search expression: ("[^a"]*)a

Replacement expression: $1b

This doesn't consider inside or outside of quotes - you have do that visually. But it highlights text from the quote to the matching character, so you can quickly decide if this is inside or not.

If you can live with the visual inspection, then we can build up this pattern to include different quote types and upper and lower case.

Read More

Sunday, January 7, 2018

Where VS Code stores the list of open files?

Leave a Comment

I'm trying to have synced VS Code instances at work and at home, including the list of open files. I know there are extensions to sync settings, but they do not cover Open Files AFAIK. I do not expect live syncing, under running instance, but if I, say, reboot both machines and start Code on them, I want them identical.

Currently, I have a portable installation of Code on my OneDrive, and I've tried to move AppData\Roaming\Code to OneDrive as well, replacing the actual directories with the symbolic links to this copy.

But still, when I open editor at home it has its own set of Open Files.

I tried to use ProcMon to get an idea where it comes from, I tried to read sources a bit. It seems asking may be easier :-)

Btw, I'm opening in Code git folder of my project. And this folder is located at the same path on both PCs.

1 Answers

Answers 1

I'm pretty sure you're right with AppData\Roaming\Code being the location in question. Specifically:

  • AppData\Roaming\Code\storage.json and in that the windowsState section.
  • AppData\Roaming\Code\Backups\workspaces.json

These files (or at least storage.json) do not get updated until you exit Code (File > Exit). If you are leaving Code open on your work machine and not seeing the changes when you get to your home machine, that might be why you're not seeing the expected.

Code / Atom also stores state information in sqlite3 databases and lots of state information is stored in there:

  • AppData\Roaming\Code\Local Storage\file__0.localstorage

Use an SQLite browser tool such as http://sqlitebrowser.org/ to open it up. You'll see lots of familiar path references in the table ItemTable. The column value shows as "BLOB" (binary) but you can click on any row and export the data to a file. Do this and open up it up in a text editor (e.g. Code! :)) and you'll see it's just a JSON string.

(As VS Code is based on GitHub's Atom editor, searching for issues using "Atom" rather than "Code" often digs up information you might not otherwise find.)

Read More

Tuesday, January 2, 2018

Breakpoints broken when placed in VSCode/Javascript on Chrome

Leave a Comment

I'm running a node.js webapp using javascript and webpack which I built following this guide. I've installed the chrome debugger extension.

I run the node server using the command:

webpack-dev-server --progress --colors 

I've also run webpack --devtool source-map

My launch config looks like this:

{     // Use IntelliSense to learn about possible attributes.     // Hover to view descriptions of existing attributes.     // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387     "version": "0.2.0",     "configurations": [         {             "type": "chrome",             "request": "launch",             "name": "Launch Chrome against localhost",             "url": "http://localhost:8080",             "webRoot": "${workspaceFolder}"         }     ] } 

After running webpack-dev-server --progress --colors and hitting F5 in VSCode Chrome loads up with the webpage, all my breakpoints appear solid red but when placed they jump a bit lower from where I placed them (including on lines which are executing code). The breakpoints also don't hit which makes me believe there's something wrong with the debug mapping. When I have breakpoints placed on occasion random files get loaded and invisible breakpoints in them are hit, like in node_modules/firebase/index.js an invisible breakpoint over a commented out line is hit.

I should also note running .scripts in vscode does yield (amongst all the modules) my entry.js file which I'm trying to hit breakpoints in, namely: -webpack:///./entry.js (d:\myproject\entry.js)

Everything is placed in the root of my directories (screenshot in case I make a mistake transposing the directories);

enter image description here

Also my webpack.config.js file:

module.exports = {     entry: "./entry.js",     output: {         path: __dirname,         filename: "bundle.js"     },     module: {         loaders: [             { test: /\.css$/, loader: "style-loader!css-loader" }         ]     } }; 

1 Answers

Answers 1

Problem solved!

Needed to add:

 devtool: 'inline-source-map' 

To my webpack.config.js module.exports. Now breakpoints hit inline on functions everywhere.

Read More

Monday, December 4, 2017

Is there any way for VS Code to indent to an open bracket?

Leave a Comment

I'm looking to modify VS Code's indentation behavior so that if I press enter after typing a line like this:

variable = function(param1, 

It'll indent to the level of the open parenthesis so that I can easily format code like this:

variable = function(param1,                     param2) 

I'd like it to work for open square brackets and curly brackets as well:

variable = function([1, 2, 3, 4                      5, 6, 7, 8],                     param2,                     {'a': 1, 'b': 2,                      'c': 3, 'd': 4},                     param4) 

I'd prefer it to have this behavior for pretty much every language I work with, though the curly braces behavior isn't necessary (and may even be undesirable) when working in C++ or C#.

This is very similar to Sublime Text's indent_to_bracket setting.

Is there any way to accomplish this? If there's no setting, I'm willing to tinker with whatever is necessary. I'm also open to an extension that can do this, or even writing an extension if it's necessary and makes sense to do so.

3 Answers

Answers 1

It looks like ESLint will do this for you.

Examples of correct code for this rule with the 2, { "FunctionExpression": {"parameters": "first"} } option:

/*eslint indent: ["error", 2, {"FunctionExpression": {"parameters": "first"}}]*/  var foo = function(bar, baz,                    qux, boop) {   qux(); } 

From indent rule : Function Expressions.

Install the extension vscode-eslint integration and then

If you haven't installed ESLint either locally or globally do so by running npm install eslint in the workspace folder for a local install or npm install -g eslint for a global install.

Then a rule like

"indent": ["error", 2, { "FunctionExpression": {"body": 1, "parameters": "first"} }], 

in your .eslintrc.json file will do what you want - at least on save if you have

"eslint.autoFixOnSave": true 

in your settings. false is the default. I don't believe you can make it "fix" the problem as you type - but only on save. You can also modify this setting

// An array of language ids which should be validated by ESLint

"eslint.validate": [ "javascript", "javascriptreact" ],

Answers 2

There is a closed issue on GitHub for this very feature. A recent comment from the development team reads as follows:

This feature request will not be considered in the next 6-12 months roadmap and as such will be closed to keep the number of issues we have to maintain actionable. Thanks for understanding and happy coding!

Therefore, it will not be included in the foreseeable future.

The only option right now would be to attempt to create an extension that does exactly this or even hack on the main editor source code. I suggest you start here: https://code.visualstudio.com/docs/extensions/overview

Answers 3

Have a look at then viusal studio extension "AStyle". I used AStyle often, when I have to work on bad formatted code files.

AStyle is also available as a stand alone program. Maybe it fits your needs

Read More

Tuesday, November 21, 2017

Disable peek in Visual Studio Code

Leave a Comment

Is there a way to disable the ctrl-click 'peek' feature in Visual Studio Code? Ideally I'd like ctrl-click to just open the file containing the definition in a new tab.

Edit: I submitted an issue to at least make it less confusing. Apparently my terminology is slightly wrong.

To clarify, there are two actions:

  1. Right-click -> Peek Definition
  2. Right-click -> Go to Definition (bound to ctrl-click)

Their behaviour is as follows:

  1. PD, Single Definition
    • Opens inline interface showing definition.
  2. PD, Multiple Definitions

    • Opens inline interface showing definitions.
  3. GtD, Single Definition

    • Open the file containing the definition.
  4. GtD, Multiple Definitions
    • Pick one of the definitions at random, open that file, and an inline interface showing all the definitions.

All of those are fine except the last. Doing both things results in a really redundant and confusing UI like this:

Confusing!

There should be a way to have one of these behaviours:

  • Pick one of the definitions at random, open that file.

Or:

  • Open inline interface showing all the definitions (in the current file)

0 Answers

Read More

Tuesday, October 17, 2017

`cannot find package “appengine” error` when using VS code

Leave a Comment

By following this tutorial I created a go lang project and opened it by Visual Studio Code.

The code itself works fine I can run the server, but somehow VS Code shows

cannot find package "appengine" in any of:     /usr/local/Cellar/go/1.8.3/libexec/src/appengine (from $GOROOT)     /Users/ironsand/go/src/appengine (from $GOPATH) 

I thought I must set GOROOT for the Google App Engine, but according to this stackoverflow question I shouldn't.

How to make VS Code recognize google app engine library properly?

More info

The appengine package exists in ~/dev/google-cloud-sdk/platform/google_appengine/goroot-1.8/‌​src/appengine

I'm using macOS Sierra 10.12.6.

1 Answers

Answers 1

I did use that tutorial and it's working on my Mac via terminal and via VS Code.

You may follow this tutorial to be able use VS code to deploy GAE app with python: Deploy GAE app with VS code

• Dont forget to update path of dev_appserver.py in tasks.json.

If that didn't work out, you would need to re-install/init google-cloud-sdk.

Note that it's necessary to provide root privileges during installing/initializing in order to allow installer script to add paths properly.

Last thing: avoid tilde expansion ~ in path. Use absolute path in config.( in general absolute path must be used always unless there is a reason to use relative address with tilde )

Good luck,'.

Read More

Monday, October 16, 2017

Unable to trigger web request implemented in Giraffe

Leave a Comment

I'm struggling to trigger a web service that's written in Giraffe.

Here's the code:

let webApp : HttpContext -> HttpHandlerResult =       choose [         GET >=>             choose [ routef "/platforms/" fetchPlatforms ] 

fetchPlatforms is implemented as follows:

let private fetchPlatforms () (context : HttpContext) =     async { let response = getPlatforms()             return! json response context     } 

The issue that I'm running into is that when I run the server code and then attempt to test the web service, I get the following message:

enter image description here

Here's the entire solution.

Update:

I am only observing this issue in VS Code.

Hence, I can observe a successful web request and response using Visual Studio 2017 (3) version 15.4

Here's the video that demonstrates the difference between VS2017 and VS Code

2 Answers

Answers 1

I downloaded your source code and tried to reproduce the issue, but first I was getting an error during startup because I don't have your db configured locally, therefore I made the following change:

type TestObj =     {         Prop1 : string         Prop2 : int     }  let private fetchPlatforms  =     let obj1 = { Prop1 = "test"; Prop2 = 100 }     json obj1     //  let response = getPlatforms()     //  json response 

... and when I start the app now and make a Postman call to the /platforms endpoint then it seems to work fine for me...

postman

Have you resolved your issue perhaps?

Answers 2

routef should match pattern: https://github.com/dustinmoris/Giraffe#routef

otherwise try route:

let webApp : HttpContext -> HttpHandlerResult =   choose [     GET >=>         choose [ route "/platforms" >=> fetchPlatforms ] 

EDIT:

And looking at your code, the fetchPlatforms function is not a proper handler. HttpHandler :

A HttpHandler is a simple function which takes two curried arguments, a HttpFunc and a HttpContext, and returns a HttpContext (wrapped in an option and Task workflow) when finished.

Instead of:

let private fetchPlatforms  =      let response = getPlatforms()      json response 

Try something like that:

let fetchPlatforms   =     fun (next : HttpFunc) (ctx : HttpContext) ->         let response = getPlatforms()         json response next ctx 

You can do that async as well (it depends on getPlatforms):

let fetchPlatforms   =     fun (next : HttpFunc) (ctx : HttpContext) ->         task {             let! response = getPlatforms()             return! json response next ctx         } 
Read More

Monday, October 2, 2017

Debugging CoffeeScript in VSCode goes to .js files

Leave a Comment

I am trying to debug a CoffeeScript file in vs code. It works and I can step through the compiled.js files. However, I can't step through the actual CoffeeScript files.

Here is my launch.json file:

{     "type": "node",     "request": "launch",     "name": "Launch Meeting",     "program": "${workspaceRoot}/lib/meeting/meeting-service.coffee",     "cwd": "${workspaceRoot}",     "env": {         "NODE_ENV": "local"     },     "sourceMaps": true } 

And in another window, I am running:

./node_modules/.bin/coffee -mc --watch lib/activity/note-activity-model.coffee \                                        lib/activity/note-activity-publisher.coffee \                                        lib/app-event-queue.coffee \                                        lib/meeting/meeting-api.coffee \                                        lib/meeting/meeting-service.coffee \                                        lib/meeting/meeting-socket-service.coffee \                                        lib/meeting/meeting-util.coffee 

When I set a breakpoint in the coffee file, the debugger halts on the compiled js file. I need it on the coffee file.

1 Answers

Answers 1

Did you try to use

"stopOnEntry": true, "smartStep": false 

as described in https://github.com/Microsoft/vscode/issues/5963 ?

Read More

Friday, September 22, 2017

`cannot find package “appengine” error` when using VS code

Leave a Comment

By following this tutorial I created a go lang project and opened it by Visual Studio Code.

The code itself works fine I can run the server, but somehow VS Code shows

cannot find package "appengine" in any of:     /usr/local/Cellar/go/1.8.3/libexec/src/appengine (from $GOROOT)     /Users/ironsand/go/src/appengine (from $GOPATH) 

I thought I must set GOROOT for the Google App Engine, but according to this stackoverflow question I shouldn't.

How to make VS Code recognize google app engine library properly?

0 Answers

Read More