mirror of
https://github.com/foambubble/foam.git
synced 2026-01-10 22:48:09 -05:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
97f87692b6 | ||
|
|
4f76a6b24a | ||
|
|
c822589733 |
@@ -4,5 +4,5 @@
|
||||
],
|
||||
"npmClient": "yarn",
|
||||
"useWorkspaces": true,
|
||||
"version": "0.16.0"
|
||||
"version": "0.16.1"
|
||||
}
|
||||
|
||||
@@ -4,6 +4,12 @@ All notable changes to the "foam-vscode" extension will be documented in this fi
|
||||
|
||||
Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.
|
||||
|
||||
## [0.16.1] - 2021-11-30
|
||||
|
||||
Fixes and Improvements:
|
||||
|
||||
- Fixed diagnostic bug triggered when file had same suffix (#851)
|
||||
|
||||
## [0.16.0] - 2021-11-24
|
||||
|
||||
Features:
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
"type": "git"
|
||||
},
|
||||
"homepage": "https://github.com/foambubble/foam",
|
||||
"version": "0.16.0",
|
||||
"version": "0.16.1",
|
||||
"license": "MIT",
|
||||
"publisher": "foam",
|
||||
"engines": {
|
||||
|
||||
@@ -71,6 +71,13 @@ describe('Workspace resources', () => {
|
||||
ws.set(noteA);
|
||||
expect(ws.list()).toEqual([noteA]);
|
||||
});
|
||||
|
||||
it('#851 - listing by ID should not return files with same suffix', () => {
|
||||
const ws = createTestWorkspace()
|
||||
.set(createTestNote({ uri: 'test-file.md' }))
|
||||
.set(createTestNote({ uri: 'file.md' }));
|
||||
expect(ws.listById('file').length).toEqual(1);
|
||||
});
|
||||
});
|
||||
|
||||
describe('Graph', () => {
|
||||
|
||||
@@ -82,13 +82,14 @@ export class FoamWorkspace implements IDisposable {
|
||||
}
|
||||
|
||||
public listById(resourceId: string): Resource[] {
|
||||
if (!hasExtension(resourceId)) {
|
||||
resourceId = resourceId + '.md';
|
||||
let needle = '/' + resourceId;
|
||||
if (!hasExtension(needle)) {
|
||||
needle = needle + '.md';
|
||||
}
|
||||
resourceId = normalize(resourceId);
|
||||
needle = normalize(needle);
|
||||
let resources = [];
|
||||
for (const key of this.resources.keys()) {
|
||||
if (key.endsWith(resourceId)) {
|
||||
if (key.endsWith(needle)) {
|
||||
resources.push(this.resources.get(normalize(key)));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user