Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ambiguous identifier when notes share the same file name with different capitalisation #1303

Open
zX3no opened this issue Nov 3, 2023 · 1 comment
Labels
bug Something isn't working foam-core Related to API, core model or feature help wanted Extra attention is needed
Milestone

Comments

@zX3no
Copy link

zX3no commented Nov 3, 2023

Describe the bug

I have this file structure:

test/
┣ a/
┃ ┗ Note.md
┣ b/
┃ ┗ note.md
┗ root.md

When writing in root.md I'm trying to add the two notes a/Note.md and b/note.md. Using autocomplete after typing [[, I get an warning for an ambiguous identifier. Both notes complete like this: [[Note]] and [[note]].

Small Reproducible Example

No response

Steps to Reproduce the Bug or Issue

  1. Create two folders with a file that has the same file name with different capitalisation.
  2. Create a note in the root.
  3. Type [[ and try to autocomplete one of the notes.
  4. It should say 'Resource identifier is ambiguous'.

Expected behavior

When files have the same capitalisation and the file structure is like this:

test/
┣ a/
┃ ┗ Note.md
┣ b/
┃ ┗ Note.md
┗ root.md

Autocompletion works correctly and detects the ambiguity. The notes are completed as [[a/Note]] and [[b/Note]].

Screenshots or Videos

Code_-_Insiders_3PJIIdXLcM

Code_-_Insiders_E5Gn0Oi5Ln

Operating System Version

Windows 10

Visual Studio Code Version

Version: 1.84.0-insider (user setup) Commit: 60182c7e1a666961ded4d0319c154f52d85daf30 Date: 2023-10-30T23:41:49.215Z Electron: 25.9.2 ElectronBuildId: 24603566 Chromium: 114.0.5735.289 Node.js: 18.15.0 V8: 11.4.183.29-electron.0 OS: Windows_NT x64 10.0.19044

Additional context

No response

@riccardoferretti
Copy link
Collaborator

Thanks for reporting this, yup looks like a bug.
Off the top of my head the issue is in FoamWorkspace.getShortestIdentifier, if someone wants to take a look maybe start from there.

@riccardoferretti riccardoferretti added bug Something isn't working help wanted Extra attention is needed foam-core Related to API, core model or feature labels Nov 3, 2023
@riccardoferretti riccardoferretti added this to the backlog milestone Nov 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working foam-core Related to API, core model or feature help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants