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

Flutter SIGINT error on run all tests on visconde

$
0
0

When trying to "Run All Tests" from flutter/dart on VSCODE, I'm getting a SIGINT error and the test finish with "loading"on file, only the first one goes ok. The problem is that the same thing does not happen if I run the tests one by one.

loading /Users/marciomontenegro/Documents/Projects/mel/test/domain/usecases/sign_in_test.dart:

ERROR: Failed to load "/Users/marciomontenegro/Documents/Projects/mel/test/domain/usecases/sign_in_test.dart":
Shell subprocess terminated by ^C (SIGINT, -2) before connecting to test harness.
Test: /Users/marciomontenegro/Documents/Projects/mel/test/domain/usecases/sign_in_test.dart
Shell: /Users/marciomontenegro/flutter/bin/cache/artifacts/engine/darwin-x64/flutter_tester


dart:async/stream_controller.dart 595:43                     _StreamController.addError
dart:async/stream_controller.dart 862:13                     _StreamSinkWrapper.addError
package:stream_channel/src/guarantee_channel.dart 144:14     _GuaranteeSink._addError
package:stream_channel/src/guarantee_channel.dart 135:5      _GuaranteeSink.addError
package:flutter_tools/src/test/flutter_platform.dart 566:27  FlutterPlatform._startTest
===== asynchronous gap ===========================
dart:async/zone.dart 1053:19                                 _CustomZone.registerUnaryCallback
dart:async-patch/async_patch.dart 71:23                      _asyncThenWrapperHelper
package:flutter_tools/src/test/flutter_platform.dart         FlutterPlatform._startTest
package:flutter_tools/src/test/flutter_platform.dart 368:36  FlutterPlatform.loadChannel
package:flutter_tools/src/test/flutter_platform.dart 321:46  FlutterPlatform.load
===== asynchronous gap ===========================
dart:async/zone.dart 1053:19                                 _CustomZone.registerUnaryCallback
dart:async-patch/async_patch.dart 71:23                      _asyncThenWrapperHelper
package:test_core/src/runner/loader.dart                     Loader.loadFile.<fn>
package:test_core/src/runner/load_suite.dart 98:31           new LoadSuite.<fn>.<fn>
===== asynchronous gap ===========================
dart:async/zone.dart 1045:19                                 _CustomZone.registerCallback
dart:async/zone.dart 962:22                                  _CustomZone.bindCallbackGuarded
dart:async/timer.dart 52:45                                  new Timer
dart:async/timer.dart 89:9                                   Timer.run
dart:async/future.dart 172:11                                new Future
package:test_api/src/backend/invoker.dart 399:21             Invoker._onRun.<fn>.<fn>.<fn>

Unable to set tab width to 4 in prettier

$
0
0

I installed prettier extension for vscode and configured tab width as 4 spaces but it still indents new lines with 2 spaces. Anything I am doing wrong?

enter image description here

Here is the gif showing when I format the file:

enter image description here

Flutter failing to open in vs code

$
0
0

I have recently started watching a tutorial on creating flutter apps. I have carried out the necessary steps during download. I cannot create a new flutter project(test project). the progress bar keeps moving at the bottom right corner but is never able to accomplish the task of creating the test project. I am not sure what I am doing wrong here. here's the link to the tutorial: https://www.youtube.com/watch?v=K_kBzJN8pAY I have also attached a screenshot of the issue.

https://i.stack.imgur.com/fDqxm.png

How to print a file from VsCode?

$
0
0

I want to send the file I'm currently editing to a printer, like I did in Notepad++ for example. I havn't found any hint on a print command. Is it not possible ?

Occupy two different softwares for the same project (VS 2019 and VS Code) [on hold]

$
0
0

Regards,

Recently my work team started the development of a new project, and some team members recommended occupying the Visual Studio Code editor, while other more traditional ones want to continue occupying the Visual Studio 2019 IDE, I would like to know if an environment can be established in that the project can be carried out occupying these different softwares, what problems could bring or recommendations to establish.

Thank you in advance for your answers and sorry if you do not explain me well.

Visual Studio Code can't be opened because "Apple cannot check it for malicious software"

$
0
0

I have downloaded Visual Studio Code for the first time but I keep getting message below:

apple error message when clicking on VSC app

"Visual Studio Code" can't be opened because Apple cannot check it for malicious software.

This software needs to be updated. Contact the developer for more information.

My MacBook is up to date, and I even updated the latest version of VSC on their website (September 2019 (version 1.39); there is none for October) but it still gave me the same message.

Looking into their FAQ, I read about reinstalling VS Code. I did that but it still doesn't work.

firebase commands not working after I've downloaded firebase?

$
0
0

I've downloaded firebase's global tools in vscode's terminal by entering

npm install -g firebase-tools

After it downloaded I then got

  • firebase-tools@7.6.1 updated 4 packages in 53.024s

and according to firebase's website I should be able to enter

firebase login or firebase init as commands but I get

'firebase' is not recognized as an internal or external command, operable program or batch file.

How to add custom indentation rules to align multiple lines of code when creating a language extension?

$
0
0

I'm authoring an extension for Racket (lisp dialect) and I'd like to customize the indentation rules further than just "when line ends with X, indentation +1, else indentation -1". However, as far as I understand it, that exactly is the point of increaseIndentPattern and decreaseIndentPattern in language-configuration.json.

In particular, I'd like to specify some rule that goes like this:

(call-foo first-arg
......... second-arg
......... (third-arg-function foo
..............................bar))

Where the dots denote the auto-indentation (spaces) automatically inserted by VS Code upon pressing return on the preceeding lines. Is it possible to do something like this?


How to use PYTHONPATH with VSCode Python Extension for Debugging?

$
0
0

I'm working on a project which is structured like

Parent Directory
----+ MyPackage
     ----__init__.py
     ----file1.py
----+ Tests
     ----test.py

When I run the tests from terminal, I use

PYTHONATH=./ python ./Tests/test.py

Now, when I try the debug option after installing 'Python Extension', error is raised

Exception has occurred: ModuleNotFoundError
No module names 'MyPackage'

How can I put PYTHONPATH to the debug configuration such that it will taken care?

Application keeps on crashing. It says, Could not create Dart Instance

$
0
0

I am making a new web based ML application using flutter. Whenever i try to run my app, i keep getting an error Could not create Dart VM instance. Must be able to initialize the VM.

I have tried removing some Google-related services from the app that I used before so that it would reflect some change. Here is the code:

import 'package:flutter/material.dart';
class LoaderPage extends StatefulWidget {
  @override
  _LoaderPageState createState() => _LoaderPageState();
}

class _LoaderPageState extends State<LoaderPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(),
      backgroundColor: Colors.white,
      body: Column(
        children: <Widget>[
          _loadImage(),
        ],
      ),
    );
  }
Widget _loadImage(){
  AssetImage assetimage = AssetImage('images/webdoctor.png');
  Image image =  Image(image: assetimage,);
  return Container(child: image);
  }
}
Using hardware rendering with device Android SDK built for x86. If you get graphics artifacts, consider enabling
software rendering with "--enable-software-rendering".
Launching lib/main.dart on Android SDK built for x86 in debug mode...
Initializing gradle...                                              1.3s
Resolving dependencies...                                           6.0s
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done                        24.1s
Built build\app\outputs\apk\debug\app-debug.apk.
Installing build\app\outputs\apk\app.apk...                         4.2s
E/flutter ( 5695): [ERROR:flutter/runtime/dart_vm_data.cc(19)] VM snapshot invalid and could not be inferred from settings.
E/flutter ( 5695): [ERROR:flutter/runtime/dart_vm.cc(238)] Could not setup VM data to bootstrap the VM from.
E/flutter ( 5695): [ERROR:flutter/runtime/dart_vm_lifecycle.cc(89)] Could not create Dart VM instance.
F/flutter ( 5695): [FATAL:flutter/shell/common/shell.cc(218)] Check failed: vm. Must be able to initialize the VM.

Node Debug serverless offline using vscode

$
0
0

I am using VS Code for development of AWS Lambda functions, I started using the serverless framework and the serverless offline library but, I am unable to use VS Code's debug mode to locally debug the code.

I am referring many sites, Following is one of them: https://medium.com/@OneMuppet_/debugging-lambada-functions-locally-in-vscode-with-actual-break-points-deee6235f590

My project structure is as follows:

enter image description here

Package.json:

enter image description here

launch.json:

enter image description here

I get the following error when I start debug:

enter image description here

Can someone please guide, with the correct configuration?

VScode live-server absolute file path from the root of drive C: won't work

$
0
0
<img src="img/op_01.jpg" alt="">
<img src="../HTML5_Form/form.png" alt="">
<img src="C:\\cat.png" alt="">
<img src="/img/op_02.jpg" alt="">

under VScode

when I open this html by live-server on chrome,

line 3 won't work,

press F12 on that page it shows

"Not allowed to load local resource: file:///C://cat.png"

other than that, it works fine, please help

TypeScript jsdoc for interface properties

$
0
0

I have a TypeScript interface with a single-character property name (a design constraint). I would like to use JSDoc to document this interface to help with auto-complete in vscode.

Here's the current interface:

export interface ISource {
    b: string
    d: string
    f: string
    h: string
    M: number
    L: number
    P: number
    n: string
    r: string
    u: string
    p: string
}

Non-working attempts are:

/**
* @typedef {object} ISource
* @property {string} ISource.b - Bias: bias_text[rating.bias[0]],
* @property {string} ISource.d - Domain: rating.domain.replace(/^www\./, ""),
* @property {string} ISource.f - FacebookUrl: _.lowerCase(rating.facebook_url),
* @property {string} ISource.h - Host: `https://${rating.domain}`,
* @property {number} ISource.M - MozRankUrl: rating.moz_rank_url,
* @property {number} ISource.L - MozLinks: rating.moz_links,
* @property {number} ISource.P - MozPopularity: rating.moz_popularity,
* @property {string} ISource.n - Source: rating.source,
* @property {string} ISource.r - Reporting: _.upperCase(_.kebabCase(_.first(rating.factual_reporting))),
* @property {string} ISource.u - Url: url,
* @property {string} ISource.p - Path: path,
*/

export interface ISource {
    b: string
    d: string
    f: string
    h: string
    M: number
    L: number
    P: number
    n: string
    r: string
    u: string
    p: string
}

and

export interface ISource {
    b: string /** @property {string} b - Bias: bias_text[rating.bias[0]], */;
    d: string /** @property {string} d - Domain: rating.domain.replace(/^www\./, ""), */;
    f: string /** @property {string} f - FacebookUrl: _.lowerCase(rating.facebook_url), */;
    h: string /** @property {string} h - Host: `https://${rating.domain}`, */;
    M: number /** @property {string} M - MozRankUrl: rating.moz_rank_url, */;
    L: number /** @property {string} L - MozLinks: rating.moz_links, */;
    P: number /** @property {string} P - MozPopularity: rating.moz_popularity, */;
    n: string /** @property {string} n - Source: rating.source, */;
    r: string /** @property {string} r - Reporting: _.upperCase(_.kebabCase(_.first(rating.factual_reporting))), */;
    u: string /** @property {string} u - Url: url, */;
    p: string /** @property {string} p - Path: path, */;
}

Flutter New web project not showing in visual studio command palette

$
0
0

I have installed Visual studio Code, Dart and Flutter correctly according to the tutorial step shown in docs. I have checked it 100 times but nothing is wrong, unable to find issue. Please help.

Expected Result: Flutter: New Web project must be visible in in visual studio code

ModuleNotFoundError: No module named 'tensorflow'

$
0
0

I am trying to install tensorflow in vscode(Windows 10) but am getting this error ModuleNotFoundError: No module named 'tensorflow'. I have tried setting up a new conda environment, used python 3.5 and have also configured the 'Path' setting but to no avail. Even though TensorFlow has succesfully installed in my system, whenever I try to import, it doesn't work... Previously I had been using Ubuntu smoothly but getting it on win10 is being very frustrating. BTW when I install TensorFlow directly from the Anaconda-navigator, it tells me the error message "Too many errors".

Any help is appreciated...

THIS IS MY TEST CODE:-

import tensorflow as tf
print (tf.__version__)
print ('Hello world')

The VSCode problemMatcher $gcc seems to be gone

$
0
0

My tasks are configured to use the $gcc problemMatcher. This used to work fine, but now vscode complains:

{
    "resource": "/home/src/example/.vscode/tasks.json",
    "owner": "_generated_diagnostic_collection_name_#0",
    "code": "1",
    "severity": 4,
    "message": "Value is not accepted. Valid values: \"$msCompile\", \"$lessCompile\", \"$gulp-tsc\", \"$jshint\", \"$jshint-stylish\", \"$eslint-compact\", \"$eslint-stylish\", \"$go\", \"$lessc\", \"$node-sass\", \"$tsc\", \"$tsc-watch\".",
    "startLineNumber": 11,
    "startColumn": 31,
    "endLineNumber": 11,
    "endColumn": 37
} 

As you can see $gcc is not in the list of valid values. How come ?

This is my VSCode version:

Version: 1.38.1
Commit: b37e54c98e1a74ba89e03073e5a3761284e3ffb0
Date: 2019-09-11T13:30:08.229Z
Electron: 4.2.10
Chrome: 69.0.3497.128
Node.js: 10.11.0
V8: 6.9.427.31-electron.0
OS: Linux x64 5.0.0-29-generic

xlwings: How to see warnings that the console displays when using Excel as interface?

$
0
0

Normally when executing a script on Jupyter Notebook or other editors, the console displays both warnings and errors.

Now I use Visual Studio Code + xlwings, click "Run" button to call my Python code from Excel, it only pops up a windows showing errors if there are any. It doesn't show any warnings during the execution of my code. While there were warnings when I used Jupyter Notebook.

I just copied the code from Jupyter Notebook to Visual Studio Code. So when using Visual Studio Code + xlwings, how could I see those warnings that could have been showed in a console?

There is a similar question: Can I Have xlwings Display Console Output? But I don't use UDFs. I only use Excel as an interface that allows a user to enter some values, click Run button and see results returned from my python code. No VBA involved.

Retrieve sapui5 BSP from NW ABAP system

$
0
0

I know the grunt plugin 'grunt-nwabap-ui5uploader', to deploy an UI5 webapp to the netweaver ABAP system. Therefor I can use any IDE to develop and push my apps to the system. In my case I would love to use Visual Studio Code.

Is there any plugin to do the similar but retrieve the existing bsp application, similar as ithe eclipse plugin for UI5 development.

Or is it even possible to develop?

error: unresolved reference: in VScode with Kotlin while intelliJ seems to be working fine

$
0
0

Been working with Kotlin in Visual Studio and coming across error: unresolved reference: while making an object of SortingCode class. Code seems to be working fine in IntelliJ. any pointer in right direction would be appreciated.

below are the two kotlin classes which has been used in kotlin project

github link


class SearchingAlgorithm {
    private var sortingCode = sorting.kotlinCode.SortingCode() // TODO this line causing some issues for it to run in VScode
    fun run() {
        var numToSearch: Int = Random().nextInt(7)  //2
        var arrayToSearchIn = sortingCode.getSortedArray().clone()

        var result = binarySearch(arrayToSearchIn, 0, arrayToSearchIn.size - 1, numToSearch)
        if (!result.hasFoundNum) {
            println("could not find $numToSearch in ${arrayToSearchIn.contentToString()}")
        } else {
            println("found $numToSearch at ${result.numberFoundAt} in ${arrayToSearchIn.contentToString()}")
        }
    }

    private fun binarySearch(array: IntArray, low: Int, high: Int, target: Int): ResultAndIndex {
        if (low > high) {
            return ResultAndIndex(false, -1)
        } else {
            var midpoint = low + (high - low) / 2
            if (target == array[midpoint]) {
                return ResultAndIndex(true, midpoint)
            } else if (target > array[midpoint]) {
                return binarySearch(array, low, midpoint - 1, target)
            } else {
                return binarySearch(array, midpoint + 1, high, target)
            }
        }
    }

    /*  Supporting classes  */
    class ResultAndIndex {
        var hasFoundNum: Boolean = false
        var numberFoundAt: Int = -1

        constructor(hasFound: Boolean, atIndex: Int) {
            hasFoundNum = hasFound
            numberFoundAt = atIndex
        }
    }
}

fun main() {
    var searchingAlgorithm = SearchingAlgorithm()
    searchingAlgorithm.run()
}
import java.util.*

public class SortingCode {

    private val arrays: Array<IntArray> = arrayOf(
            intArrayOf(1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6),
            intArrayOf(7, 6, 5, 9, 8, 2, 4, 1),
            intArrayOf(9, 4, 2, 4, 5, 6, 9, 4, 2, 4, 5, 6, 9, 4, 2, 4, 5, 6, 9, 4, 2, 4, 5, 6, 9, 4, 2, 4, 5, 6, 9, 4, 2, 4, 5, 6, 9, 4, 2, 4, 5, 6, 9, 4, 2, 4, 5, 6, 9, 4, 2, 4, 5, 6, 9, 4, 2, 4, 5, 6),
            intArrayOf(11, 12, 63, 74, 51, 62, 11, 12, 63, 74, 51, 62, 11, 12, 63, 74, 51, 62, 11, 12, 63, 74, 51, 62, 11, 12, 63, 74, 51, 62, 11, 12, 63, 74, 51, 62, 11, 12, 63, 74, 51, 62, 11, 12, 63, 74, 51, 62, 11, 12, 63, 74, 51, 62, 11, 12, 63, 74, 51, 62),
            intArrayOf(3, 2, 1, 4, 5, 6, 3, 2, 1, 4, 5, 6, 3, 2, 1, 4, 5, 6, 3, 2, 1, 4, 5, 6, 3, 2, 1, 4, 5, 6, 3, 2, 1, 4, 5, 6, 3, 2, 1, 4, 5, 6, 3, 2, 1, 4, 5, 6, 3, 2, 1, 4, 5, 6, 3, 2, 1, 4, 5, 6),
            intArrayOf(7, 2, 8, 10, 5, 6, 7, 2, 8, 10, 5, 6, 7, 2, 8, 10, 5, 6, 7, 2, 8, 10, 5, 6, 7, 2, 8, 10, 5, 7, 2, 8, 10, 5, 6, 7, 2, 8, 10, 5, 6, 7, 2, 8, 10, 5, 6, 7, 2, 8, 10, 5, 6, 7, 2, 8, 10, 5, 6)
    )
    var selectionLimit = 5

    public fun run() {
        var selection = -1
        println("""
Enter 1 for Insertion Sort
Enter 2 for Selection Sort
Enter 3 for Merge Sort
Enter 4 for Progressive insertion sort
Enter 5 for Recursive insertion sort
Enter 9 to Exit
Please enter your choice ->
    """)

        while (selection != 9) {
            val inputArray = arrays[Random().nextInt(arrays.size)].clone()
            var sortedArray = inputArray
            val (input) = readLine().toString().split('')
            selection = input.toInt()
            println("Input array to Sort-> " + inputArray.contentToString())
            var currentTime = System.nanoTime()
            when (selection) { 
                5 -> {
                    sortedArray = (insertionRecursiveSort(LinkedList<Int>(inputArray.toList()))).toIntArray()
                }
                9 -> {
                    println("Entered 9 to Exit")
                    return
                }
                else -> println("Please enter number from 1 to $selectionLimit to  perform sorting")
            }
            println("Time took -> " + (System.nanoTime() - currentTime))
            println("Sorted input array -> " + sortedArray.contentToString())
        }
    }

    fun insertionRecursiveSort(array: LinkedList<Int>): LinkedList<Int> {
        if (array.size == 2) {
            val valueToInsert = array.removeFirst()
            if (array[0] > valueToInsert) {
                array.addLast(valueToInsert)
            } else {
                array.addFirst(valueToInsert)
            }
            return array
        } else {
            val valueToInsert: Int = array.removeFirst()
            insertionRecursiveSort(array)
            var hasValueAdded = false
            for ((index, value) in array.withIndex()) {
                if (value < valueToInsert) {
                    array.add(index, valueToInsert)
                    hasValueAdded = true;
                    break
                }
            }
            if (!hasValueAdded) {
                array.addLast(valueToInsert)
            }
            return array
        }
    }

    fun getSortedArray(): IntArray {
        var unsortedArray = arrays[Random().nextInt(arrays.size)].clone()
        return (insertionRecursiveSort(LinkedList(unsortedArray.toList()))).toIntArray()
    }
}

fun main() {
    var sortingCode = SortingCode()
    sortingCode.run()
}

the use of Developer Tools in VS Code?

$
0
0

when you click on help I see item toggle Developer Tools. just want to ask what is the use of developer tool inside VSCode. I don't see any infomation in Docs

Viewing all 98248 articles
Browse latest View live


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