Coder Social home page Coder Social logo

microsoft / vscode-extension-vscode Goto Github PK

View Code? Open in Web Editor NEW
126.0 39.0 56.0 449 KB

The vscode NPM module. Deprecated in favor of @types/vscode and vscode-test.

Home Page: https://www.npmjs.com/package/vscode

License: Other

JavaScript 75.21% TypeScript 24.79%

vscode-extension-vscode's Introduction

vscode-extension-vscode

⚠️ Deprecated, use @types/vscode and vscode-test instead ⚠️

This is the source code for the NPM vscode module.

The funcionality of vscode module has been splitted into @types/vscode and vscode-test. They have fewer dependencies, allow greater flexibility in writing tests and will continue to receive updates. Although vscode will continue to work, we suggest that you migrate to @types/vscode and vscode-test. This package will only receive security updates.

Release Notes | Migration Guide

Summary

The vscode NPM module provides VS Code extension authors tools to write extensions. It provides the vscode.d.ts node module (all accessible API for extensions) as well as commands for compiling and testing extensions.

For more information around extension authoring for VS Code, please see http://code.visualstudio.com/docs/extensions/overview

Changes

1.1.37 | 2020-04-22

  • Remove request and url-parse dependencies. #154.

License

MIT

vscode-extension-vscode's People

Contributors

aliariff avatar atticoos avatar bpasero avatar bvandre avatar camwar11 avatar chrisdias avatar dantup avatar dbaeumer avatar dependabot[bot] avatar dmage avatar donaldpipowitch avatar gkalpak avatar guw avatar jimic avatar joaomoreno avatar jrieken avatar kimushu avatar msftgits avatar octref avatar raymondd avatar roblourens avatar samverschueren avatar smashwilson avatar sound120 avatar tomashubelbauer avatar tyriar avatar vazexqi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vscode-extension-vscode's Issues

Can't test linux (latest) on CI

bin/test:98
get https://vscode-update.azurewebsites.net/1.2.1/linux-x64/stable is a .tar.xz file and the test command is trying to unzip it as .zip.

Relevant travis log part:

$ npm test --silent
### VS Code Extension Test Run ###
Current working directory: /home/travis/build/HookyQR/VSCodeBeautify
Downloading VS Code into "/home/travis/build/HookyQR/VSCodeBeautify/.vscode-test" from: https://vscode-update.azurewebsites.net/1.2.1/linux-x64/stable
stream.js:94
      throw er; // Unhandled stream error in pipe.
            ^
Error: end of central directory record signature not found
    at /home/travis/build/HookyQR/VSCodeBeautify/node_modules/vscode/node_modules/gulp-vinyl-zip/node_modules/yauzl/index.js:167:14
    at /home/travis/build/HookyQR/VSCodeBeautify/node_modules/vscode/node_modules/gulp-vinyl-zip/node_modules/yauzl/index.js:474:5
    at Object._onImmediate (/home/travis/build/HookyQR/VSCodeBeautify/node_modules/vscode/node_modules/gulp-vinyl-zip/node_modules/yauzl/node_modules/fd-slicer/index.js:200:5)
    at processImmediate [as _immediateCallback] (timers.js:354:15)

No tests results on appveyor

I am trying to add appveyor testing for one of my extensions, but Appveyor doesn't seem to run the tests at all. I've copied the repo to a test repo for now:

https://github.com/HookyQR/VSCodeBeautify2

And added a deliberately failing test. The tests are reported on my PC, but they don't seem to run on Appveyor at all. Code is definitely being started, but on tests are run, and thus Appveyor reports success.

https://ci.appveyor.com/project/HookyQR/vscodebeautify2/build/1.0.2

Disable strict SSL in ./node_modules/vscode/bin/install script?

From @emackey on March 3, 2017 19:16

I'm on a corporate network (not a proxy) that imposes its own self-signed SSL certificate on outbound https traffic.

I already have this in my settings.json, which is insecure but at least allows me to install vscode extensions:

    "http.proxyStrictSSL": false

Likewise, I can turn off strict ssl to install npm modules, with npm set strict-ssl false. This is git bash on Windows:

$ npm config ls -l | grep strict-ssl
strict-ssl = false
$ cat package.json
{
  "name": "test-vscode-install",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "engines": {
    "vscode": "^1.0.0"
  },
  "scripts": {
        "vscode:prepublish": "node ./node_modules/vscode/bin/compile",
        "compile": "node ./node_modules/vscode/bin/compile -watch -p ./",
        "postinstall": "node ./node_modules/vscode/bin/install"
  },
  "author": "",
  "license": "MIT",
  "devDependencies": {
    "typescript": "^2.2.1",
    "vscode": "^1.0.5"
  }
}
$ npm install

> [email protected] postinstall C:\path\test-vscode-install
> node ./node_modules/vscode/bin/install

Detected VS Code engine version: ^1.0.0
Error installing vscode.d.ts: Error: self signed certificate in certificate chain

So, to summarize:

  • 👍 vscode settings.json is configured for insecure SSL, and can install extensions from the marketplace.
  • 👍 npm is configured for insecure SSL, and can install ordinary npm packages without trouble.
  • ❌ The vscode "postinstall" node script is still choking on the self-signed cert.

Is there a way to fix this? Thanks!

Copied from original issue: microsoft/vscode#21926

Error running `node ./node_modules/vscode/bin/install`

Hi, I just updated my extension's dependencies to "vscode": "^0.11.0" and appended "post install": "node ./node_modules/vscode/bin/install" to scripts in package.json.
I'm getting error running npm install which seems to be something wrong in node ./node_modules/vscode/bin/install.

➜  vscode-vim feature/update-dependencies ✓ npm i
npm WARN deprecated [email protected]: lodash@<3.0.0 is no longer maintained. Upgrade to lodash@^4.0.0

> [email protected] postinstall /Users/aioutecism/Gits/vscode-vim
> node ./node_modules/vscode/bin/install

Detected VS Code engine version: ^0.10.8
Error installing vscode.d.ts: TypeError: Invalid Version: release/0.10.1-extensionbuilders

npm ERR! Darwin 15.3.0
npm ERR! argv "/Users/aioutecism/.nvm/versions/node/v5.5.0/bin/node" "/Users/aioutecism/.nvm/versions/node/v5.5.0/bin/npm" "i"
npm ERR! node v5.5.0
npm ERR! npm  v3.7.1
npm ERR! code ELIFECYCLE
npm ERR! [email protected] postinstall: `node ./node_modules/vscode/bin/install`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script 'node ./node_modules/vscode/bin/install'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the amvim package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node ./node_modules/vscode/bin/install
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs amvim
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls amvim
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/aioutecism/Gits/vscode-vim/npm-debug.log

Cannot find module 'vscode'

I'm trying to update the vscode npm package to use the latest one (0.11.14), but I get the error Cannot find module 'vscode'. when I try the next line:

import * as vscode from "vscode";

I see in your code that from version 0.11.9 you added vscode.d.ts in your .npmignore (also in .gitignore), making it not being shipped with the package.

Before this version it was shipped and vscode was finding the module from that file.

Is there an special reason for it? How can I use the vscode module from my extension?

CompletionItem decorator

Is there a way to add a decorator to a CompletionItem?

I would like to add a color like the way CSS shows the color of the item. Is this possible? If so how can I do it?

Running tests from command line shows no output from test runner

From @DanTup on September 4, 2016 16:19

  • VSCode Version: 1.4
  • OS Version: Windows 10

We have tests running fine on AppVeyor, just by doing this:

npm install
npm run vscode:prepublish
node ./node_modules/vscode/bin/test

Everything works just great! However, I want to run the same on my local machine (I'm trying to see if I can get coverage reports, so it'll need a lot of faffing around) but I get this:

> node ./node_modules/vscode/bin/test

### VS Code Extension Test Run ###
Current working directory: M:\Coding\Applications\Dart-Code
Running extension tests: M:\Coding\Applications\Dart-Code\.vscode-test\Code M:\Coding\Applications\Dart-Code\out\test --extensionDevelopmentPath=M:\Coding\Applications\Dart-Code --extensionTestsPath=M:\Coding\Applications\Dart-Code\out\test

[9112:4692:0904/171747:VERBOSE1:crash_service_main.cc(68)] Session start. cmdline is [--reporter-url=https://ticinocrashreporter.azurewebsites.net/crash --application-name=VSCode --v=1]
[9112:4692:0904/171747:VERBOSE1:crash_service.cc(142)] window handle is 003A04F8
[9112:4692:0904/171747:VERBOSE1:crash_service.cc(290)] pipe name is \\.\pipe\VSCode Crash Service
dumps at C:\Users\danny\AppData\Local\Temp\VSCode Crashes
[9112:4692:0904/171747:VERBOSE1:crash_service.cc(294)] checkpoint is C:\Users\danny\AppData\Local\Temp\VSCode Crashes\crash_checkpoint.txt
server is https://ticinocrashreporter.azurewebsites.net/crash
maximum 128 reports/day
reporter is electron-crash-service
[9112:4692:0904/171747:VERBOSE1:crash_service_main.cc(84)] Ready to process crash requests
[9112:2868:0904/171747:VERBOSE1:crash_service.cc(323)] client start. pid = 7984
[9112:2868:0904/171747:VERBOSE1:crash_service.cc(323)] client start. pid = 2656
[1096:9060:0904/171747:VERBOSE1:crash_service_main.cc(68)] Session start. cmdline is [--reporter-url=https://ticinocrashreporter.azurewebsites.net/crash --application-name=VSCode --v=1]
[1096:9060:0904/171747:VERBOSE1:crash_service.cc(142)] window handle is 00170492
[1096:9060:0904/171747:VERBOSE1:crash_service.cc(290)] pipe name is \\.\pipe\VSCode Crash Service
dumps at C:\Users\danny\AppData\Local\Temp\VSCode Crashes
[1096:9060:0904/171747:VERBOSE1:crash_service.cc(294)] checkpoint is C:\Users\danny\AppData\Local\Temp\VSCode Crashes\crash_checkpoint.txt
server is https://ticinocrashreporter.azurewebsites.net/crash
maximum 128 reports/day
reporter is electron-crash-service
[1096:9060:0904/171747:ERROR:crash_service.cc(301)] could not start dumper
Error: Illegal state: missing config
Loading development extension at M:/Coding/Applications/Dart-Code
[M:/Coding/Applications/Dart-Code]: Overwriting extension C:/Users/danny/.vscode/extensions/DanTup.dart-code-0.10.0 with M:/Coding/Applications/Dart-Code.
[9112:4896:0904/171748:VERBOSE1:crash_service.cc(331)] client end. pid = 7984
[9112:4896:0904/171748:VERBOSE1:crash_service.cc(331)] client end. pid = 2656
Tests exited with code: 0
PS M:\Coding\Applications\Dart-Code> ^C
PS M:\Coding\Applications\Dart-Code> _service.cc(490)] session ending..
[9112:4692:0904/171749:VERBOSE1:crash_service.cc(495)] clients connected :2
clients terminated :2
dumps serviced :0
dumps reported :0
[9112:4692:0904/171749:VERBOSE1:crash_service_main.cc(89)] Session end. return code is 0

The only significant difference between my machine and AppVeyor that I can think of, is that I have Code installed and they don't (they download it). I don't know if that should make any difference though.

I'm not really sure where to start debugging. Is this expected to work? (I presume so, given it works on AppVeyor?)

Copied from original issue: microsoft/vscode#11523

Type definition out of date

The type definition appears out of date. Specifically, the getWordRangeAtPosition method on TextDocument is missing the regex parameter as listed in the official API docs.

TS 2.x: Conflict of vscode node definitions with @types/node

From @whitecolor on September 2, 2016 10:59

While developing extension, some modules may require node definitions they install it as dependency in @types/node

But then there appear many errors of duplicate indentifier:
image

If to remove @types/node those modules that require it, error that can not find definitions:

image

It is possible to resolve the conflict?

Copied from original issue: microsoft/vscode#11447

Integration tests in subfolders are not run when test root contains no test

Given:

  • code --version: 1.9.1 (on Ubuntu 16.04.2)
  • the default Launch Integration Tests launch entry in launch.json (created by the scaffolding tool)
  • a hierarchy of integration tests residing in subfolders of ${workspaceRoot}/out/test/integration
  • no test in ${workspaceRoot}/out/test/integration

Then:

  • no integration test is run
  • I get the following error: TypeError: Reflect.hasOwnMetadata is not a function

If there is at least one test in the top level folder, all tests in the subfolders are run.

Issue with linting and extension code

I have an extension (https://github.com/cfjedimaster/htmlescape-vscode) that I'm trying to publish to the store. It tests fine in Code, but when I vsce publish, I get:

Executing prepublish script 'node ./node_modules/vscode/bin/compile'...
Error: Command failed: node ./node_modules/vscode/bin/compile

Ok, it would be nice if it told me the error (grin), so I tried running the command directly:

src/extension.ts(112,9): error TS4091: Loop contains block-scoped variable 'editor' referenced by a function in the loop. This is only supported in ECMAScript 6 or higher.

So... I have something that works in Code, but isn't allowed by vsce?

Allow to run integration tests on Windows

From @DanTup on August 12, 2016 13:28

  • VSCode Version: 1.4
  • OS Version: Windows 10

I don't know if I'm doing this right, but I'm trying to set up my extension up on AppVeyor to run tests. It works fine on Jenkins (Linux and OS X) but fails on AppVeyor. I can repro on my Windows desktop.

I'm running npm test (I presume this is correct - it seems to do the expected thing on Linux/Mac) but I get this output:

npm test --silent
### VS Code Extension Test Run ###
Current working directory: C:\projects\dart-code
Downloading VS Code into "C:\projects\dart-code\.vscode-test" from: https://vscode-update.azurewebsites.net/1.4.0/linux-x64/stable
Running extension tests: C:\projects\dart-code\.vscode-test\VSCode-linux-x64\code C:\projects\dart-code\out\test --extensionDevelopmentPath=C:\projects\dart-code --extensionTestsPath=C:\projects\dart-code\out\test
Failed to execute tests: Error: spawn C:\projects\dart-code\.vscode-test\VSCode-linux-x64\code ENOENT
Tests exited with code: -4058
Command exited with code 1

It seems to be downloading a Linux version of code. I tracked this back to node_modules/vscode/bin/test which has a platform check that only supports Linux and Mac:

var platform = (process.platform === 'darwin') ? 'darwin' : 'linux-x64';

So, two questions:

  1. What's the correct way to run tests on Windows/AppVeyor (I found this though I'm not sure if relevant)
  2. Is there any reason npm test can't be made to work? All the pieces are cross-platform, it would be nice if this just worked the same everywhere

Copied from original issue: microsoft/vscode#10474

Breaking change (removal of vscode.d.ts) and semver

The TravisCI Linux machine for vscode-go started picking up 0.10.8-pre5 recently, which doesn't include vscode.d.ts, and thus breaks the build.

https://travis-ci.org/Microsoft/vscode-go/jobs/107513941

There's a couple things that are odd here:

  1. vscode.d.ts has been removed, but it's unclear how this is supposed to be dealt with. It looks like there is an npm run install script now, but not clear what the right way to integrate that is. Is there an example?
  2. This breaking change was done under a patch version update (0.10.7 -> 0.10.8). That means that once published without the -pre5 it will cause any "vscode": "^0.10.7" dependencies to auto-move, and will be broken.
  3. Strangely, it appears that NPM 1.X treats ^0.10.7 as picking 0.10.8-pre5, bug NPM 2.X treats it as picking 0.10.7, so I'm seeing inconsistent results on the default Mac and Linux Travis machines due to the different default NPM versions on each of these images. Something I'll have to fix, but also suggests the problem with this versioning.

tsc failure

Trying to build this extension myself but seems tsc fails with following errors

typings/node.d.ts(83,23): error TS1110: Type expected.
typings/node.d.ts(178,57): error TS1110: Type expected.
typings/node.d.ts(179,48): error TS1110: Type expected.
typings/node.d.ts(180,50): error TS1110: Type expected.
typings/node.d.ts(181,60): error TS1110: Type expected.
typings/node.d.ts(182,45): error TS1110: Type expected.
typings/node.d.ts(183,37): error TS1110: Type expected.
typings/node.d.ts(225,57): error TS1110: Type expected.
typings/node.d.ts(226,48): error TS1110: Type expected.
typings/node.d.ts(227,50): error TS1110: Type expected.
typings/node.d.ts(228,60): error TS1110: Type expected.
typings/node.d.ts(229,45): error TS1110: Type expected.
typings/node.d.ts(470,57): error TS1110: Type expected.
typings/node.d.ts(471,48): error TS1110: Type expected.
typings/node.d.ts(472,50): error TS1110: Type expected.
typings/node.d.ts(473,60): error TS1110: Type expected.
typings/node.d.ts(474,45): error TS1110: Type expected.
typings/node.d.ts(475,37): error TS1110: Type expected.
typings/node.d.ts(1835,52): error TS1005: '=' expected.
typings/node.d.ts(1836,76): error TS1005: '=' expected.
typings/node.d.ts(1837,52): error TS1005: '=' expected.
typings/node.d.ts(1837,96): error TS1005: '=' expected.
typings/node.d.ts(1847,54): error TS1005: '=' expected.
typings/node.d.ts(1848,74): error TS1005: '=' expected.
typings/node.d.ts(1849,54): error TS1005: '=' expected.
typings/node.d.ts(1849,94): error TS1005: '=' expected.

Is this dependent on any specific node/npm?

Another thing is we don't have Windows Platform support in this extension, which makes testing extensions in Win not possible.

CODE_TESTS_WORKSPACE not used?

Looking at the code of /bin/test.

CODE_TESTS_WORKSPACE gets assigned to testsWorkspace on lIne 20.

But testsWorkspace doesn't get used after that. I think it's meant to be used on line 33 as the first arg in the array, in place of testsFolder.

ignoreFocusOut

ignoreFocusOut for inputboxOption and quickpickOptions is missing.
It causes an error in my extension unless I manually change this typing.

Please put the vscode.d.ts file in the npm package.

sigh

Not having the vscode.d.ts file in the actual npm package is really a pain in the ass.

Especially if one is crafting their own build script (because perhaps I have other stuff I need to do, and already have a build script that takes care of everything else) and didn't see that is was required to have a update-vscode script in your package.json scripts section, and then run 'npm start update-vscode' after installing to get the actual the vscode.d.ts file.

Which! On top of having to run 'npm start update-vscode', one can't even run the script directly, since it expects to have only been run via npm, to get the engine version from the package.json file.

Any particular reason that there can't be at least a current version of the vscode.d.ts the package !?

Your creative-yet-fragile construction of the npm package installation makes for much time wasted in trying to solve something that should have been installed by the simple act of installing the damn package in the first place.

Pick the latest matching version

Currently the install script picks the oldest matching version. It would make more sense to use the latest one, i.e., given the engine version "^1.0.0" one would expect that to move up to 1.2.0, 1.3.0 when these become available.

Ambient modules cannot be nested in other modules or namespaces.

I'm seeing

node_modules/vscode/vscode.d.ts(2761,16): error TS2435: Ambient modules cannot be nested in other modules or namespaces.

when running

node ./node_modules/vscode/bin/compile

this causes issues for things like vsce package and project references to vscode

Is there something I'm doing wrong or is this a bug?

windows 1.13.x vscode-update.azurewebsites.net archives have an incorrect zip structure

The 1.13.x archives seem to be zipped incorrect as they do not have the important Code.exe file in the root. Instead code is located like this: Downloads\VSCode-win32-ia32-1.13.1\VSCode-win32-ia32\Code
while previous releases it was: Downloads\VSCode-win32-1.11.0\Code. This has the not so fun side effect of causing integration tests to fail:

### VS Code Extension Test Run ###
Current working directory: C:\dev\vscode-coverage-gutters
Downloading VS Code into "C:\dev\vscode-coverage-gutters\.vscode-test" from: https://vscode-update.azurewebsites.net/1.1
3.1/win32-archive/stable
Running extension tests: C:\dev\vscode-coverage-gutters\.vscode-test\Code C:\dev\vscode-coverage-gutters\out\test --exte
nsionDevelopmentPath=C:\dev\vscode-coverage-gutters --extensionTestsPath=C:\dev\vscode-coverage-gutters\out\test
Failed to execute tests: Error: spawn C:\dev\vscode-coverage-gutters\.vscode-test\Code ENOENT
Tests exited with code: -4058
npm ERR! code ELIFECYCLE

It seems directly related to the code assumption that the executable Code will always be in the root? https://github.com/Microsoft/vscode-extension-vscode/blob/master/bin/test#L24
Let me know if I am interpreting something wrong about my situation 😄

example failing build: https://ci.appveyor.com/project/ryanluker/vscode-coverage-gutters/build/1.0.272

Thanks,

Error installing vscode.d.ts: Error: Request returned status code: 404

Started to the see this on the 19th nov.

https://raw.githubusercontent.com/Microsoft/vscode/1.3.0/src/vs/vscode.d.ts exists so not sure whats happening?

Here's my travis output

Updating nvm to v0.32.0
$ nvm install 6
######################################################################## 100.0%
Computing checksum with sha256sum
Checksums matched!
Now using node v6.9.1 (npm v3.10.8)

Starting with io.js 3 and Node.js 4, building native extensions requires C++11-compatible compiler, which seems unavailable on this VM. Please read https://docs.travis-ci.com/user/languages/javascript-with-nodejs#Node.js-v4-(or-io.js-v3)-compiler-requirements.
$ node --version
v6.9.1
$ npm --version
3.10.8
$ nvm --version
0.32.0
$ if [ $TRAVIS_OS_NAME == "linux" ]; then export CXX="g++-4.9" CC="gcc-4.9" DISPLAY=:99.0; sh -e /etc/init.d/xvfb start; sleep 3; fi
Starting virtual X frame buffer: Xvfb.

$ npm install
npm WARN deprecated [email protected]: use uuid module instead
npm WARN deprecated [email protected]: to-iso-string has been deprecated, use @segment/to-iso-string instead.
npm WARN deprecated [email protected]: Jade has been renamed to pug, please install the latest version of pug instead of jade
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue

> [email protected] postinstall /home/travis/build/vscode-contrib/vscode-versionlens
> node ./node_modules/vscode/bin/install

Detected VS Code engine version: ^1.3.0
Found minimal version that qualifies engine range: 1.3.0
Fetching vscode.d.ts from: https://raw.githubusercontent.com/Microsoft/vscode/1.3.0/src/vs/vscode.d.ts
Error installing vscode.d.ts: Error: Request returned status code: 404
Details: 404: Not Found


npm ERR! Linux 4.8.7-040807-generic
npm ERR! argv "/home/travis/.nvm/versions/node/v6.9.1/bin/node" "/home/travis/.nvm/versions/node/v6.9.1/bin/npm" "install"
npm ERR! node v6.9.1
npm ERR! npm  v3.10.8
npm ERR! code ELIFECYCLE
npm ERR! [email protected] postinstall: `node ./node_modules/vscode/bin/install`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] postinstall script 'node ./node_modules/vscode/bin/install'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the vscode-versionlens package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node ./node_modules/vscode/bin/install
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs vscode-versionlens
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls vscode-versionlens
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/travis/build/vscode-contrib/vscode-versionlens/npm-debug.log


The command "npm install" failed and exited with 1 during .

Your build has been stopped.

Integration Tests of an extension test are failing

From @mohseenrm on December 23, 2016 7:12

Steps to Reproduce:

  1. npm install && npm run vscode:prepublish

[email protected]
[email protected]
[email protected]

Repo: https://github.com/mohseenrm/lit-it
Travis: https://travis-ci.org/mohseenrm/lit-it/jobs/186272789

Issue:
Tests run locally and pass. Same error on local machine though (mentioned MAC OS).
npm ERR! Failed at the [email protected] vscode:prepublish script 'node ./node_modules/vscode/bin/compile'.
Travis Raw Log

Copied from original issue: microsoft/vscode#17763

Replace multiple selections

I'm trying to replace multiple selections in a TextEditor by the uppercase version of each one, like the following:

function replaceContents (editor) {
  return Promise.all(editor.selections.map(selection => {
    const range = new Range(selection.start, selection.end)
    const text = editor.document.getText(range) || ''

    return editor.edit(builder => {
      builder.replace(range, text.toUpperCase())
    })
  }))
}

The Thenable returned on the first edit() call has true (and the content gets correctly replaced) but the ones from the remaining calls have false. Am I missing something?

Cannot find name 'Thenable'

I have the vscode.d.ts correctly installed and picked up. But when compiling, I get the error

c:/Users/felix/git/opensource/vscode-php/node_modules/vscode/vscode.d.ts(149,11): error TS2304: Cannot find name 'Thenable'.

Thenable seems to be defined in typings/es6.d.ts, but there is no /// <reference path="typings/es6.d.ts"> comment in vscode.d.ts

Issues when trying to update linter extension to use TypeScript 2.x

From the server:

node_modules/vscode-jsonrpc/lib/main.d.ts(8,67): error TS2304: Cannot find name 'Thenable'.
node_modules/vscode-jsonrpc/lib/main.d.ts(46,93): error TS2304: Cannot find name 'Thenable'.
node_modules/vscode-languageserver/lib/files.d.ts(2,83): error TS2304: Cannot find name 'Thenable'.
node_modules/vscode-languageserver/lib/files.d.ts(3,158): error TS2304: Cannot find name 'Thenable'.
node_modules/vscode-languageserver/lib/files.d.ts(8,155): error TS2304: Cannot find name 'Thenable'.
node_modules/vscode-languageserver/lib/main.d.ts(144,86): error TS2304: Cannot find name 'Thenable'.
node_modules/vscode-languageserver/lib/main.d.ts(151,88): error TS2304: Cannot find name 'Thenable'.
node_modules/vscode-languageserver/lib/main.d.ts(158,92): error TS2304: Cannot find name 'Thenable'.
node_modules/vscode-languageserver/lib/main.d.ts(217,67): error TS2304: Cannot find name 'Thenable'.
src/server.ts(50,35): error TS2304: Cannot find name 'Thenable'.

Where should I get Thenable from? In the past I got it from es6-promise, but that causes duplicate identifier errors now.

From the client:

node_modules/vscode-languageclient/lib/codeConverter.d.ts(30,31): error TS2305: Module 'vscode' has no exported member 'DocumentLink'.
node_modules/vscode-languageclient/lib/protocolConverter.d.ts(34,49): error TS2305: Module 'vscode' has no exported member 'DocumentLink'.
node_modules/vscode-languageclient/lib/protocolConverter.d.ts(35,53): error TS2305: Module 'vscode' has no exported member 'DocumentLink'.
node_modules/vscode-languageclient/lib/protocolConverter.d.ts(69,70): error TS2305: Module 'vscode' has no exported member 'DocumentLink'.
node_modules/vscode-languageclient/lib/protocolConverter.d.ts(70,73): error TS2305: Module 'vscode' has no exported member 'DocumentLink'.

Is this a bug, or am I missing a dependency?

Here is a copy of the extension: vscode-ext.zip (you'll just need to run npm install x2)

Error running tests: TypeError: Cannot read property '0' of null

From @kidtsunami on April 7, 2017 16:12

  • VSCode Version: v1.11.1
  • OS Version: macOS v10.12.4

Steps to Reproduce:

  1. Pull down MavensMate-VisualStudioCode extension from https://github.com/kidtsunami/MavensMate-VisualStudioCode/tree/command-tests
  2. Run cmd yarn
  3. Run cmd npm test
  4. Observe:
mavensdavid:MavensMate-VisualStudioCode davidhelmer$ npm test

> [email protected] test /Users/davidhelmer/Work/mavens-mate/MavensMate-VisualStudioCode
> node ./node_modules/vscode/bin/test

### VS Code Extension Test Run ###
Current working directory: /Users/davidhelmer/Work/mavens-mate/MavensMate-VisualStudioCode
Downloading VS Code into "/Users/davidhelmer/Work/mavens-mate/MavensMate-VisualStudioCode/.vscode-test" from: https://vscode-update.azurewebsites.net/1.11.1/darwin/stable
Error running tests: TypeError: Cannot read property '0' of null
npm ERR! Test failed.  See above for more details.```


_Copied from original issue: Microsoft/vscode#24236_

Problem using bin/install script through a proxy

Hi guys,

I recently switched to using the new 0.11.0 version of the VS Code extension tools which includes the new vscode.d.ts installer. Today @andydtoma reported an issue on my repo saying that the install script isn't working from behind a proxy. Here are the contents of his report:


I have cloned the project on a Win7 workstation behind enterprise proxy.
When trying to install the package dependencies with npm install I get ETIMEDOUT:

Error installing vscode.d.ts: Error: connect ETIMEDOUT 192.30.252.126:443

npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Users\DTOMA\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "install"
npm ERR! node v4.2.6
npm ERR! npm v3.7.1
npm ERR! code ELIFECYCLE
npm ERR! [email protected] postinstall: node ./node_modules/vscode/bin/install
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script 'node ./node_modules/vscode/bin/install'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the PowerShell package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node ./node_modules/vscode/bin/install
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs PowerShell
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls PowerShell
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\DTOMA\Documents\GitHub\vscode-powershell\npm-debug.log

I have tried with both last versions of node.js v4.2.6 and v5.5.0 with the same result.
Attached the result npm-debug.log:
npm-debug.log.txt

The proxy settings in settings.json are fitted to the environment.

On the same system, when I installed the marketplace version of the extension I had to apply the @joaomoreno workaround (Jan 4th) from the vscode issue microsoft/vscode#69

I think there is something similar in the dependency hierarchy.


Do you have any idea why this might be happening?

Let the compile command be a real command in bin

The compile command should be in a .bin folder and then could be called directly with "npm run script" method. The generator would then be updated to just be:

"scripts": {
    "vscode:prepublish": "compile",
    "compile": "compile -watch -p ./"
}

postinstall script filter out all definitions in latest vscode.d.ts file

microsoft/vscode@dc7402b starts to only use declare module instead of having both declare namespace and declare module. But postinstall script doesn't align with this change.

var markerHit = false;
    var lines = contents.split('\n').filter(function (line) {
        if (!markerHit && (line === '// when used for JS*' || line === 'declare module \'vscode\' {')) {
            markerHit = true;
        }

        return !markerHit;
    });

After the script is executed, the content being saved to the disk is actually

/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/

export = vscode;

graceful-fs@2 and @3 support will be removed soon

Hi. vscode is currently #110 in my list of modules that would likely to be broken when nodejs/node#6413 lands (which is anticipated to happen before v7.0).

Note that graceful-fs@1 and graceful-fs@4 are ok and would not be broken by this, but a require() on graceful-fs@2 or graceful-fs@3 would cause an error soon.

That is, runtime warning fs: re-evaluating native module sources is not supported. would be turned into a throw.

If you or your deps use graceful-fs@2 or graceful-fs@3 in runtime — you are affected.

Tracking: nodejs/node#5213.

Version regex broken for non-single digits versions

I get

Current working directory: W:\vscode-mssql
Downloading VS Code into "W:\vscode-mssql\.vscode-test" from: https://vscode-update.azurewebsites.net/1.10.0/win32-archive/stable
https://vscode-update.azurewebsites.net/1.10.0/win32-archive/stable
Error running tests: TypeError: Cannot read property '0' of null

After some debugging I found that the regex on line 82:
var version = downloadUrl.match(/\d\.\d\.\d/)[0].split('\.');
does not catch double digit versions and the new version of VSCode is 1.10.0.

Issue finding node.d.ts and index.d.ts

Hi there,

I am trying to update an extension I wrote for vscode a short while ago for switching between corresponding files (.h/.cpp etc. - https://github.com/pr0g/switch-corresponding) but I am running into issues trying to build/publish.

I have tried to update the extension to the latest requirements (what is needed in package.json - following this update - https://code.visualstudio.com/updates/v1_6#_extension-authoring, and the information on this page - https://code.visualstudio.com/docs/extensions/example-hello-world) but when I run tsc -p ./ I get the error:

typings/node.d.ts(1,1): error TS6053: File '<path/to/my/extension>/node_modules/vscode/typings/node.d.ts' not found.
typings/vscode-typings.d.ts(1,1): error TS6053: File '<path/to/my/extension>/node_modules/vscode/typings/index.d.ts' not found.

If I run npm install at the root of my extension I see this message:

> node ./node_modules/vscode/bin/install

Detected VS Code engine version: ^1.10.2
Found minimal version that qualifies engine range: 1.10.2
Fetching vscode.d.ts from: https://raw.githubusercontent.com/Microsoft/vscode/1.10.2/src/vs/vscode.d.ts
vscode.d.ts successfully installed!

but if I search for .d.ts (ag -g .d.ts) I just get these results at the root:

typings/node.d.ts
typings/vscode-typings.d.ts

I've probably missed something or am doing something wrong but I'm at a loss of how to fix this. Please feel free to clone the extension and see if you can replicate the problem!

I've published the extension a number of times before and have never had issue with this in the past, I'm not really sure what's changed.

Any information would be greatly appreciated!

Thank you for your time!

All the best!

Tom

Download typings on install, or include in package

I was very confused trying to add this to an existing project, until I realized that most repos have "postinstall": "node ./node_modules/vscode/bin/install" to actually download vscode.d.ts.

Would it make sense to set "postinstall": "node ./bin/install" in 'vscode' itself so downloading typings happens when the package is installed, or including the latest typings by default, which can be overridden if an extension supports older versions?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.