GithubHelp home page GithubHelp logo

microsoft / vscode Goto Github PK

View Code? Open in Web Editor NEW
158.3K 158.3K 27.6K 890.23 MB

Visual Studio Code

Home Page: https://code.visualstudio.com

License: MIT License

JavaScript 1.92% TypeScript 94.90% Batchfile 0.03% Shell 0.16% CSS 1.63% HTML 0.72% PowerShell 0.02% Python 0.01% Inno Setup 0.58% Roff 0.01% SCSS 0.01% Less 0.01% Dockerfile 0.01% Java 0.01% PHP 0.01% Hack 0.01% Makefile 0.01% Go 0.01% C++ 0.01% Pug 0.01%
editor electron microsoft typescript visual-studio-code

vscode's Introduction

Visual Studio Code - Open Source ("Code - OSS")

Feature Requests Bugs Gitter

The Repository

This repository ("Code - OSS") is where we (Microsoft) develop the Visual Studio Code product together with the community. Not only do we work on code and issues here, we also publish our roadmap, monthly iteration plans, and our endgame plans. This source code is available to everyone under the standard MIT license.

Visual Studio Code

VS Code in action

Visual Studio Code is a distribution of the Code - OSS repository with Microsoft-specific customizations released under a traditional Microsoft product license.

Visual Studio Code combines the simplicity of a code editor with what developers need for their core edit-build-debug cycle. It provides comprehensive code editing, navigation, and understanding support along with lightweight debugging, a rich extensibility model, and lightweight integration with existing tools.

Visual Studio Code is updated monthly with new features and bug fixes. You can download it for Windows, macOS, and Linux on Visual Studio Code's website. To get the latest releases every day, install the Insiders build.

Contributing

There are many ways in which you can participate in this project, for example:

If you are interested in fixing issues and contributing directly to the code base, please see the document How to Contribute, which covers the following:

Feedback

See our wiki for a description of each of these channels and information on some other available community-driven channels.

Related Projects

Many of the core components and extensions to VS Code live in their own repositories on GitHub. For example, the node debug adapter and the mono debug adapter repositories are separate from each other. For a complete list, please visit the Related Projects page on our wiki.

Bundled Extensions

VS Code includes a set of built-in extensions located in the extensions folder, including grammars and snippets for many languages. Extensions that provide rich language support (code completion, Go to Definition) for a language have the suffix language-features. For example, the json extension provides coloring for JSON and the json-language-features extension provides rich language support for JSON.

Development Container

This repository includes a Visual Studio Code Dev Containers / GitHub Codespaces development container.

  • For Dev Containers, use the Dev Containers: Clone Repository in Container Volume... command which creates a Docker volume for better disk I/O on macOS and Windows.

    • If you already have VS Code and Docker installed, you can also click here to get started. This will cause VS Code to automatically install the Dev Containers extension if needed, clone the source code into a container volume, and spin up a dev container for use.
  • For Codespaces, install the GitHub Codespaces extension in VS Code, and use the Codespaces: Create New Codespace command.

Docker / the Codespace should have at least 4 Cores and 6 GB of RAM (8 GB recommended) to run full build. See the development container README for more information.

Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

License

Copyright (c) Microsoft Corporation. All rights reserved.

Licensed under the MIT license.

vscode's People

Contributors

aeschli avatar aiday-mar avatar alexdima avatar alexr00 avatar amunger avatar benibenj avatar bpasero avatar chrmarti avatar connor4312 avatar dbaeumer avatar deepak1556 avatar hediet avatar isidorn avatar joaomoreno avatar joyceerhl avatar jrieken avatar lramos15 avatar lszomoru avatar meganrogge avatar mjbvz avatar octref avatar ramya-rao-a avatar rebornix avatar roblourens avatar rzhao271 avatar sandy081 avatar sbatten avatar tylerleonhardt avatar tyriar avatar weinand 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  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

vscode's Issues

Fix add selection above and add selection below hotkey on Ubuntu

I'm used to alt+shift+up and alt+shift+down expanding the selection above and below the current anchor, as far as I can see this is not implemented in core or an extension.

Edit: This is actually implemented and working fine, the hotkey ctrl+alt+up/down just conflicts with the Ubuntu OS hotkey to change workspace.

Wakatime plugin

Oh, how I would love to have a WakaTime plugin for Visual Studio Code! Don't know if that should have an issue here, as the code'll be elsewhere. But I'll close it if I manage to get it done.

BTW: Great that you opensourced VS Code! I just saw Erich Gamma open source it on Connect(). Amazing, he's the same guy I read the Design Patterns book from during my studies right :P.

Searching large projects is too slow

Ubuntu 12.04, vscode 0.10.1

I have found Go to file's indexing against a full Chromium workspace to be very slow. It took ~40 seconds to find "Tab.java" whereas a simple find command took less than a second:

$ time find . -name "Tab.java"
./chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java

real    0m0.559s
user    0m0.268s
sys 0m0.284s

Note that the workspace is on an SSD.

No blue icon on linux

I see the blue icon with 0.9 builds, but not with 0.10.1 builds.
Only a generic tool icon is shown.

Document symbols are duplicated

When adding a 2nd document symbol provider, let's say for typescript, all entries are duplicated. When adding a 3rd, they are triplicated, etc...

Omnisharp not included in Linux build

Our linux build machine does not include the csharp-o/bin folder.

  1. Running scripts/npm.sh install -> csharp-o/bin folder nicely gets created on my linux machine.
  2. Running gulp vscode-linux-x64 also nicely creates the csharp-o/bin folder on my linux machine.

Something is strange on our build machine

Development Environment Improvements (code.bat/code.sh)

There is some work remaining to make the development environment nicer.

  • Do not create the Electron-Build folder outside of the source repository
  • Warn the user when node_modules are missing and a npm install is required
  • Warn the user when he runs npm install and not scripts/npm
  • Warn the user when out folder is missing and gulp watch is required

activeTextEditor not correct while the extension is activated

  • create the following extension (example for our doc)
  • run the extension. In a workspace create a md file, open it and check that you get the counter in the status bar
  • now reload the workspace while the md file is open. Observer that the md file opens, but the counter is not shown

The extension activates on "onLanguage:markdown".
When it starts, it prints the current active mode: vs.editor.modes.nullMode
It registers for active editor change event, but doesn't get any events that tells it that a markdown file has opened.

import {window, commands, Disposable, ExtensionContext, StatusBarAlignment, StatusBarItem, TextDocument} from 'vscode';

// This method is called when your extension is activated. Activation is
// controlled by the activation events defined in package.json.
export function activate(context: ExtensionContext) {

    // Use the console to output diagnostic information (console.log) and errors (console.error).
    // This line of code will only be executed once when your extension is activated.
    console.log('Congratulations, your extension "WordCount" is now active!');

    // create a new word counter
    let wordCounter = new WordCounter();
    let controller = new WordCounterController(wordCounter);

    // Add to a list of disposables which are disposed when this extension is deactivated.
    context.subscriptions.push(controller);
    context.subscriptions.push(wordCounter);
}

class WordCounter {

    private _statusBarItem: StatusBarItem;

    public updateWordCount() {

        // Create as needed 
        if (!this._statusBarItem) { 
            this._statusBarItem = window.createStatusBarItem(StatusBarAlignment.Left); 
        }  

        // Get the current text editor 
        let editor = window.activeTextEditor; 
        if (!editor) { 
            this._statusBarItem.hide(); 
            return; 
        } 

         let doc = editor.document; 

        console.log('Current doc language ' + doc.languageId);

        // Only update status if an MarkDown file 
        if (doc.languageId === "markdown") { 
            let wordCount = this._getWordCount(doc); 

            // Update the status bar 
            this._statusBarItem.text = wordCount !== 1 ? `${wordCount} Words` : '1 Word'; 
            this._statusBarItem.show(); 
        } else { 
            this._statusBarItem.hide(); 
        } 
    } 

    public _getWordCount(doc: TextDocument): number { 

        let docContent = doc.getText(); 

        // Parse out unwanted whitespace so the split is accurate 
        docContent = docContent.replace(/(< ([^>]+)<)/g, '').replace(/\s+/g, ' '); 
        docContent = docContent.replace(/^\s\s*/, '').replace(/\s\s*$/, ''); 
        let wordCount = 0; 
        if (docContent != "") { 
            wordCount = docContent.split(" ").length; 
        } 

        return wordCount; 
    } 

    dispose() {
        this._statusBarItem.dispose();
    }
}

class WordCounterController {

    private _wordCounter: WordCounter;
    private _disposable: Disposable;

    constructor(wordCounter: WordCounter) {
        this._wordCounter = wordCounter;
        this._wordCounter.updateWordCount();

        // subscribe to selection change and editor activation events
        let subscriptions: Disposable[] = [];
        window.onDidChangeActiveTextEditor(this._onEvent, this, subscriptions);

        // update the counter for the current file
        this._wordCounter.updateWordCount();        

        // create a combined disposable from both event subscriptions
        this._disposable = Disposable.from(...subscriptions);
    }

    dispose() {
        this._disposable.dispose();
    }

    private _onEvent() {
        console.log('active editor changed ');
        this._wordCounter.updateWordCount();
    }
}
{
    "name": "WordCount",
    "description": "Count the words",
    "version": "0.0.1",
    "engines": {
        "vscode": "^0.10.1"
    },
    "categories": [
        "Other"
    ],
    "activationEvents": [
        "onLanguage:markdown"
    ],
    "main": "./out/src/extension",
    "scripts": {
        "vscode:prepublish": "node ./node_modules/vscode/bin/compile",
        "compile": "node ./node_modules/vscode/bin/compile -watch -p ./"
    },
    "devDependencies": {
        "typescript": "^1.6.2",
        "vscode": "0.10.x"
    }
}

Running Code should open a new instance, not activate a currently opened one

Ubuntu 12.04, vscode 0.10.1

Currently when you run Code if there is an instances already running (or shift clicking the app icon in Windows/Ubuntu) it will activate the currently opened window. This should open a new instance, the same goes for opening a new instance of Code with a folder as an argument when an instance is already open.

It's a very common use case for many developers to have multiple editors with the same folder open.

Repro:

  1. Code (open instance of vscode)
  2. Code

Expected:
A new instance of vscode is opened

Actual:
The current instance of vscode is activated

broken selection feedback when selecting bold text in markdown files

  • open a markdown file with bold markup, e.g.
    abc text xyz
  • try to select the line with the mouse starting at 'abc' and slowly extending to 'xyz'
    Observe: if you reach the second '**', the selection of 'text' disappears. In the end you have two disconnected selection ranges.
  • in addition I see lots of flashing selection changes while dragging the mouse

Variables in local window stop stop updating their value when stepping through code quickly

In a node express app I have the following loop:

var msg = 'hello world';
var i = 0;
while (i < 100) {
msg = msg + i.toString();
i++;
}

I set up the local and watch windows in the debugger so that I can see the msg variable in both.

When stepping through the loop, if I press F10 very quickly, eventually the msg variable in the locals window will stop updating. See the screenshot below
snip_20151116130725

When stepping through quickly, I sometimes see a message in the watch window that says 'Exception while processing request'

This is on 0.10.0

vscode "--extensionHomePath" option does not work when used with the vscode proxy

I'm developing an extension and want to test its installation from the gallery. After installing it from the gallery, I want to continue development in the VSCode extension host. When launching the extension through F5, I see the annoying extension override warning in the extension host window.
To prevent that the ~/.vscode/extensions path is used in that case, I tried to use the " --extensionHomePath" in the extensionHost launch config and specify an empty directory.
But it seems that the "--extensionHomePath" isn't honoured in this case (probably because vscode is a proxy that connects to an already running vscode).

BTW, it would be cool if "--extensionHomePath" would allow an empty path.

build errors: vscode.d.ts is not found

when running build I am seeing +400 errors, all of them related to vscode.d.ts.

*** Error: vscode/src/vs/workbench/api/common/pluginHostTypes.ts(434,19): Cannot find namespace 'vscode'.
*** Error: vscode/src/vs/workbench/api/common/pluginHostTypes.ts(437,24): Cannot find namespace 'vscode'.
*** Error: vscode/src/vs/workbench/api/common/pluginHostTypes.ts(437,46): Cannot find namespace 'vscode'.

....

*** Error: vscode/extensions/declares.d.ts(59,51): Cannot find name 'Thenable'.
*** Error: vscode/extensions/vscode-api-tests/src/window.test.ts(9,33): Cannot find module 'vscode'.
*** Finished with 408 errors.

...

welcome.md packaged wrongly

VSCode > Help > Show Welcome > does not work

If I look at the contents of my VSCode package I see a top level resource folder containing a welcome.md. This looks badly placed

Flash between opening of workspaces, reload

start code
set a dark theme other than the default dark theme if you don't already run with a dark theme
file | open folder -> pick any folder
file | open folder -> pick some other folder

result: you'll see a delay/flash between opening of workspaces.

[f#] Block comment not colored as comment

Using the block comment in F# adds the following around 'samplesLabel':

let mutable (*samplesLabel*) : System.Windows.Forms.Label = null

This is however not colored as a comment in VS Code.

ES6 jsconfig.json error

I am incorrectly getting the following error, "This can only be used with ES6. Make sure to have a jsconfig.json-file which sets the target to ES6".

Furthermore, I think I may have stumbled upon a weird case where if the start of the file name is "temp" as in "temp.js", "temporary.js", or "temp123.js" it will cause this error.

To reproduce:
Create a file called temp.js with some ES6 code, such as:

let x = 10

The above error is now showing. To fix it, create the jsconfig.json file which sets the target to ES6:

{
    "compilerOptions": {
        "target": "ES6"
    }
}

The error is still showing, now incorrectly.

If I rename "temp.js" to "test.js" (or anything that doesn't start with 'temp') the error goes away. Or, if I create a files array in jsconfig.json which lists "temp.js", the error goes away:

{
    "compilerOptions": {
        "target": "ES6"
    },
    "files": [
        "temp.js"
    ]
}

I don't want to have to do this for every file in my project.

I'm running on Windows 7, 64-bit.

Thanks

Expected treatment of threads in debug viewlet UI?

I’m seeing some odd behavior around how threads are being rendered in the Code debugger for the Go debugger extension. But I’m also not certain what I should be expecting to see, as I don’t think I’ve seen any examples of debuggers which show thread information in Code.

The Go debugger returns a list of threads from DebugSession#threadsRequest, but these are not displayed anywhere. However, it seems that if I’ve ever hit a breakpoint on a different thread before, then later breakpoints will cause a second root node to appear in the Call Stack window showing the stacks associated with the 2 threads I've hit breakpoints on at some point (out of the 10 or so threads I’ve reported as existing).

On the thread that is not the active thread, the call stack displayed appears to be the call stack from the previous breakpoint I was at, not the active call stack on that thread at the current point. And in fact, in both cases, my DebugSession#stackTraceRequest implementation is only being called once (for the thread the breakpoint was hit on), not for any of the other threads I reported.

After hitting first breakpoint:
screen shot 2015-11-17 at 10 23 37 pm
After hitting second breakpoint:
screen shot 2015-11-17 at 10 25 09 pm

[Git] weird indicator for renamed file

(I am on Mac OS X, Git 2.4.0)

  • have a checked in README.md with some contents
  • take the contents of the file and move it to a new file CONTRIBUTING.md
  • change the text in README.md to something else
  • stage all

image

Bundled files don't have a top copyright statement

Latest Build, open workbench.main.js.

Observe: the file doesn't have a top copyright statement. It starts with some code. Also observe that at the end of the file there are a lot of MS copyright statements. Seems that bundling doesn't treat them well.

Crash when opening Code via the command line

Ubuntu 12.04, vscode 0.10.1

Note that I have file symlinks setup for these config files which could having something to do with this crash:

  • ~/.config/Code/User/keybindings.json
  • ~/.config/Code/User/settings.json

Repro:

  1. Open terminal
  2. Code &
  3. Open another terminal (at ~)
  4. Code . &

Expected:
vscode opens successfully

Actual:
Crash:

A JavaScript error occurred in the main process

Uncaught Exception:
Error: watch ENOSPC
    at exports._errnoException (util.js:837:11)
    at FSWatcher.start (fs.js:1247:11)
    at Object.fs.watch (fs.js:1273:11)
    at e.registerWatchers (/home/local/ANT/daniimms/VSCode-linux-x64/resources/app/out/vs/workbench/electron-main/main.js:7:3462)
    at new e (/home/local/ANT/daniimms/VSCode-linux-x64/resources/app/out/vs/workbench/electron-main/main.js:7:3207)
    at Object.<anonymous> (/home/local/ANT/daniimms/VSCode-linux-x64/resources/app/out/vs/workbench/electron-main/main.js:7:4907)
    at e._invokeFactory (/home/local/ANT/daniimms/VSCode-linux-x64/resources/app/out/vs/loader.js:5:13773)
    at e._complete (/home/local/ANT/daniimms/VSCode-linux-x64/resources/app/out/vs/loader.js:5:14012)
    at e.resolveDependency (/home/local/ANT/daniimms/VSCode-linux-x64/resources/app/out/vs/loader.js:5:15066)
    at e._onModuleComplete (/home/local/ANT/daniimms/VSCode-linux-x64/resources/app/out/vs/loader.js:5:21369)

Interpolation strings don't have colouring

After the update, interpolation strings in a plain .js file don't get highlighted anymore. Previous behaviour highlighted plain text, the $ symbol and the interpolation braces. Now everything between `` has no colouring at all.

function sayHello(customer)
{
    console.log(`Hello ${customer}`);
}

nocolours

Program appears to continue executing after pressing stop in the debugger

In a simple node app, I step through a loop in the debugger. Before exiting the loop, I press the stop button
snip_20151116130725
I expect the program to stop executing right at that point but it appears to continue executing due to the fact that the console.log statement is executed (highlighted below) and the value of the string being output looks like the loop continued to execute even after pressing stop:
snip_20151116150729

CSS: toggle line comment is not preserving

Have a CSS block like this:

.monaco-workbench > .part > .status {
    display: none; /* Parts have to opt in to show title area */
}

Put the cursor to the body of the declaration and toggle line comment twice, you end up with this:

.monaco-workbench > .part > .status {
    /*display: none;  Parts have to opt in to show title area */
}

Extension uninstall leaves empty directories behind

I install eslint and jshint and uninstalled them again. I still had two directories in ~/.vscode/extensions for dbaeumer.jshint and dbaeumer.eslint with no package.json. On the next start of VSCode it complained about missing package.json files. I needed to delete the folders manually

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.