mirror of
https://github.com/voideditor/void
synced 2026-05-24 09:58:23 +00:00
rm titles and add .fsPaths
This commit is contained in:
parent
f3451d5077
commit
d4e9dbb82a
6 changed files with 12 additions and 25 deletions
|
|
@ -39,7 +39,7 @@ class MarkerCheckService extends Disposable implements IMarkerCheckService {
|
|||
|
||||
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 {
|
||||
// Get the text model for the file
|
||||
|
|
@ -122,11 +122,11 @@ class MarkerCheckService extends Disposable implements IMarkerCheckService {
|
|||
// const markers = this._markerService.read({ resource });
|
||||
|
||||
// if (markers.length === 0) {
|
||||
// console.log(`${resource.toString()}: No diagnostics`);
|
||||
// console.log(`${resource.fsPath}: No diagnostics`);
|
||||
// continue;
|
||||
// }
|
||||
|
||||
// console.log(`Diagnostics for ${resource.toString()}:`);
|
||||
// console.log(`Diagnostics for ${resource.fsPath}:`);
|
||||
// markers.forEach(marker => this._logMarker(marker));
|
||||
// }
|
||||
// };
|
||||
|
|
|
|||
|
|
@ -642,7 +642,7 @@ export class AutocompleteService extends Disposable implements IAutocompleteServ
|
|||
|
||||
const testMode = false
|
||||
|
||||
const docUriStr = model.uri.toString();
|
||||
const docUriStr = model.uri.fsPath;
|
||||
|
||||
const prefixAndSuffix = getPrefixAndSuffixInfo(model, position)
|
||||
const { prefix, suffix } = prefixAndSuffix
|
||||
|
|
@ -916,7 +916,7 @@ export class AutocompleteService extends Disposable implements IAutocompleteServ
|
|||
if (!resource) return;
|
||||
const model = this._modelService.getModel(resource)
|
||||
if (!model) return;
|
||||
const docUriStr = resource.toString();
|
||||
const docUriStr = resource.fsPath;
|
||||
if (!this._autocompletionsOfDocument[docUriStr]) return;
|
||||
|
||||
const { prefix, } = getPrefixAndSuffixInfo(model, position)
|
||||
|
|
|
|||
|
|
@ -269,7 +269,7 @@ class ChatThreadService extends Disposable implements IChatThreadService {
|
|||
const newStagingSelections: StagingSelectionItem[] = oldStagingSelections.filter(s => !s.state?.wasAddedAsCurrentFile);
|
||||
|
||||
// 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) {
|
||||
newStagingSelections.push(newStagingSelection)
|
||||
}
|
||||
|
|
@ -288,7 +288,7 @@ class ChatThreadService extends Disposable implements IChatThreadService {
|
|||
// this.setCurrentMessageState(focusedMessageIdx, { stagingSelections: newSelections });
|
||||
|
||||
// // 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; }
|
||||
|
||||
// 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)
|
||||
const prevUris = this._getAllSelections(threadId)
|
||||
.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()
|
||||
|
||||
|
||||
|
|
@ -1039,7 +1039,7 @@ class ChatThreadService extends Disposable implements IChatThreadService {
|
|||
// shorten it
|
||||
|
||||
// TODO make this logic more general
|
||||
const prevUriStrs = prevUris.map(uri => uri.toString())
|
||||
const prevUriStrs = prevUris.map(uri => uri.fsPath)
|
||||
const shortenedUriStrs = shorten(prevUriStrs)
|
||||
let displayText = shortenedUriStrs[idx]
|
||||
const ellipsisIdx = displayText.lastIndexOf('…/');
|
||||
|
|
@ -1064,7 +1064,7 @@ class ChatThreadService extends Disposable implements IChatThreadService {
|
|||
if (doesUriMatchTarget(uri)) {
|
||||
|
||||
// TODO make this logic more general
|
||||
const prevUriStrs = prevUris.map(uri => uri.toString())
|
||||
const prevUriStrs = prevUris.map(uri => uri.fsPath)
|
||||
const shortenedUriStrs = shorten(prevUriStrs)
|
||||
let displayText = shortenedUriStrs[idx]
|
||||
const ellipsisIdx = displayText.lastIndexOf('…/');
|
||||
|
|
|
|||
|
|
@ -17,15 +17,13 @@ enum CopyButtonText {
|
|||
|
||||
type IconButtonProps = {
|
||||
onClick: () => void;
|
||||
title: string
|
||||
Icon: LucideIcon
|
||||
disabled?: boolean
|
||||
className?: string
|
||||
}
|
||||
|
||||
export const IconShell1 = ({ onClick, title, Icon, disabled, className }: IconButtonProps) => (
|
||||
export const IconShell1 = ({ onClick, Icon, disabled, className }: IconButtonProps) => (
|
||||
<button
|
||||
title={title}
|
||||
disabled={disabled}
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
|
|
@ -92,7 +90,6 @@ const CopyButton = ({ codeStr }: { codeStr: string }) => {
|
|||
return <IconShell1
|
||||
Icon={copyButtonText === CopyButtonText.Copied ? Check : copyButtonText === CopyButtonText.Error ? X : Copy}
|
||||
onClick={onCopy}
|
||||
title={copyButtonText}
|
||||
/>
|
||||
}
|
||||
|
||||
|
|
@ -114,7 +111,6 @@ export const JumpToFileButton = ({ uri }: { uri: URI | 'current' }) => {
|
|||
onClick={() => {
|
||||
commandService.executeCommand('vscode.open', uri, { preview: true })
|
||||
}}
|
||||
title="Reject changes"
|
||||
/>
|
||||
)
|
||||
|
||||
|
|
@ -209,7 +205,6 @@ export const useApplyButtonHTML = ({ codeStr, applyBoxId, uri }: { codeStr: stri
|
|||
<IconShell1
|
||||
Icon={Play}
|
||||
onClick={onClickSubmit}
|
||||
title="Apply changes"
|
||||
/>
|
||||
)
|
||||
|
||||
|
|
@ -217,7 +212,6 @@ export const useApplyButtonHTML = ({ codeStr, applyBoxId, uri }: { codeStr: stri
|
|||
<IconShell1
|
||||
Icon={Square}
|
||||
onClick={onInterrupt}
|
||||
title="Stop applying"
|
||||
/>
|
||||
)
|
||||
|
||||
|
|
@ -225,7 +219,6 @@ export const useApplyButtonHTML = ({ codeStr, applyBoxId, uri }: { codeStr: stri
|
|||
<IconShell1
|
||||
Icon={RotateCw}
|
||||
onClick={onReapply}
|
||||
title="Reapply changes"
|
||||
/>
|
||||
)
|
||||
|
||||
|
|
@ -233,7 +226,6 @@ export const useApplyButtonHTML = ({ codeStr, applyBoxId, uri }: { codeStr: stri
|
|||
<IconShell1
|
||||
Icon={Check}
|
||||
onClick={onAccept}
|
||||
title="Accept changes"
|
||||
className="text-green-600"
|
||||
/>
|
||||
)
|
||||
|
|
@ -242,7 +234,6 @@ export const useApplyButtonHTML = ({ codeStr, applyBoxId, uri }: { codeStr: stri
|
|||
<IconShell1
|
||||
Icon={X}
|
||||
onClick={onReject}
|
||||
title="Reject changes"
|
||||
className="text-red-600"
|
||||
/>
|
||||
)
|
||||
|
|
|
|||
|
|
@ -624,7 +624,7 @@ export const SelectedFiles = (
|
|||
+ (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`}>
|
||||
{`(Current File)`}
|
||||
</span>
|
||||
|
|
|
|||
|
|
@ -150,7 +150,6 @@ const VoidCommandBar = ({ uri, editor }: VoidCommandBarProps) => {
|
|||
goToDiffIdx(prevDiffIdx);
|
||||
}
|
||||
}}
|
||||
title="Previous diff"
|
||||
>↑</button>
|
||||
|
||||
const downButton = <button
|
||||
|
|
@ -167,7 +166,6 @@ const VoidCommandBar = ({ uri, editor }: VoidCommandBarProps) => {
|
|||
goToDiffIdx(nextDiffIdx);
|
||||
}
|
||||
}}
|
||||
title="Next diff"
|
||||
>↓</button>
|
||||
|
||||
const leftButton = <button
|
||||
|
|
@ -184,7 +182,6 @@ const VoidCommandBar = ({ uri, editor }: VoidCommandBarProps) => {
|
|||
goToURIIdx(prevURIIdx);
|
||||
}
|
||||
}}
|
||||
title="Previous file"
|
||||
>←</button>
|
||||
|
||||
const rightButton = <button
|
||||
|
|
@ -201,7 +198,6 @@ const VoidCommandBar = ({ uri, editor }: VoidCommandBarProps) => {
|
|||
goToURIIdx(nextURIIdx);
|
||||
}
|
||||
}}
|
||||
title="Next file"
|
||||
>→</button>
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue