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

Tasks interfering despite sequence order #174791

Open
kamilmielnik opened this issue Feb 19, 2023 · 0 comments
Open

Tasks interfering despite sequence order #174791

kamilmielnik opened this issue Feb 19, 2023 · 0 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug tasks Task system issues

Comments

@kamilmielnik
Copy link

kamilmielnik commented Feb 19, 2023

Type: Bug

  1. Create tasks.json:

Note "dependsOrder": "sequence".
Document formatter is Prettier.

{
  "version": "2.0.0",
  "tasks": [
    {
      "label": "organize-imports",
      "command": "${command:editor.action.organizeImports}"
    },
    {
      "label": "format-document",
      "command": "${command:editor.action.formatDocument}"
    },
    {
      "label": "format",
      "dependsOrder": "sequence",
      "dependsOn": ["organize-imports", "format-document"],
      "problemMatcher": []
    }
  ]
}
  1. Create keybindings.json:
[
  {
    "key": "ctrl+alt+f",
    "command": "workbench.action.tasks.runTask",
    "args": "format"
  }
]
  1. Create and save a TypeScript file:
import { unusedImport } from 'somewhere';

const x =         111;
  1. Hit Ctrl + Alt + F

Expected result

const x = 111;

Actual result
It will inconsistently, randomly(?) give 2 different results (either one of 2 requested tasks)

import { unusedImport } from 'somewhere';

const x = 111;

or

const x =         111;

Notes

  1. The same thing happens with extensions such as https://github.com/geddski/macros (even with the fix). I was testing it a lot.
  2. I'm actually trying to run 3 tasks in sequence (also eslint.executeAutofix in between the two from example), but 2 tasks are enough to reproduce the issue.
  3. Adding a delay in between the tasks helps:
{
  // See https://go.microsoft.com/fwlink/?LinkId=733558
  // for the documentation about the tasks.json format
  "version": "2.0.0",
  "tasks": [
    {
      "label": "organize-imports",
      "command": "${command:editor.action.organizeImports}"
    },
    {
      "label": "sleep-1",
      "type": "shell",
      "command": "/usr/bin/sleep",
      "args": ["0"]
    },
    {
      "label": "eslint",
      "command": "${command:eslint.executeAutofix}"
    },
    {
      "label": "sleep-2",
      "type": "shell",
      "command": "/usr/bin/sleep",
      "args": ["0"]
    },
    {
      "label": "prettier",
      "command": "${command:editor.action.formatDocument}"
    },
    {
      "label": "format",
      "dependsOrder": "sequence",
      "dependsOn": ["organize-imports", "sleep-1", "eslint", "sleep-2", "prettier"],
      "problemMatcher": []
    }
  ]
}

VS Code version: Code 1.75.1 (441438a, 2023-02-08T21:35:30.018Z)
OS version: Linux x64 5.19.0-32-generic
Modes:
Sandboxed: No

System Info
Item Value
CPUs 13th Gen Intel(R) Core(TM) i9-13900K (32 x 5500)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: disabled_software
video_encode: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
Load (avg) 1, 0, 0
Memory (System) 31.09GB (24.43GB free)
Process Argv --unity-launch
Screen Reader no
VM 0%
DESKTOP_SESSION ubuntu
XDG_CURRENT_DESKTOP Unity
XDG_SESSION_DESKTOP ubuntu
XDG_SESSION_TYPE x11
Extensions (11)
Extension Author (truncated) Version
color-info bie 0.7.2
bojler-vscode Kam 0.0.1
vscode-eslint dba 2.4.0
gitlens eam 13.2.0
prettier-vscode esb 9.10.4
easy-icons jam 0.3.1
macros-vscode Kam 1.2.0
vscode-docker ms- 1.23.3
sublime-keybindings ms- 4.0.10
r-factor-vscode Lim 1.0.0
multi-command ryu 1.6.0

(1 theme extensions excluded)

@kamilmielnik kamilmielnik changed the title Tasks interfering with eath other despite sequence order Tasks interfering with each other despite sequence order Feb 19, 2023
@kamilmielnik kamilmielnik changed the title Tasks interfering with each other despite sequence order Tasks interfering despite sequence order Feb 19, 2023
@meganrogge meganrogge added bug Issue identified by VS Code Team member as probable bug and removed confirmation-pending labels Dec 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug tasks Task system issues
Projects
None yet
Development

No branches or pull requests

2 participants