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

Editor content button contribution overrides Complete Merge button in merge editor #179306

Closed
ulasozguler opened this issue Apr 5, 2023 · 9 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug extensions Issues concerning extensions merge-editor
Milestone

Comments

@ulasozguler
Copy link

ulasozguler commented Apr 5, 2023

Type: Bug

Behaviour

Expected vs. Actual

While pyproject.toml open in a merge editor, Complete Merge button should be visible.
Create Environment... button overrides Complete Merge button.

Screenshot 2023-04-05 at 13 53 04

This is introduced in this PR.
I believe this is the problematic line. Not sure if there is a "isInMergeEditor" type of variable available but something like that should do.

Steps to reproduce:

  1. Create a new git repo. Create conflicting changes and try to merge. Open project in vscode:
mkdir bugtest
cd bugtest
git init
echo '[build-system]\nrequires = ["poetry-core"]\n\n# hello\n' > pyproject.toml
git add . && git commit -m "init"
git checkout -b newbranch
echo '[build-system]\nrequires = ["poetry-core"]\n\n# changed\n' > pyproject.toml
git add . && git commit -m "change"
git checkout main
echo '[build-system]\nrequires = ["poetry-core"]\n\n# conflictingchange\n' > pyproject.toml
git add . && git commit -m "conflictingchange"
git checkout newbranch
git merge main
code .
  1. Go to "Source Contol" panel and click pyproject.toml file.
  2. "Complete Merge" button is replaced by "Create Environment..." button.

Diagnostic data

  • Python version (& distribution if applicable, e.g. Anaconda): 3.10.9
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Poetry
  • Value of the python.languageServer setting: Default
Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

XXX

User Settings


languageServer: "Pylance"

linting
• flake8Enabled: true

formatting
• provider: "black"

Extension version: 2023.6.0
VS Code version: Code 1.77.0 (7f329fe, 2023-03-29T09:55:48.214Z)
OS version: Darwin arm64 22.2.0
Modes:
Sandboxed: No

System Info
Item Value
CPUs Apple M1 Pro (8 x 24)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
Load (avg) 2, 3, 3
Memory (System) 16.00GB (0.06GB free)
Process Argv
Screen Reader no
VM 0%
@karthiknadig
Copy link
Member

Created a fix for this here to avoid showing the button in diff editor: microsoft/vscode-python#20998

The UI for the buttons should be looked at by VS Code core. This is good feedback for the editor content contribution point in package.json.

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Apr 5, 2023
@karthiknadig karthiknadig removed their assignment Apr 5, 2023
@karthiknadig karthiknadig transferred this issue from microsoft/vscode-python Apr 5, 2023
@vscodenpa
Copy link

Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.77.1. Please try upgrading to the latest version and checking whether this issue remains.

Happy Coding!

@karthiknadig karthiknadig changed the title Create Environment... button overrides Complete Merge button in merge editor Editor content button contribution overrides Complete Merge button in merge editor Apr 5, 2023
@jfelectron
Copy link

with 1.77.2 I can confirm that that this issue remains
Screen Shot 2023-04-12 at 12 07 50 PM

@karthiknadig
Copy link
Member

@jfelectron Can you install pre-release version of the python extension? It should not show this button in the diff editor.

@hediet
Copy link
Member

hediet commented Apr 13, 2023

Related: #178758

@hediet
Copy link
Member

hediet commented Apr 13, 2023

@jrieken, what are your thoughts on this?

I can think of these options:

  1. the extension shouldn't use this button for "Create Environment..."
  2. the extension should add a context key so that the button does not show in diff/merge editors
  3. ?

@hediet hediet added this to the April 2023 milestone Apr 13, 2023
@hediet hediet added merge-editor and removed info-needed Issue requires more information from poster labels Apr 13, 2023
@hediet hediet added bug Issue identified by VS Code Team member as probable bug extensions Issues concerning extensions labels Apr 13, 2023
@karthiknadig
Copy link
Member

@hediet FYI, Python extension already added the context key for diff editor (this is in pre-release). I think there needs to be a different UI, may be a dropdown in cases where there are two or more buttons for the same content.

@hediet hediet modified the milestones: April 2023, On Deck Apr 21, 2023
@ArthurKun21
Copy link

@jfelectron Can you install pre-release version of the python extension? It should not show this button in the diff editor.

can confirm the issue was fixed with pre-released version

@hediet
Copy link
Member

hediet commented May 22, 2023

Closing as completed, as the issue seems to be fixed.

@hediet hediet closed this as completed May 22, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Jul 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug extensions Issues concerning extensions merge-editor
Projects
None yet
Development

No branches or pull requests

8 participants