✨ feat(vscode): 代码阅读侧栏给目录、文件记注释
This commit is contained in:
1 parent
beabffdf2c
commit
05c4bec56b
14 files changed
+703
-23
No files matched your search
@@ -1,5 +1,5 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { createExcludeMatcher, sortEntries } from './fileEntries'
|
||||
import { createExcludeMatcher, entryContext, sortEntries } from './fileEntries'
|
||||
|
||||
const dir = (name: string): { name: string, isDirectory: boolean } => ({ name, isDirectory: true })
|
||||
const file = (name: string): { name: string, isDirectory: boolean } => ({ name, isDirectory: false })
|
||||
@@ -22,6 +22,14 @@ describe('文件树排序', () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe('行的 contextValue', () => {
|
||||
it('工作区根、目录、文件各一种,菜单按它挂「添加注释」', () => {
|
||||
expect(entryContext({ isDirectory: true, isRoot: true })).toBe('root')
|
||||
expect(entryContext({ isDirectory: true, isRoot: false })).toBe('folder')
|
||||
expect(entryContext({ isDirectory: false, isRoot: false })).toBe('file')
|
||||
})
|
||||
})
|
||||
|
||||
describe('files.exclude', () => {
|
||||
const none = new Set<string>()
|
||||
|
||||
|
||||
Reference in new issue
Block a user