-
Notifications
You must be signed in to change notification settings - Fork 28.2k
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
Stage Selected Range Bug with Path Capitalisation #220541
Comments
For what it's worth, doing this in the command line with D:\Redacted\Documents\Redacted\Redacted>git add -p client/src/components/LetterWriter/toolbar/WriterToolbar.tsx
diff --git a/client/src/components/LetterWriter/toolbar/WriterToolbar.tsx b/client/src/components/LetterWriter/toolbar/WriterToolbar.tsx
index 4d71187..665840b 100644
--- a/client/src/components/LetterWriter/toolbar/WriterToolbar.tsx
+++ b/client/src/components/LetterWriter/toolbar/WriterToolbar.tsx
@@ -33,9 +33,10 @@ import {
UNDO_COMMAND,
REDO_COMMAND,
LexicalEditor,
+ KEY_MODIFIER_COMMAND,
} from "lexical";
import { $setBlocksType } from "@lexical/selection";
-import { $isLinkNode } from "@lexical/link";
+import { $isLinkNode, TOGGLE_LINK_COMMAND } from "@lexical/link";
import {
$isListNode,
INSERT_CHECK_LIST_COMMAND,
(1/6) Stage this hunk [y,n,q,a,d,j,J,g,/,s,e,?]? n
@@ -85,14 +86,17 @@ import IconButton from "../../Inputs/IconButton";
import { RadioOption } from "../../Inputs/RadioInput";
import { TbFlask, TbLetterA, TbLetterASmall, TbTextResize } from "react-icons/tb";
import { GrDocument } from "react-icons/gr";
-import { getSelectedNode } from "../getSelectedNode";
+import { getSelectedNode } from "../utils/getSelectedNode";
import { FaCircle, FaRegCircle, FaRegSquareFull, FaSquareFull } from "react-icons/fa6";
import { TOOLBAR_ICON_SIZE } from "../../../../constants/sizing";
import { INSERT_PAGE_BREAK } from "../plugins/PageBreakPlugin";
import { PARSE_REFERENCES_COMMAND, TOGGLE_REFERENCES_COMMAND } from "../plugins/ReferencePlugin";
+import { Dispatch } from "../../../utils/record";
+import { sanitizeUrl } from "../../../utils/url";
interface ToolbarProps {
toolbarRef: React.RefObject<HTMLDivElement>;
+ setIsLinkEditMode: Dispatch<boolean>;
}
class InvalidTagError extends Error {
(2/6) Stage this hunk [y,n,q,a,d,K,j,J,g,/,s,e,?]? s
Split into 3 hunks.
@@ -85,8 +86,8 @@ import IconButton from "../../Inputs/IconButton";
import { RadioOption } from "../../Inputs/RadioInput";
import { TbFlask, TbLetterA, TbLetterASmall, TbTextResize } from "react-icons/tb";
import { GrDocument } from "react-icons/gr";
-import { getSelectedNode } from "../getSelectedNode";
+import { getSelectedNode } from "../utils/getSelectedNode";
import { FaCircle, FaRegCircle, FaRegSquareFull, FaSquareFull } from "react-icons/fa6";
import { TOOLBAR_ICON_SIZE } from "../../../../constants/sizing";
import { INSERT_PAGE_BREAK } from "../plugins/PageBreakPlugin";
import { PARSE_REFERENCES_COMMAND, TOGGLE_REFERENCES_COMMAND } from "../plugins/ReferencePlugin";
(2/8) Stage this hunk [y,n,q,a,d,K,j,J,g,/,e,?]? y
@@ -89,7 +90,9 @@
import { FaCircle, FaRegCircle, FaRegSquareFull, FaSquareFull } from "react-icons/fa6";
import { TOOLBAR_ICON_SIZE } from "../../../../constants/sizing";
import { INSERT_PAGE_BREAK } from "../plugins/PageBreakPlugin";
import { PARSE_REFERENCES_COMMAND, TOGGLE_REFERENCES_COMMAND } from "../plugins/ReferencePlugin";
+import { Dispatch } from "../../../utils/record";
+import { sanitizeUrl } from "../../../utils/url";
interface ToolbarProps {
toolbarRef: React.RefObject<HTMLDivElement>;
(3/8) Stage this hunk [y,n,q,a,d,K,j,J,g,/,e,?]? d
D:\Redacted\Documents\Redacted\Redacted>git st
On branch 5-custom-email-templates
Your branch is up to date with 'origin/5-custom-email-templates'.
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
modified: client/src/components/LetterWriter/toolbar/WriterToolbar.tsx
renamed: client/src/components/LetterWriter/getSelectedNode.tsx -> client/src/components/LetterWriter/utils/getSelectedNode.tsx
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: client/src/components/LetterWriter/LetterWriter.tsx
modified: client/src/components/LetterWriter/toolbar/WriterToolbar.tsx
Untracked files:
(use "git add <file>..." to include in what will be committed)
client/src/components/LetterWriter/plugins/AutoLinkPlugin.tsx
client/src/components/LetterWriter/plugins/FloatingLinkEditorPlugin/
client/src/components/LetterWriter/plugins/LinkPlugin.tsx
client/src/components/LetterWriter/utils/canUseDOM.ts
client/src/components/LetterWriter/utils/setFloatingElemPositionForLinkEditor.ts
client/src/utils/url.ts |
@hugs7, could you try to reproduce this issue in a small, isolated repository? That would significantly help us debug this issue. Thanks! |
Sure, let me see if I can replicate |
Was struggling to replicate this, even in the same repo for a moment but I think I got it. I think it's something to do with Windows allowing folder names to differ only by capitalisation, where as this isn't the case on Linux/macOS. This wasn't how I came across the issue in the first place but to replicate the steps are below. I went back in my git history to see if I ever changed the
E.g. If I then go to commit the next changes The change with the lowercase Logs below
I've performed these steps above on a test git repo for you. Please see: https://github.com/hugs7/vscode-stage-selected I've also tried to provide the commit hash next to the relevant steps listed above to match my repo. Interesting how the git log in VSCode does have --ignore-case in a few of the commands - maybe something to go off? Regardless given the steps above, it seems this issue could affect Linux/macOS too given we are renaming, then renaming back. If you would like any further clarification please let me know - happy to help however I can. |
If I try to make that final commit in cmd line, git will refuse to add the file! See shell output below.
|
Does this issue occur when all extensions are disabled?: Yes/No
VS Code Version:
Commit: ea1445c
Date: 2024-07-01T18:52:22.949Z
Electron: 29.4.0
ElectronBuildId: 9728852
Chromium: 122.0.6261.156
Node.js: 20.9.0
V8: 12.2.281.27-electron.0
OS: Windows_NT x64 10.0.22631
OS Version:
Edition Windows 11 Pro
Version 23H2
Installed on 22/09/2022
OS build 22631.3810
Experience Windows Feature Experience Pack 1000.22700.1020.0
Steps to Reproduce:
Hey team. Think I've uncovered a bug with the stage selected / stage selected range feature in the latest VSCode Update.
E.g. I've got a file
/client/src/LetterWriter/toolbar/WriterToolbar.tsx
where I want to stage just this change on line 88. See image belowWhen I click this + here, the following happens. For some reason VSCode thinks the capitalisation of the direct parent folder (actually
toolbar
with a lowercase "t") has changed to an uppercase. As seen below it duplicates the file in the working tree and the staged changes show the uppercase "T".Is this a git bug somehow (Edit: I don't think so given my first comment)? On Github, the path is definitely lowercase and the same on my local disk. See below:
I've tried clearing git cache but this issue is persistent and I've encountered the same issue with other folders too :(. I haven't ever changed the capitalisation of this
toolbar
folder.The change (line 88) does move from the working tree but only on the file with the incorrect path. Before a recent update this feature worked perfectly. Has something changed? I really like this feature and it would be good if it could be fixed.
A
git status
does also show the same as VSCode's src control tab so I'm wondering if the issue might be there instead.The text was updated successfully, but these errors were encountered: