Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shared configuration (tasks/settings) #1435

Closed
nevir opened this issue Dec 18, 2015 · 35 comments
Closed

Shared configuration (tasks/settings) #1435

nevir opened this issue Dec 18, 2015 · 35 comments
Assignees
Labels
feature-request Request for new features or functionality on-testplan tasks Task system issues
Milestone

Comments

@nevir
Copy link

nevir commented Dec 18, 2015

I have a suite of projects that I'd like to have a shared configuration (e.g. all the repos at my company).

Currently we have duplicate .vscode/settings.json files, and several common .vscode/tasks.json tasks. Some projects have additional tasks defined beyond the common ones.


I'm unsure what the right approach to take here is. I'd love some input

  • Can extensions apply user settings, or define tasks/problem matchers? The docs don't seem to indicate that.
  • Can a project declare a VS Code extension as a dependency? (seems unlikely, but hey :P)
  • We're toying with the idea of a common package with a postinstall script that symlinks the configuration in (and just over-defining tasks) - but it's pretty ugly.
@egamma egamma added the feature-request Request for new features or functionality label Dec 18, 2015
@egamma egamma added this to the Backlog milestone Dec 18, 2015
@egamma
Copy link
Member

egamma commented Dec 18, 2015

We have gaps when it comes to managing many projects and sharing among them and the answer to your question is currently not supported, sorry, but we have it on the backlog to improve this.

Are your tasks/problem matchers mostly for supporting build tasks for a particular language?

Having support for workspace - extension dependencies is on our radar.

When it comes to sharing across projects you can consider something similar as we do for extensions. A yeoman generator generates the initial setup and shared tooling code comes from a node module in our case the vscode node module.

@nevir
Copy link
Author

nevir commented Dec 18, 2015

Are your tasks/problem matchers mostly for supporting build tasks for a particular language?

Yeah - currently we've got ESLint, TAP problem matchers - the thing is that we're running them via a custom gulp task that wraps each task and only runs a subset of checks at a time. It necessitates somewhat heavy watching.beginsPattern/watching.endsPattern and other settings.

(using off the shelf problem matchers doesn't save much)

Having support for workspace - extension dependencies is on our radar

Awesome!

@egamma
Copy link
Member

egamma commented Dec 18, 2015

What isTAP?

CC @dbaeumer

Currently you cannot contribute problem matchers through an extension, so if the problem matchers are generally useful we could add them to set. Could you consider a PR?

@dbaeumer dbaeumer added the tasks Task system issues label Jan 27, 2016
@dbaeumer dbaeumer self-assigned this Jan 27, 2016
@unional
Copy link

unional commented Dec 21, 2016

TAP is a test runner. ava is what I'm using now. 👍 , over mocha

@dbaeumer
Copy link
Member

[Addressed in new terminal runner]

This will largely be addressed with the new runner. There extension can contribute tasks which makes creating a tasks.json file for standard tasks unnecessary. For example the C# extension can contribute a standard task to compile C# files.

Since 1.10 extensions can also contribute probem patterns and problem matchers.

Since a longer time workspaces can prereq extensions using extension recommendations.

@eugeneagafonov
Copy link

Has this been addressed already? My concern is defining "global" tasks in extensions, but in a broader sense is:

Can extensions apply user settings, or define tasks/problem matchers?

@dbaeumer
Copy link
Member

With the May release an extension can defined problem matchers and tasks (problem matchers is already available sine Feb.)

@black-corvus
Copy link

I am not sure if this is the correct issue to post my comment but it seems pretty close.

I am looking for something like what Sublime Text does. In Sublime Text, you can define a "build system" which may be associated with a file extension. The build system is a user-defined shell command. You can then build a file with your build system without having to have a project or workspace set up. However when I try to do the same thing in vscode using "build tasks", I get an error saying "Tasks are only available on a workspace folder". I don't want to have to create/open a workspace folder if I want to build a simple script.

Could you possibly imitate the functionality of Sublime Text?

@mikelward
Copy link

@kodos84 Please follow https://github.com/Microsoft/vscode/wiki/Submitting-Bugs-and-Suggestions to submit a new feature request.

@sumproxy
Copy link

@kodos84 Did you file the feature request as suggested by @mikelward ? I'm also interested in this functionality, so I'd be grateful if you let me know. Thanks.

@black-corvus
Copy link

@sumproxy I created the feature request here: #32429

@sumproxy
Copy link

@kodos84 thank you

@stnwk
Copy link

stnwk commented Sep 2, 2017

Is there any progress on this?

@dbaeumer
Copy link
Member

16 updates from #9664.

@dbaeumer dbaeumer modified the milestones: Backlog, On Deck Nov 10, 2017
@robinmattern
Copy link

It would be nice to put a few common simple tasks in a tasks.json file located in the Users settings folder that could be merged with the workspace tasks.json file. An example would be to run a NodeJS script from anywhere using a common keystroke binding, e.g.

{  
    "label"  : "Run NodeJS Script",  
    "type"   : "shell",  
    "program": "node \"${file}\""  
     }  

with a keybinding of:

{
    "key"    : "cmd+shift+n",
    "command": "workbench.action.tasks.runTask",
    "args"   : "Run NodeJS Script"
    "when"   : "editorTextFocus"
     }

BTW: It seems that VSCode does attempt to merge tasks from subfolders. I tried the dubious scenario of putting my .code-workspace file in my home directory on Windows, causing it to search through the symbolic links (yes, Windows has them) that I have in my Desktop and Documents folders. It took awhile to search many node_module folders, before it found this "task", i.e. file, .\build\assets\vendors\moment\typing-tests\tsconfig.json, 13 times as a result of it being embedded in a node module, named CleanUI from Mediatec Software, a few years back.

When picking the Run Task... menu item, or running the task, "Run NodeJS Script", with "cmd-shift-n", it took over 2 minutes for VSCode to obey my command.

@FreeHarry
Copy link

@robinmattern: Yes, I agree. To support a global tasks.json file located in the Users settings folder would be very handy!

@unional
Copy link

unional commented Jan 8, 2018

I can think of several levels of configs:

  • Environment global config:
    • useful when multiple users login to the same environment and these configs are common to all workspace/project
  • User global config
  • Workspace user config
  • Project user config
  • Workspace team config
  • Project team config

@zeroskyx
Copy link

I'd love to be able to define global tasks (such as the global launch.json) in the user settings as well.

@Geobert
Copy link

Geobert commented Sep 27, 2019

My use case is Rust development. I keep copying tasks.json in every crates I'm working on just to have cargo check and cargo test available.

@smirnovich
Copy link

Technically It can be made with VSCode Active Buttons extension (https://github.com/SeunLanLege/vscode-action-buttons.git) since settings.json is a global file. But you will get extra GUI buttons which maybe not cool for some developers.

alexr00 added a commit that referenced this issue Oct 17, 2019
@alexr00 alexr00 modified the milestones: October 2019, November 2019 Oct 24, 2019
@kanlukasz
Copy link

I really can't wait for it. Global tasks will be very useful. I miss this

@alexr00 alexr00 modified the milestones: November 2019, December 2019 Dec 2, 2019
@lukaszpolowczyk
Copy link

Maybe it would be a good idea?
#38162

If not, maybe something similar?
I think that's a good direction. You can be inspired by this.

alexr00 added a commit that referenced this issue Dec 17, 2019
@alexr00
Copy link
Member

alexr00 commented Dec 17, 2019

A tasks.json next to your user settings.json is now supported! No commands to create this for you yet, but I'll add something. It only supports tasks version 2.0.0 and type shell and process tasks.

@alexr00 alexr00 closed this as completed Dec 17, 2019
@BillDenton
Copy link

A tasks.json next to your user settings.json is now supported! No commands to create this for you yet, but I'll add something. It only supports tasks version 2.0.0 and type shell and process tasks.
@alexr00 is this in:
Version: 1.41.0 (system setup)
Commit: 9579eda
Date: 2019-12-11T18:37:42.077Z
Electron: 6.1.5
Chrome: 76.0.3809.146
Node.js: 12.4.0
V8: 7.6.303.31-electron.0
OS: Windows_NT x64 10.0.17763

@alexr00
Copy link
Member

alexr00 commented Dec 17, 2019

This will be available in the next VS Code Insiders build: https://code.visualstudio.com/insiders/

@alexr00
Copy link
Member

alexr00 commented Jan 20, 2020

@daniladyabin thanks for trying this feature in insiders and reporting the problem! I've pushed a fix to master and it should be in the next insiders build. Let me know if you have any other issues with this!

@alexr00 alexr00 mentioned this issue Jan 27, 2020
2 tasks
@vscodebot vscodebot bot locked and limited conversation to collaborators Jan 31, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality on-testplan tasks Task system issues
Projects
None yet
Development

No branches or pull requests