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

Open
nevir opened this Issue Dec 18, 2015 · 22 comments

Comments

Projects
None yet
@nevir

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 this to the Backlog milestone Dec 18, 2015

@egamma

This comment has been minimized.

Show comment
Hide comment
@egamma

egamma Dec 18, 2015

Member

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.

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

This comment has been minimized.

Show comment
Hide comment
@nevir

nevir 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!

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

This comment has been minimized.

Show comment
Hide comment
@egamma

egamma Dec 18, 2015

Member

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?

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 label Jan 27, 2016

@dbaeumer dbaeumer self-assigned this Jan 27, 2016

@unional

This comment has been minimized.

Show comment
Hide comment
@unional

unional Dec 21, 2016

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

unional commented Dec 21, 2016

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

@dbaeumer

This comment has been minimized.

Show comment
Hide comment
@dbaeumer

dbaeumer Apr 26, 2017

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.

Member

dbaeumer commented Apr 26, 2017

[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

This comment has been minimized.

Show comment
Hide comment
@eugeneagafonov

eugeneagafonov May 20, 2017

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?

eugeneagafonov commented May 20, 2017

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

This comment has been minimized.

Show comment
Hide comment
@dbaeumer

dbaeumer May 22, 2017

Member

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

Member

dbaeumer commented May 22, 2017

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

@kodos84

This comment has been minimized.

Show comment
Hide comment
@kodos84

kodos84 Aug 8, 2017

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?

kodos84 commented Aug 8, 2017

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

This comment has been minimized.

Show comment
Hide comment
@mikelward

mikelward commented Aug 8, 2017

@sumproxy

This comment has been minimized.

Show comment
Hide comment
@sumproxy

sumproxy Aug 11, 2017

@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.

sumproxy commented Aug 11, 2017

@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.

@kodos84

This comment has been minimized.

Show comment
Hide comment
@kodos84

kodos84 Aug 13, 2017

@sumproxy I created the feature request here: #32429

kodos84 commented Aug 13, 2017

@sumproxy I created the feature request here: #32429

@sumproxy

This comment has been minimized.

Show comment
Hide comment
@sumproxy

sumproxy commented Aug 14, 2017

@kodos84 thank you

@stnwk

This comment has been minimized.

Show comment
Hide comment
@stnwk

stnwk Sep 2, 2017

Is there any progress on this?

stnwk commented Sep 2, 2017

Is there any progress on this?

@dbaeumer

This comment has been minimized.

Show comment
Hide comment
@dbaeumer

dbaeumer Nov 10, 2017

Member

16 updates from #9664.

Member

dbaeumer commented Nov 10, 2017

16 updates from #9664.

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

@robinmattern

This comment has been minimized.

Show comment
Hide comment
@robinmattern

robinmattern Jan 7, 2018

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.

robinmattern commented Jan 7, 2018

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.

@Nutznieser

This comment has been minimized.

Show comment
Hide comment
@Nutznieser

Nutznieser Jan 8, 2018

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

Nutznieser commented Jan 8, 2018

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

@unional

This comment has been minimized.

Show comment
Hide comment
@unional

unional 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

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

This comment has been minimized.

Show comment
Hide comment
@zeroskyx

zeroskyx Jan 29, 2018

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

zeroskyx commented Jan 29, 2018

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

@Gruntfuggly

This comment has been minimized.

Show comment
Hide comment
@Gruntfuggly

Gruntfuggly Feb 6, 2018

Got fed up copying the same files to each workspace, so I've created the following extension:
https://marketplace.visualstudio.com/items?itemName=Gruntfuggly.global-config

Hopefully others might find it useful in the short term...

Gruntfuggly commented Feb 6, 2018

Got fed up copying the same files to each workspace, so I've created the following extension:
https://marketplace.visualstudio.com/items?itemName=Gruntfuggly.global-config

Hopefully others might find it useful in the short term...

@GinoMan

This comment has been minimized.

Show comment
Hide comment
@GinoMan

GinoMan Jul 1, 2018

Yeah, I often create Docker containers for my web projects or for scripting languages like Ruby and so often times I use the same docker commands to run the project-specific Dockerfile and Docker-compose.yml files and so to have a global task that just builds and runs the Docker-compose.yml file or Dockerfile in the project directory would be extremely useful. rather than have to copy virtually identical tasks.json files into each projects .vscode/ folder.

GinoMan commented Jul 1, 2018

Yeah, I often create Docker containers for my web projects or for scripting languages like Ruby and so often times I use the same docker commands to run the project-specific Dockerfile and Docker-compose.yml files and so to have a global task that just builds and runs the Docker-compose.yml file or Dockerfile in the project directory would be extremely useful. rather than have to copy virtually identical tasks.json files into each projects .vscode/ folder.

@sipi

This comment has been minimized.

Show comment
Hide comment
@sipi

sipi Jul 27, 2018

My use case :

  • I defined a default build task for exporting my org-mode (.org) file into pdf
  • I would like this task available for all my .org files without having to create an extension

If I understand well this discussion, it's not available yet. I should create an extension, is that right?
From the documentation, I need to know something about node.js to build an extension. It seems complicated for something which could be done by declaring this task.json global.

I'm really not a Microsoft addict, but I must say that VSCode is a great editor. I said bye to Emacs because of it. I liked it, but it was a pain to configure...

Thanks

sipi commented Jul 27, 2018

My use case :

  • I defined a default build task for exporting my org-mode (.org) file into pdf
  • I would like this task available for all my .org files without having to create an extension

If I understand well this discussion, it's not available yet. I should create an extension, is that right?
From the documentation, I need to know something about node.js to build an extension. It seems complicated for something which could be done by declaring this task.json global.

I'm really not a Microsoft addict, but I must say that VSCode is a great editor. I said bye to Emacs because of it. I liked it, but it was a pain to configure...

Thanks

@Benzyme93

This comment has been minimized.

Show comment
Hide comment
@Benzyme93

Benzyme93 Sep 6, 2018

It would be really useful if it was possible to run tasks from other project folders from within a workspace, i.e. dependency management.

For example, if I have Application and Library as two project folders within a workspace, I would like to be able to tell the Application build task that it "dependsOn" : [ "_Library_":"MyLibBuildTask" ] where _Library_ is the project folder name in the workspace. Something along those lines anyway.

If I have missed something and this is already possible, please let me know how!

Thanks

Benzyme93 commented Sep 6, 2018

It would be really useful if it was possible to run tasks from other project folders from within a workspace, i.e. dependency management.

For example, if I have Application and Library as two project folders within a workspace, I would like to be able to tell the Application build task that it "dependsOn" : [ "_Library_":"MyLibBuildTask" ] where _Library_ is the project folder name in the workspace. Something along those lines anyway.

If I have missed something and this is already possible, please let me know how!

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment