rm titles and add .fsPaths

This commit is contained in:
Andrew Pareles 2025-03-21 19:33:03 -07:00
parent f3451d5077
commit d4e9dbb82a
6 changed files with 12 additions and 25 deletions

View file

@ -39,7 +39,7 @@ class MarkerCheckService extends Disposable implements IMarkerCheckService {
console.log(`----------------------------------------------`); console.log(`----------------------------------------------`);
console.log(`${error.resource.toString()}: ${error.startLineNumber} ${error.message} ${error.severity}`); // ! all errors in the file console.log(`${error.resource.fsPath}: ${error.startLineNumber} ${error.message} ${error.severity}`); // ! all errors in the file
try { try {
// Get the text model for the file // Get the text model for the file
@ -122,11 +122,11 @@ class MarkerCheckService extends Disposable implements IMarkerCheckService {
// const markers = this._markerService.read({ resource }); // const markers = this._markerService.read({ resource });
// if (markers.length === 0) { // if (markers.length === 0) {
// console.log(`${resource.toString()}: No diagnostics`); // console.log(`${resource.fsPath}: No diagnostics`);
// continue; // continue;
// } // }
// console.log(`Diagnostics for ${resource.toString()}:`); // console.log(`Diagnostics for ${resource.fsPath}:`);
// markers.forEach(marker => this._logMarker(marker)); // markers.forEach(marker => this._logMarker(marker));
// } // }
// }; // };

View file

@ -642,7 +642,7 @@ export class AutocompleteService extends Disposable implements IAutocompleteServ
const testMode = false const testMode = false
const docUriStr = model.uri.toString(); const docUriStr = model.uri.fsPath;
const prefixAndSuffix = getPrefixAndSuffixInfo(model, position) const prefixAndSuffix = getPrefixAndSuffixInfo(model, position)
const { prefix, suffix } = prefixAndSuffix const { prefix, suffix } = prefixAndSuffix
@ -916,7 +916,7 @@ export class AutocompleteService extends Disposable implements IAutocompleteServ
if (!resource) return; if (!resource) return;
const model = this._modelService.getModel(resource) const model = this._modelService.getModel(resource)
if (!model) return; if (!model) return;
const docUriStr = resource.toString(); const docUriStr = resource.fsPath;
if (!this._autocompletionsOfDocument[docUriStr]) return; if (!this._autocompletionsOfDocument[docUriStr]) return;
const { prefix, } = getPrefixAndSuffixInfo(model, position) const { prefix, } = getPrefixAndSuffixInfo(model, position)

View file

@ -269,7 +269,7 @@ class ChatThreadService extends Disposable implements IChatThreadService {
const newStagingSelections: StagingSelectionItem[] = oldStagingSelections.filter(s => !s.state?.wasAddedAsCurrentFile); const newStagingSelections: StagingSelectionItem[] = oldStagingSelections.filter(s => !s.state?.wasAddedAsCurrentFile);
// add the new file if it doesn't exist // add the new file if it doesn't exist
const fileIsAdded = oldStagingSelections.some(s => s.type === 'File' && s.fileURI.toString() === newStagingSelection.fileURI.toString()) const fileIsAdded = oldStagingSelections.some(s => s.type === 'File' && s.fileURI.fsPath === newStagingSelection.fileURI.fsPath)
if (!fileIsAdded) { if (!fileIsAdded) {
newStagingSelections.push(newStagingSelection) newStagingSelections.push(newStagingSelection)
} }
@ -288,7 +288,7 @@ class ChatThreadService extends Disposable implements IChatThreadService {
// this.setCurrentMessageState(focusedMessageIdx, { stagingSelections: newSelections }); // this.setCurrentMessageState(focusedMessageIdx, { stagingSelections: newSelections });
// // if the file already exists, do nothing // // if the file already exists, do nothing
// const alreadyHasFile = oldStagingSelections.some(s => s.type === 'File' && s.fileURI.toString() === newSelection.fileURI.toString()) // const alreadyHasFile = oldStagingSelections.some(s => s.type === 'File' && s.fileURI.fsPath === newSelection.fileURI.fsPath)
// if (alreadyHasFile) { return; } // if (alreadyHasFile) { return; }
// const filteredStagingSelections = oldStagingSelections.filter(s => !s.state?.wasAddedDuringFileChange); // remove all old selectons that were added during a file change // const filteredStagingSelections = oldStagingSelections.filter(s => !s.state?.wasAddedDuringFileChange); // remove all old selectons that were added during a file change
@ -1023,7 +1023,7 @@ class ChatThreadService extends Disposable implements IChatThreadService {
// get history of all AI and user added files in conversation + store in reverse order (MRU) // get history of all AI and user added files in conversation + store in reverse order (MRU)
const prevUris = this._getAllSelections(threadId) const prevUris = this._getAllSelections(threadId)
.map(s => s.fileURI) .map(s => s.fileURI)
.filter((uri, index, array) => array.findIndex(u => u.toString() === uri.toString()) === index) // O(n^2) but this is small .filter((uri, index, array) => array.findIndex(u => u.fsPath === uri.fsPath) === index) // O(n^2) but this is small
.reverse() .reverse()
@ -1039,7 +1039,7 @@ class ChatThreadService extends Disposable implements IChatThreadService {
// shorten it // shorten it
// TODO make this logic more general // TODO make this logic more general
const prevUriStrs = prevUris.map(uri => uri.toString()) const prevUriStrs = prevUris.map(uri => uri.fsPath)
const shortenedUriStrs = shorten(prevUriStrs) const shortenedUriStrs = shorten(prevUriStrs)
let displayText = shortenedUriStrs[idx] let displayText = shortenedUriStrs[idx]
const ellipsisIdx = displayText.lastIndexOf('…/'); const ellipsisIdx = displayText.lastIndexOf('…/');
@ -1064,7 +1064,7 @@ class ChatThreadService extends Disposable implements IChatThreadService {
if (doesUriMatchTarget(uri)) { if (doesUriMatchTarget(uri)) {
// TODO make this logic more general // TODO make this logic more general
const prevUriStrs = prevUris.map(uri => uri.toString()) const prevUriStrs = prevUris.map(uri => uri.fsPath)
const shortenedUriStrs = shorten(prevUriStrs) const shortenedUriStrs = shorten(prevUriStrs)
let displayText = shortenedUriStrs[idx] let displayText = shortenedUriStrs[idx]
const ellipsisIdx = displayText.lastIndexOf('…/'); const ellipsisIdx = displayText.lastIndexOf('…/');

View file

@ -17,15 +17,13 @@ enum CopyButtonText {
type IconButtonProps = { type IconButtonProps = {
onClick: () => void; onClick: () => void;
title: string
Icon: LucideIcon Icon: LucideIcon
disabled?: boolean disabled?: boolean
className?: string className?: string
} }
export const IconShell1 = ({ onClick, title, Icon, disabled, className }: IconButtonProps) => ( export const IconShell1 = ({ onClick, Icon, disabled, className }: IconButtonProps) => (
<button <button
title={title}
disabled={disabled} disabled={disabled}
onClick={(e) => { onClick={(e) => {
e.preventDefault(); e.preventDefault();
@ -92,7 +90,6 @@ const CopyButton = ({ codeStr }: { codeStr: string }) => {
return <IconShell1 return <IconShell1
Icon={copyButtonText === CopyButtonText.Copied ? Check : copyButtonText === CopyButtonText.Error ? X : Copy} Icon={copyButtonText === CopyButtonText.Copied ? Check : copyButtonText === CopyButtonText.Error ? X : Copy}
onClick={onCopy} onClick={onCopy}
title={copyButtonText}
/> />
} }
@ -114,7 +111,6 @@ export const JumpToFileButton = ({ uri }: { uri: URI | 'current' }) => {
onClick={() => { onClick={() => {
commandService.executeCommand('vscode.open', uri, { preview: true }) commandService.executeCommand('vscode.open', uri, { preview: true })
}} }}
title="Reject changes"
/> />
) )
@ -209,7 +205,6 @@ export const useApplyButtonHTML = ({ codeStr, applyBoxId, uri }: { codeStr: stri
<IconShell1 <IconShell1
Icon={Play} Icon={Play}
onClick={onClickSubmit} onClick={onClickSubmit}
title="Apply changes"
/> />
) )
@ -217,7 +212,6 @@ export const useApplyButtonHTML = ({ codeStr, applyBoxId, uri }: { codeStr: stri
<IconShell1 <IconShell1
Icon={Square} Icon={Square}
onClick={onInterrupt} onClick={onInterrupt}
title="Stop applying"
/> />
) )
@ -225,7 +219,6 @@ export const useApplyButtonHTML = ({ codeStr, applyBoxId, uri }: { codeStr: stri
<IconShell1 <IconShell1
Icon={RotateCw} Icon={RotateCw}
onClick={onReapply} onClick={onReapply}
title="Reapply changes"
/> />
) )
@ -233,7 +226,6 @@ export const useApplyButtonHTML = ({ codeStr, applyBoxId, uri }: { codeStr: stri
<IconShell1 <IconShell1
Icon={Check} Icon={Check}
onClick={onAccept} onClick={onAccept}
title="Accept changes"
className="text-green-600" className="text-green-600"
/> />
) )
@ -242,7 +234,6 @@ export const useApplyButtonHTML = ({ codeStr, applyBoxId, uri }: { codeStr: stri
<IconShell1 <IconShell1
Icon={X} Icon={X}
onClick={onReject} onClick={onReject}
title="Reject changes"
className="text-red-600" className="text-red-600"
/> />
) )

View file

@ -624,7 +624,7 @@ export const SelectedFiles = (
+ (isThisSelectionAFile ? '' : ` (${selection.range.startLineNumber}-${selection.range.endLineNumber})`) + (isThisSelectionAFile ? '' : ` (${selection.range.startLineNumber}-${selection.range.endLineNumber})`)
} }
{isThisSelectionAddedAsCurrentFile && messageIdx === undefined && currentURI?.toString() === selection.fileURI.toString() && {isThisSelectionAddedAsCurrentFile && messageIdx === undefined && currentURI?.fsPath === selection.fileURI.fsPath &&
<span className={`text-[8px] ml-0.5 'void-opacity-60 text-void-fg-4`}> <span className={`text-[8px] ml-0.5 'void-opacity-60 text-void-fg-4`}>
{`(Current File)`} {`(Current File)`}
</span> </span>

View file

@ -150,7 +150,6 @@ const VoidCommandBar = ({ uri, editor }: VoidCommandBarProps) => {
goToDiffIdx(prevDiffIdx); goToDiffIdx(prevDiffIdx);
} }
}} }}
title="Previous diff"
></button> ></button>
const downButton = <button const downButton = <button
@ -167,7 +166,6 @@ const VoidCommandBar = ({ uri, editor }: VoidCommandBarProps) => {
goToDiffIdx(nextDiffIdx); goToDiffIdx(nextDiffIdx);
} }
}} }}
title="Next diff"
></button> ></button>
const leftButton = <button const leftButton = <button
@ -184,7 +182,6 @@ const VoidCommandBar = ({ uri, editor }: VoidCommandBarProps) => {
goToURIIdx(prevURIIdx); goToURIIdx(prevURIIdx);
} }
}} }}
title="Previous file"
></button> ></button>
const rightButton = <button const rightButton = <button
@ -201,7 +198,6 @@ const VoidCommandBar = ({ uri, editor }: VoidCommandBarProps) => {
goToURIIdx(nextURIIdx); goToURIIdx(nextURIIdx);
} }
}} }}
title="Next file"
></button> ></button>