✨ feat(vscode): 问 AI 输入框能粘贴、拖进图片随问题发给 Claude Code,缩略图能点开看大图,图片存进 .spx/code-qa 跟着问答删
This commit is contained in:
1 parent
d9a5c3673e
commit
36d842e18e
28 files changed
+825
-121
No files matched your search
@@ -1,7 +1,7 @@
|
||||
import type { FileDeleteEvent, FileRenameEvent, WorkspaceFolder } from 'vscode'
|
||||
import type { PathMap, PathMapFile } from './pathMap'
|
||||
import { Disposable, EventEmitter, RelativePattern, Uri, window, workspace } from 'vscode'
|
||||
import { changedKeys, dropEntries, entriesUnder, moveEntries, placeEntries, readPathMap, toPathKey, writePathMap } from './pathMap'
|
||||
import { changedKeys, detachedFiles, dropEntries, entriesUnder, moveEntries, placeEntries, readPathMap, removeFiles, toPathKey, writePathMap } from './pathMap'
|
||||
|
||||
/** 一个文件 / 目录在哪个工作区文件夹里、键是什么。 */
|
||||
export interface PathLocation {
|
||||
@@ -50,7 +50,10 @@ export class FolderStore<T> implements Disposable {
|
||||
return this.maps.get(folder.uri.toString())?.[key]
|
||||
}
|
||||
|
||||
/** 读盘上最新的一份改好再写回;没变就不写,所以第一条存下之前不会生成文件。 */
|
||||
/**
|
||||
* 读盘上最新的一份改好再写回;没变就不写,所以第一条存下之前不会生成文件。
|
||||
* 写好后删掉不再有条目带着的文件(见 PathMapFile.attachments):删一条、删源文件都跟着删。
|
||||
*/
|
||||
update(folder: WorkspaceFolder, change: (map: PathMap<T>) => PathMap<T>): Promise<void> {
|
||||
return this.enqueue(async () => {
|
||||
const before = await readPathMap(folder.uri.fsPath, this.file)
|
||||
@@ -59,6 +62,7 @@ export class FolderStore<T> implements Disposable {
|
||||
return
|
||||
await writePathMap(folder.uri.fsPath, this.file, after)
|
||||
this.apply(folder, after)
|
||||
await removeFiles(folder.uri.fsPath, detachedFiles(this.file, before, after))
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user